diff --git a/.sandstorm/setup.sh b/.sandstorm/setup.sh index 35aca44868..288379743e 100755 --- a/.sandstorm/setup.sh +++ b/.sandstorm/setup.sh @@ -14,12 +14,17 @@ apt-get install -y python-software-properties software-properties-common # install all languages sed -i 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/g' /etc/locale.gen + +sed -i 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/g' /etc/locale.gen sed -i 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/g' /etc/locale.gen sed -i 's/# id_ID.UTF-8 UTF-8/id_ID.UTF-8 UTF-8/g' /etc/locale.gen +sed -i 's/# it_IT.UTF-8 UTF-8/it_IT.UTF-8 UTF-8/g' /etc/locale.gen sed -i 's/# nl_NL.UTF-8 UTF-8/nl_NL.UTF-8 UTF-8/g' /etc/locale.gen sed -i 's/# pl_PL.UTF-8 UTF-8/pl_PL.UTF-8 UTF-8/g' /etc/locale.gen +sed -i 's/# pt_BR.UTF-8 UTF-8/pt_BR.UTF-8 UTF-8/g' /etc/locale.gen sed -i 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/g' /etc/locale.gen sed -i 's/# tr_TR.UTF-8 UTF-8/tr_TR.UTF-8 UTF-8/g' /etc/locale.gen + dpkg-reconfigure --frontend=noninteractive locales diff --git a/app/Api/V1/Controllers/AboutController.php b/app/Api/V1/Controllers/AboutController.php index 721ec068fe..e7fcc291c3 100644 --- a/app/Api/V1/Controllers/AboutController.php +++ b/app/Api/V1/Controllers/AboutController.php @@ -35,16 +35,6 @@ use League\Fractal\Serializer\JsonApiSerializer; */ class AboutController extends Controller { - /** - * AccountController constructor. - * - * @throws \FireflyIII\Exceptions\FireflyException - */ - public function __construct() - { - parent::__construct(); - } - /** * @return \Illuminate\Http\JsonResponse */ diff --git a/app/Api/V1/Controllers/AccountController.php b/app/Api/V1/Controllers/AccountController.php index 7fa157ff1d..cff7969f6f 100644 --- a/app/Api/V1/Controllers/AccountController.php +++ b/app/Api/V1/Controllers/AccountController.php @@ -103,7 +103,7 @@ class AccountController extends Controller // types to get, page size: $types = $this->mapTypes($this->parameters->get('type')); - $pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data); + $pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data; // get list of accounts. Count it and split it. $collection = $this->repository->getAccountsByType($types); @@ -154,7 +154,7 @@ class AccountController extends Controller // if currency ID is 0, find the currency by the code: if (0 === $data['currency_id']) { $currency = $this->currencyRepository->findByCodeNull($data['currency_code']); - $data['currency_id'] = is_null($currency) ? 0 : $currency->id; + $data['currency_id'] = null === $currency ? 0 : $currency->id; } $account = $this->repository->store($data); $manager = new Manager(); @@ -180,7 +180,7 @@ class AccountController extends Controller // if currency ID is 0, find the currency by the code: if (0 === $data['currency_id']) { $currency = $this->currencyRepository->findByCodeNull($data['currency_code']); - $data['currency_id'] = is_null($currency) ? 0 : $currency->id; + $data['currency_id'] = null === $currency ? 0 : $currency->id; } // set correct type: $data['type'] = config('firefly.shortNamesByFullName.' . $account->accountType->type); diff --git a/app/Api/V1/Controllers/BillController.php b/app/Api/V1/Controllers/BillController.php index e26b96bbf5..562ff6d395 100644 --- a/app/Api/V1/Controllers/BillController.php +++ b/app/Api/V1/Controllers/BillController.php @@ -85,7 +85,7 @@ class BillController extends Controller */ public function index(Request $request) { - $pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data); + $pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data; $paginator = $this->repository->getPaginator($pageSize); /** @var Collection $bills */ $bills = $paginator->getCollection(); diff --git a/app/Api/V1/Controllers/Controller.php b/app/Api/V1/Controllers/Controller.php index 68f0d0c91d..047b3c5342 100644 --- a/app/Api/V1/Controllers/Controller.php +++ b/app/Api/V1/Controllers/Controller.php @@ -107,7 +107,7 @@ class Controller extends BaseController foreach ($dates as $field) { $date = request()->get($field); $obj = null; - if (!is_null($date)) { + if (null !== $date) { try { $obj = new Carbon($date); } catch (InvalidDateException $e) { diff --git a/app/Api/V1/Controllers/TransactionController.php b/app/Api/V1/Controllers/TransactionController.php index 4ecec57436..987536ee0b 100644 --- a/app/Api/V1/Controllers/TransactionController.php +++ b/app/Api/V1/Controllers/TransactionController.php @@ -91,7 +91,7 @@ class TransactionController extends Controller */ public function index(Request $request) { - $pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data); + $pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data; // read type from URI $type = $request->get('type') ?? 'default'; @@ -115,7 +115,7 @@ class TransactionController extends Controller $collector->removeFilter(InternalTransferFilter::class); } - if (!is_null($this->parameters->get('start')) && !is_null($this->parameters->get('end'))) { + if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) { $collector->setRange($this->parameters->get('start'), $this->parameters->get('end')); } $collector->setLimit($pageSize)->setPage($this->parameters->get('page')); diff --git a/app/Api/V1/Controllers/UserController.php b/app/Api/V1/Controllers/UserController.php index 4af7e7b7d8..850f6fe3a3 100644 --- a/app/Api/V1/Controllers/UserController.php +++ b/app/Api/V1/Controllers/UserController.php @@ -92,7 +92,7 @@ class UserController extends Controller public function index(Request $request) { // user preferences - $pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data); + $pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data; // make manager $manager = new Manager(); diff --git a/app/Api/V1/Requests/BillRequest.php b/app/Api/V1/Requests/BillRequest.php index 9c701e8502..9cc6a848ed 100644 --- a/app/Api/V1/Requests/BillRequest.php +++ b/app/Api/V1/Requests/BillRequest.php @@ -108,8 +108,8 @@ class BillRequest extends Request $validator->after( function (Validator $validator) { $data = $validator->getData(); - $min = floatval($data['amount_min'] ?? 0); - $max = floatval($data['amount_max'] ?? 0); + $min = (float)($data['amount_min'] ?? 0); + $max = (float)($data['amount_max'] ?? 0); if ($min > $max) { $validator->errors()->add('amount_min', trans('validation.amount_min_over_max')); } diff --git a/app/Api/V1/Requests/TransactionRequest.php b/app/Api/V1/Requests/TransactionRequest.php index 979502d98a..280a7ca741 100644 --- a/app/Api/V1/Requests/TransactionRequest.php +++ b/app/Api/V1/Requests/TransactionRequest.php @@ -80,19 +80,19 @@ class TransactionRequest extends Request $array = [ 'description' => $transaction['description'] ?? null, 'amount' => $transaction['amount'], - 'currency_id' => isset($transaction['currency_id']) ? intval($transaction['currency_id']) : null, - 'currency_code' => isset($transaction['currency_code']) ? $transaction['currency_code'] : null, + 'currency_id' => isset($transaction['currency_id']) ? (int)$transaction['currency_id'] : null, + 'currency_code' => $transaction['currency_code'] ?? null, 'foreign_amount' => $transaction['foreign_amount'] ?? null, - 'foreign_currency_id' => isset($transaction['foreign_currency_id']) ? intval($transaction['foreign_currency_id']) : null, + 'foreign_currency_id' => isset($transaction['foreign_currency_id']) ? (int)$transaction['foreign_currency_id'] : null, 'foreign_currency_code' => $transaction['foreign_currency_code'] ?? null, - 'budget_id' => isset($transaction['budget_id']) ? intval($transaction['budget_id']) : null, + 'budget_id' => isset($transaction['budget_id']) ? (int)$transaction['budget_id'] : null, 'budget_name' => $transaction['budget_name'] ?? null, - 'category_id' => isset($transaction['category_id']) ? intval($transaction['category_id']) : null, + 'category_id' => isset($transaction['category_id']) ? (int)$transaction['category_id'] : null, 'category_name' => $transaction['category_name'] ?? null, - 'source_id' => isset($transaction['source_id']) ? intval($transaction['source_id']) : null, - 'source_name' => isset($transaction['source_name']) ? strval($transaction['source_name']) : null, - 'destination_id' => isset($transaction['destination_id']) ? intval($transaction['destination_id']) : null, - 'destination_name' => isset($transaction['destination_name']) ? strval($transaction['destination_name']) : null, + 'source_id' => isset($transaction['source_id']) ? (int)$transaction['source_id'] : null, + 'source_name' => isset($transaction['source_name']) ? (string)$transaction['source_name'] : null, + 'destination_id' => isset($transaction['destination_id']) ? (int)$transaction['destination_id'] : null, + 'destination_name' => isset($transaction['destination_name']) ? (string)$transaction['destination_name'] : null, 'reconciled' => $transaction['reconciled'] ?? false, 'identifier' => $index, ]; @@ -199,8 +199,8 @@ class TransactionRequest extends Request protected function assetAccountExists(Validator $validator, ?int $accountId, ?string $accountName, string $idField, string $nameField): ?Account { - $accountId = intval($accountId); - $accountName = strval($accountName); + $accountId = (int)$accountId; + $accountName = (string)$accountName; // both empty? hard exit. if ($accountId < 1 && strlen($accountName) === 0) { $validator->errors()->add($idField, trans('validation.filled', ['attribute' => $idField])); @@ -226,7 +226,7 @@ class TransactionRequest extends Request } $account = $repository->findByNameNull($accountName, [AccountType::ASSET]); - if (is_null($account)) { + if (null === $account) { $validator->errors()->add($nameField, trans('validation.belongs_user')); return null; @@ -260,10 +260,10 @@ class TransactionRequest extends Request { $data = $validator->getData(); $transactions = $data['transactions'] ?? []; - $journalDescription = strval($data['description'] ?? ''); + $journalDescription = (string)($data['description'] ?? ''); $validDescriptions = 0; foreach ($transactions as $index => $transaction) { - if (strlen(strval($transaction['description'] ?? '')) > 0) { + if (strlen((string)($transaction['description'] ?? '')) > 0) { $validDescriptions++; } } @@ -286,7 +286,7 @@ class TransactionRequest extends Request $data = $validator->getData(); $transactions = $data['transactions'] ?? []; foreach ($transactions as $index => $transaction) { - $description = strval($transaction['description'] ?? ''); + $description = (string)($transaction['description'] ?? ''); // filled description is mandatory for split transactions. if (count($transactions) > 1 && strlen($description) === 0) { $validator->errors()->add( @@ -306,9 +306,9 @@ class TransactionRequest extends Request { $data = $validator->getData(); $transactions = $data['transactions'] ?? []; - $journalDescription = strval($data['description'] ?? ''); + $journalDescription = (string)($data['description'] ?? ''); foreach ($transactions as $index => $transaction) { - $description = strval($transaction['description'] ?? ''); + $description = (string)($transaction['description'] ?? ''); // description cannot be equal to journal description. if ($description === $journalDescription) { $validator->errors()->add('transactions.' . $index . '.description', trans('validation.equal_description')); @@ -352,8 +352,8 @@ class TransactionRequest extends Request */ protected function opposingAccountExists(Validator $validator, string $type, ?int $accountId, ?string $accountName, string $idField): ?Account { - $accountId = intval($accountId); - $accountName = strval($accountName); + $accountId = (int)$accountId; + $accountName = (string)$accountName; // both empty? done! if ($accountId < 1 && strlen($accountName) === 0) { return null; @@ -397,15 +397,15 @@ class TransactionRequest extends Request // the journal may exist in the request: /** @var Transaction $transaction */ $transaction = $this->route()->parameter('transaction'); - if (is_null($transaction)) { + if (null === $transaction) { return; // @codeCoverageIgnore } $data['type'] = strtolower($transaction->transactionJournal->transactionType->type); } foreach ($transactions as $index => $transaction) { - $sourceId = isset($transaction['source_id']) ? intval($transaction['source_id']) : null; + $sourceId = isset($transaction['source_id']) ? (int)$transaction['source_id'] : null; $sourceName = $transaction['source_name'] ?? null; - $destinationId = isset($transaction['destination_id']) ? intval($transaction['destination_id']) : null; + $destinationId = isset($transaction['destination_id']) ? (int)$transaction['destination_id'] : null; $destinationName = $transaction['destination_name'] ?? null; $sourceAccount = null; $destinationAccount = null; @@ -479,8 +479,8 @@ class TransactionRequest extends Request $destinations = []; foreach ($data['transactions'] as $transaction) { - $sources[] = isset($transaction['source_id']) ? intval($transaction['source_id']) : 0; - $destinations[] = isset($transaction['destination_id']) ? intval($transaction['destination_id']) : 0; + $sources[] = isset($transaction['source_id']) ? (int)$transaction['source_id'] : 0; + $destinations[] = isset($transaction['destination_id']) ? (int)$transaction['destination_id'] : 0; } $destinations = array_unique($destinations); $sources = array_unique($sources); diff --git a/app/Console/Commands/CreateExport.php b/app/Console/Commands/CreateExport.php index d83520a2ad..0406b5e572 100644 --- a/app/Console/Commands/CreateExport.php +++ b/app/Console/Commands/CreateExport.php @@ -129,5 +129,7 @@ class CreateExport extends Command $this->line('The export has finished! You can find the ZIP file in this location:'); $this->line(storage_path(sprintf('export/%s', $fileName))); + + return 0; } } diff --git a/app/Console/Commands/DecryptAttachment.php b/app/Console/Commands/DecryptAttachment.php index 730a402134..5792bad504 100644 --- a/app/Console/Commands/DecryptAttachment.php +++ b/app/Console/Commands/DecryptAttachment.php @@ -47,14 +47,6 @@ class DecryptAttachment extends Command = 'firefly:decrypt-attachment {id:The ID of the attachment.} {name:The file name of the attachment.} {directory:Where the file must be stored.}'; - /** - * Create a new command instance. - */ - public function __construct() - { - parent::__construct(); - } - /** * Execute the console command. * @@ -65,7 +57,7 @@ class DecryptAttachment extends Command { /** @var AttachmentRepositoryInterface $repository */ $repository = app(AttachmentRepositoryInterface::class); - $attachmentId = intval($this->argument('id')); + $attachmentId = (int)$this->argument('id'); $attachment = $repository->findWithoutUser($attachmentId); $attachmentName = trim($this->argument('name')); $storagePath = realpath(trim($this->argument('directory'))); diff --git a/app/Console/Commands/Import.php b/app/Console/Commands/Import.php index b85fc9291a..6794a31430 100644 --- a/app/Console/Commands/Import.php +++ b/app/Console/Commands/Import.php @@ -48,14 +48,6 @@ class Import extends Command */ protected $signature = 'firefly:start-import {key}'; - /** - * Create a new command instance. - */ - public function __construct() - { - parent::__construct(); - } - /** * Run the import routine. * diff --git a/app/Console/Commands/ScanAttachments.php b/app/Console/Commands/ScanAttachments.php index d13bcd7a54..e30727488e 100644 --- a/app/Console/Commands/ScanAttachments.php +++ b/app/Console/Commands/ScanAttachments.php @@ -48,14 +48,6 @@ class ScanAttachments extends Command */ protected $signature = 'firefly:scan-attachments'; - /** - * Create a new command instance. - */ - public function __construct() - { - parent::__construct(); - } - /** * Execute the console command. */ diff --git a/app/Console/Commands/UpgradeDatabase.php b/app/Console/Commands/UpgradeDatabase.php index f5c8c45e4a..61f6e2ed99 100644 --- a/app/Console/Commands/UpgradeDatabase.php +++ b/app/Console/Commands/UpgradeDatabase.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands; use DB; +use Exception; use FireflyIII\Models\Account; use FireflyIII\Models\AccountMeta; use FireflyIII\Models\AccountType; @@ -64,18 +65,8 @@ class UpgradeDatabase extends Command */ protected $signature = 'firefly:upgrade-database'; - /** - * Create a new command instance. - */ - public function __construct() - { - parent::__construct(); - } - /** * Execute the console command. - * - * @throws \Exception */ public function handle() { @@ -120,7 +111,7 @@ class UpgradeDatabase extends Command $journalIds = array_unique($result->pluck('id')->toArray()); foreach ($journalIds as $journalId) { - $this->updateJournalidentifiers(intval($journalId)); + $this->updateJournalidentifiers((int)$journalId); } return; @@ -142,9 +133,9 @@ class UpgradeDatabase extends Command // get users preference, fall back to system pref. $defaultCurrencyCode = Preferences::getForUser($account->user, 'currencyPreference', config('firefly.default_currency', 'EUR'))->data; $defaultCurrency = TransactionCurrency::where('code', $defaultCurrencyCode)->first(); - $accountCurrency = intval($account->getMeta('currency_id')); + $accountCurrency = (int)$account->getMeta('currency_id'); $openingBalance = $account->getOpeningBalance(); - $obCurrency = intval($openingBalance->transaction_currency_id); + $obCurrency = (int)$openingBalance->transaction_currency_id; // both 0? set to default currency: if (0 === $accountCurrency && 0 === $obCurrency) { @@ -211,7 +202,7 @@ class UpgradeDatabase extends Command } /** @var Account $account */ $account = $transaction->account; - $currency = $repository->find(intval($account->getMeta('currency_id'))); + $currency = $repository->find((int)$account->getMeta('currency_id')); $transactions = $journal->transactions()->get(); $transactions->each( function (Transaction $transaction) use ($currency) { @@ -221,8 +212,8 @@ class UpgradeDatabase extends Command } // when mismatch in transaction: - if (!(intval($transaction->transaction_currency_id) === intval($currency->id))) { - $transaction->foreign_currency_id = intval($transaction->transaction_currency_id); + if (!((int)$transaction->transaction_currency_id === (int)$currency->id)) { + $transaction->foreign_currency_id = (int)$transaction->transaction_currency_id; $transaction->foreign_amount = $transaction->amount; $transaction->transaction_currency_id = $currency->id; $transaction->save(); @@ -274,11 +265,11 @@ class UpgradeDatabase extends Command { // create transaction type "Reconciliation". $type = TransactionType::where('type', TransactionType::RECONCILIATION)->first(); - if (is_null($type)) { + if (null === $type) { TransactionType::create(['type' => TransactionType::RECONCILIATION]); } $account = AccountType::where('type', AccountType::RECONCILIATION)->first(); - if (is_null($account)) { + if (null === $account) { AccountType::create(['type' => AccountType::RECONCILIATION]); } } @@ -295,11 +286,11 @@ class UpgradeDatabase extends Command foreach ($attachments as $att) { // move description: - $description = strval($att->description); + $description = (string)$att->description; if (strlen($description) > 0) { // find or create note: $note = $att->notes()->first(); - if (is_null($note)) { + if (null === $note) { $note = new Note; $note->noteable()->associate($att); } @@ -317,8 +308,6 @@ class UpgradeDatabase extends Command /** * Move all the journal_meta notes to their note object counter parts. - * - * @throws \Exception */ private function migrateNotes(): void { @@ -335,7 +324,11 @@ class UpgradeDatabase extends Command $note->text = $meta->data; $note->save(); Log::debug(sprintf('Migrated meta note #%d to Note #%d', $meta->id, $note->id)); - $meta->delete(); + try { + $meta->delete(); + } catch (Exception $e) { + Log::error(sprintf('Could not delete old meta entry #%d: %s', $meta->id, $e->getMessage())); + } } } @@ -348,10 +341,10 @@ class UpgradeDatabase extends Command { /** @var CurrencyRepositoryInterface $repository */ $repository = app(CurrencyRepositoryInterface::class); - $currency = $repository->find(intval($transaction->account->getMeta('currency_id'))); + $currency = $repository->find((int)$transaction->account->getMeta('currency_id')); $journal = $transaction->transactionJournal; - if (!(intval($currency->id) === intval($journal->transaction_currency_id))) { + if (!((int)$currency->id === (int)$journal->transaction_currency_id)) { $this->line( sprintf( 'Transfer #%d ("%s") has been updated to use %s instead of %s.', @@ -382,7 +375,7 @@ class UpgradeDatabase extends Command /** @var Transaction $transaction */ foreach ($transactions as $transaction) { // find opposing: - $amount = bcmul(strval($transaction->amount), '-1'); + $amount = bcmul((string)$transaction->amount, '-1'); try { /** @var Transaction $opposing */ @@ -432,18 +425,18 @@ class UpgradeDatabase extends Command { /** @var CurrencyRepositoryInterface $repository */ $repository = app(CurrencyRepositoryInterface::class); - $currency = $repository->find(intval($transaction->account->getMeta('currency_id'))); + $currency = $repository->find((int)$transaction->account->getMeta('currency_id')); // has no currency ID? Must have, so fill in using account preference: if (null === $transaction->transaction_currency_id) { - $transaction->transaction_currency_id = intval($currency->id); + $transaction->transaction_currency_id = (int)$currency->id; Log::debug(sprintf('Transaction #%d has no currency setting, now set to %s', $transaction->id, $currency->code)); $transaction->save(); } // does not match the source account (see above)? Can be fixed // when mismatch in transaction and NO foreign amount is set: - if (!(intval($transaction->transaction_currency_id) === intval($currency->id)) && null === $transaction->foreign_amount) { + if (!((int)$transaction->transaction_currency_id === (int)$currency->id) && null === $transaction->foreign_amount) { Log::debug( sprintf( 'Transaction #%d has a currency setting #%d that should be #%d. Amount remains %s, currency is changed.', @@ -453,7 +446,7 @@ class UpgradeDatabase extends Command $transaction->amount ) ); - $transaction->transaction_currency_id = intval($currency->id); + $transaction->transaction_currency_id = (int)$currency->id; $transaction->save(); } @@ -462,7 +455,7 @@ class UpgradeDatabase extends Command $journal = $transaction->transactionJournal; /** @var Transaction $opposing */ $opposing = $journal->transactions()->where('amount', '>', 0)->where('identifier', $transaction->identifier)->first(); - $opposingCurrency = $repository->find(intval($opposing->account->getMeta('currency_id'))); + $opposingCurrency = $repository->find((int)$opposing->account->getMeta('currency_id')); if (null === $opposingCurrency->id) { Log::error(sprintf('Account #%d ("%s") must have currency preference but has none.', $opposing->account->id, $opposing->account->name)); @@ -471,7 +464,7 @@ class UpgradeDatabase extends Command } // if the destination account currency is the same, both foreign_amount and foreign_currency_id must be NULL for both transactions: - if (intval($opposingCurrency->id) === intval($currency->id)) { + if ((int)$opposingCurrency->id === (int)$currency->id) { // update both transactions to match: $transaction->foreign_amount = null; $transaction->foreign_currency_id = null; @@ -485,7 +478,7 @@ class UpgradeDatabase extends Command return; } // if destination account currency is different, both transactions must have this currency as foreign currency id. - if (!(intval($opposingCurrency->id) === intval($currency->id))) { + if (!((int)$opposingCurrency->id === (int)$currency->id)) { $transaction->foreign_currency_id = $opposingCurrency->id; $opposing->foreign_currency_id = $opposingCurrency->id; $transaction->save(); @@ -495,14 +488,14 @@ class UpgradeDatabase extends Command // if foreign amount of one is null and the other is not, use this to restore: if (null === $transaction->foreign_amount && null !== $opposing->foreign_amount) { - $transaction->foreign_amount = bcmul(strval($opposing->foreign_amount), '-1'); + $transaction->foreign_amount = bcmul((string)$opposing->foreign_amount, '-1'); $transaction->save(); Log::debug(sprintf('Restored foreign amount of transaction (1) #%d to %s', $transaction->id, $transaction->foreign_amount)); } // if foreign amount of one is null and the other is not, use this to restore (other way around) if (null === $opposing->foreign_amount && null !== $transaction->foreign_amount) { - $opposing->foreign_amount = bcmul(strval($transaction->foreign_amount), '-1'); + $opposing->foreign_amount = bcmul((string)$transaction->foreign_amount, '-1'); $opposing->save(); Log::debug(sprintf('Restored foreign amount of transaction (2) #%d to %s', $opposing->id, $opposing->foreign_amount)); } @@ -512,14 +505,14 @@ class UpgradeDatabase extends Command $foreignAmount = $journal->getMeta('foreign_amount'); if (null === $foreignAmount) { Log::debug(sprintf('Journal #%d has missing foreign currency data, forced to do 1:1 conversion :(.', $transaction->transaction_journal_id)); - $transaction->foreign_amount = bcmul(strval($transaction->amount), '-1'); - $opposing->foreign_amount = bcmul(strval($opposing->amount), '-1'); + $transaction->foreign_amount = bcmul((string)$transaction->amount, '-1'); + $opposing->foreign_amount = bcmul((string)$opposing->amount, '-1'); $transaction->save(); $opposing->save(); return; } - $foreignPositive = app('steam')->positive(strval($foreignAmount)); + $foreignPositive = app('steam')->positive((string)$foreignAmount); Log::debug( sprintf( 'Journal #%d has missing foreign currency info, try to restore from meta-data ("%s").', diff --git a/app/Console/Commands/UpgradeFireflyInstructions.php b/app/Console/Commands/UpgradeFireflyInstructions.php index 375ef4b5ec..7c7ff814d3 100644 --- a/app/Console/Commands/UpgradeFireflyInstructions.php +++ b/app/Console/Commands/UpgradeFireflyInstructions.php @@ -42,14 +42,6 @@ class UpgradeFireflyInstructions extends Command */ protected $signature = 'firefly:instructions {task}'; - /** - * Create a new command instance. - */ - public function __construct() - { - parent::__construct(); - } - /** * Execute the console command. */ diff --git a/app/Console/Commands/UseEncryption.php b/app/Console/Commands/UseEncryption.php index b772a6a2fe..e9cbde4aed 100644 --- a/app/Console/Commands/UseEncryption.php +++ b/app/Console/Commands/UseEncryption.php @@ -44,14 +44,6 @@ class UseEncryption extends Command */ protected $signature = 'firefly:use-encryption'; - /** - * Create a new command instance. - */ - public function __construct() - { - parent::__construct(); - } - /** * Execute the console command. */ diff --git a/app/Console/Commands/VerifyDatabase.php b/app/Console/Commands/VerifyDatabase.php index 3a0137d074..6a13b74dd6 100644 --- a/app/Console/Commands/VerifyDatabase.php +++ b/app/Console/Commands/VerifyDatabase.php @@ -61,14 +61,6 @@ class VerifyDatabase extends Command */ protected $signature = 'firefly:verify'; - /** - * Create a new command instance. - */ - public function __construct() - { - parent::__construct(); - } - /** * Execute the console command. */ @@ -158,7 +150,7 @@ class VerifyDatabase extends Command ->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')]); /** @var stdClass $entry */ foreach ($journals as $entry) { - if (0 !== bccomp(strval($entry->the_sum), '0')) { + if (0 !== bccomp((string)$entry->the_sum, '0')) { $errored[] = $entry->transaction_journal_id; } } @@ -171,7 +163,7 @@ class VerifyDatabase extends Command // report about it /** @var TransactionJournal $journal */ $journal = TransactionJournal::find($journalId); - if (is_null($journal)) { + if (null === $journal) { continue; } if (TransactionType::OPENING_BALANCE === $journal->transactionType->type) { @@ -297,7 +289,7 @@ class VerifyDatabase extends Command ); /** @var stdClass $entry */ foreach ($set as $entry) { - $date = null === $entry->transaction_deleted_at ? $entry->journal_deleted_at : $entry->transaction_deleted_at; + $date = $entry->transaction_deleted_at ?? $entry->journal_deleted_at; $this->error( 'Error: Account #' . $entry->account_id . ' should have been deleted, but has not.' . ' Find it in the table called "accounts" and change the "deleted_at" field to: "' . $date . '"' @@ -448,7 +440,7 @@ class VerifyDatabase extends Command /** @var User $user */ foreach ($userRepository->all() as $user) { - $sum = strval($user->transactions()->sum('amount')); + $sum = (string)$user->transactions()->sum('amount'); if (0 !== bccomp($sum, '0')) { $this->error('Error: Transactions for user #' . $user->id . ' (' . $user->email . ') are off by ' . $sum . '!'); } else { diff --git a/app/Export/Collector/AttachmentCollector.php b/app/Export/Collector/AttachmentCollector.php index 478fd5eeac..36adbfcb6b 100644 --- a/app/Export/Collector/AttachmentCollector.php +++ b/app/Export/Collector/AttachmentCollector.php @@ -118,7 +118,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface */ private function exportFileName($attachment): string { - return sprintf('%s-Attachment nr. %s - %s', $this->job->key, strval($attachment->id), $attachment->filename); + return sprintf('%s-Attachment nr. %s - %s', $this->job->key, (string)$attachment->id, $attachment->filename); } /** @@ -127,8 +127,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface private function getAttachments(): Collection { $this->repository->setUser($this->user); - $attachments = $this->repository->getBetween($this->start, $this->end); - return $attachments; + return $this->repository->getBetween($this->start, $this->end); } } diff --git a/app/Export/Entry/Entry.php b/app/Export/Entry/Entry.php index 82e1d38358..d6e4917999 100644 --- a/app/Export/Entry/Entry.php +++ b/app/Export/Entry/Entry.php @@ -199,31 +199,29 @@ final class Entry $entry->transaction_id = $transaction->id; $entry->date = $transaction->date->format('Ymd'); $entry->description = $transaction->description; - if (strlen(strval($transaction->transaction_description)) > 0) { + if (strlen((string)$transaction->transaction_description) > 0) { $entry->description = $transaction->transaction_description . '(' . $transaction->description . ')'; } $entry->currency_code = $transaction->transactionCurrency->code; - $entry->amount = strval(round($transaction->transaction_amount, $transaction->transactionCurrency->decimal_places)); + $entry->amount = (string)round($transaction->transaction_amount, $transaction->transactionCurrency->decimal_places); $entry->foreign_currency_code = null === $transaction->foreign_currency_id ? null : $transaction->foreignCurrency->code; $entry->foreign_amount = null === $transaction->foreign_currency_id ? null - : strval( - round( - $transaction->transaction_foreign_amount, - $transaction->foreignCurrency->decimal_places - ) + : (string)round( + $transaction->transaction_foreign_amount, + $transaction->foreignCurrency->decimal_places ); $entry->transaction_type = $transaction->transaction_type_type; - $entry->asset_account_id = strval($transaction->account_id); + $entry->asset_account_id = (string)$transaction->account_id; $entry->asset_account_name = app('steam')->tryDecrypt($transaction->account_name); $entry->asset_account_iban = $transaction->account_iban; $entry->asset_account_number = $transaction->account_number; $entry->asset_account_bic = $transaction->account_bic; $entry->asset_currency_code = $transaction->account_currency_code; - $entry->opposing_account_id = strval($transaction->opposing_account_id); + $entry->opposing_account_id = (string)$transaction->opposing_account_id; $entry->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name); $entry->opposing_account_iban = $transaction->opposing_account_iban; $entry->opposing_account_number = $transaction->opposing_account_number; @@ -231,7 +229,7 @@ final class Entry $entry->opposing_currency_code = $transaction->opposing_currency_code; // budget - $entry->budget_id = strval($transaction->transaction_budget_id); + $entry->budget_id = (string)$transaction->transaction_budget_id; $entry->budget_name = app('steam')->tryDecrypt($transaction->transaction_budget_name); if (null === $transaction->transaction_budget_id) { $entry->budget_id = $transaction->transaction_journal_budget_id; @@ -239,7 +237,7 @@ final class Entry } // category - $entry->category_id = strval($transaction->transaction_category_id); + $entry->category_id = (string)$transaction->transaction_category_id; $entry->category_name = app('steam')->tryDecrypt($transaction->transaction_category_name); if (null === $transaction->transaction_category_id) { $entry->category_id = $transaction->transaction_journal_category_id; @@ -247,7 +245,7 @@ final class Entry } // budget - $entry->bill_id = strval($transaction->bill_id); + $entry->bill_id = (string)$transaction->bill_id; $entry->bill_name = app('steam')->tryDecrypt($transaction->bill_name); $entry->tags = $transaction->tags; diff --git a/app/Export/ExpandedProcessor.php b/app/Export/ExpandedProcessor.php index 7f56bb91cd..3f8d71ae57 100644 --- a/app/Export/ExpandedProcessor.php +++ b/app/Export/ExpandedProcessor.php @@ -118,11 +118,11 @@ class ExpandedProcessor implements ProcessorInterface $currencies = $this->getAccountCurrencies($ibans); $transactions->each( function (Transaction $transaction) use ($notes, $tags, $ibans, $currencies) { - $journalId = intval($transaction->journal_id); - $accountId = intval($transaction->account_id); - $opposingId = intval($transaction->opposing_account_id); - $currencyId = $ibans[$accountId]['currency_id'] ?? 0; - $opposingCurrencyId = $ibans[$opposingId]['currency_id'] ?? 0; + $journalId = (int)$transaction->journal_id; + $accountId = (int)$transaction->account_id; + $opposingId = (int)$transaction->opposing_account_id; + $currencyId = (int)($ibans[$accountId]['currency_id'] ?? 0.0); + $opposingCurrencyId = (int)($ibans[$opposingId]['currency_id'] ?? 0.0); $transaction->notes = $notes[$journalId] ?? ''; $transaction->tags = implode(',', $tags[$journalId] ?? []); $transaction->account_number = $ibans[$accountId]['accountNumber'] ?? ''; @@ -263,7 +263,7 @@ class ExpandedProcessor implements ProcessorInterface $ids = []; $repository->setUser($this->job->user); foreach ($array as $value) { - $ids[] = $value['currency_id'] ?? 0; + $ids[] = (int)($value['currency_id'] ?? 0.0); } $ids = array_unique($ids); $result = $repository->getByIds($ids); @@ -293,7 +293,7 @@ class ExpandedProcessor implements ProcessorInterface ->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data']); /** @var AccountMeta $meta */ foreach ($set as $meta) { - $id = intval($meta->account_id); + $id = (int)$meta->account_id; $return[$id][$meta->name] = $meta->data; } @@ -316,8 +316,8 @@ class ExpandedProcessor implements ProcessorInterface $return = []; /** @var Note $note */ foreach ($notes as $note) { - if (strlen(trim(strval($note->text))) > 0) { - $id = intval($note->noteable_id); + if (strlen(trim((string)$note->text)) > 0) { + $id = (int)$note->noteable_id; $return[$id] = $note->text; } } @@ -343,8 +343,8 @@ class ExpandedProcessor implements ProcessorInterface ->get(['tag_transaction_journal.transaction_journal_id', 'tags.tag']); $result = []; foreach ($set as $entry) { - $id = intval($entry->transaction_journal_id); - $result[$id] = isset($result[$id]) ? $result[$id] : []; + $id = (int)$entry->transaction_journal_id; + $result[$id] = $result[$id] ?? []; $result[$id][] = Crypt::decrypt($entry->tag); } diff --git a/app/Export/Exporter/CsvExporter.php b/app/Export/Exporter/CsvExporter.php index 78945230e8..8eec22225c 100644 --- a/app/Export/Exporter/CsvExporter.php +++ b/app/Export/Exporter/CsvExporter.php @@ -34,14 +34,6 @@ class CsvExporter extends BasicExporter implements ExporterInterface /** @var string */ private $fileName; - /** - * CsvExporter constructor. - */ - public function __construct() - { - parent::__construct(); - } - /** * @return string */ @@ -53,7 +45,6 @@ class CsvExporter extends BasicExporter implements ExporterInterface /** * @return bool * - * @throws \TypeError */ public function run(): bool { diff --git a/app/Factory/AccountFactory.php b/app/Factory/AccountFactory.php index 53e2f98afe..1687fb03b1 100644 --- a/app/Factory/AccountFactory.php +++ b/app/Factory/AccountFactory.php @@ -43,7 +43,6 @@ class AccountFactory * @param array $data * * @return Account - * @throws \FireflyIII\Exceptions\FireflyException */ public function create(array $data): Account { @@ -64,8 +63,8 @@ class AccountFactory 'user_id' => $this->user->id, 'account_type_id' => $type->id, 'name' => $data['name'], - 'virtual_balance' => strlen(strval($data['virtualBalance'])) === 0 ? '0' : $data['virtualBalance'], - 'active' => true === $data['active'] ? true : false, + 'virtual_balance' => $data['virtualBalance'] ?? '0', + 'active' => true === $data['active'], 'iban' => $data['iban'], ]; @@ -117,8 +116,6 @@ class AccountFactory * @param string $accountType * * @return Account - * @throws \FireflyIII\Exceptions\FireflyException - * @throws \FireflyIII\Exceptions\FireflyException */ public function findOrCreate(string $accountName, string $accountType): Account { @@ -161,13 +158,13 @@ class AccountFactory */ protected function getAccountType(?int $accountTypeId, ?string $accountType): ?AccountType { - $accountTypeId = intval($accountTypeId); + $accountTypeId = (int)$accountTypeId; if ($accountTypeId > 0) { return AccountType::find($accountTypeId); } - $type = config('firefly.accountTypeByIdentifier.' . strval($accountType)); + $type = config('firefly.accountTypeByIdentifier.' . (string)$accountType); $result = AccountType::whereType($type)->first(); - if (is_null($result) && !is_null($accountType)) { + if (null === $result && null !== $accountType) { // try as full name: $result = AccountType::whereType($accountType)->first(); } diff --git a/app/Factory/BillFactory.php b/app/Factory/BillFactory.php index dabd71f412..552c53eb5e 100644 --- a/app/Factory/BillFactory.php +++ b/app/Factory/BillFactory.php @@ -47,7 +47,7 @@ class BillFactory { $matchArray = explode(',', $data['match']); $matchArray = array_unique($matchArray); - $match = join(',', $matchArray); + $match = implode(',', $matchArray); /** @var Bill $bill */ $bill = Bill::create( @@ -81,14 +81,14 @@ class BillFactory */ public function find(?int $billId, ?string $billName): ?Bill { - $billId = intval($billId); - $billName = strval($billName); + $billId = (int)$billId; + $billName = (string)$billName; // first find by ID: if ($billId > 0) { /** @var Bill $bill */ $bill = $this->user->bills()->find($billId); - if (!is_null($bill)) { + if (null !== $bill) { return $bill; } } @@ -96,7 +96,7 @@ class BillFactory // then find by name: if (strlen($billName) > 0) { $bill = $this->findByName($billName); - if (!is_null($bill)) { + if (null !== $bill) { return $bill; } } diff --git a/app/Factory/BudgetFactory.php b/app/Factory/BudgetFactory.php index 001b509852..0549ca27a4 100644 --- a/app/Factory/BudgetFactory.php +++ b/app/Factory/BudgetFactory.php @@ -44,8 +44,8 @@ class BudgetFactory */ public function find(?int $budgetId, ?string $budgetName): ?Budget { - $budgetId = intval($budgetId); - $budgetName = strval($budgetName); + $budgetId = (int)$budgetId; + $budgetName = (string)$budgetName; if (strlen($budgetName) === 0 && $budgetId === 0) { return null; @@ -55,14 +55,14 @@ class BudgetFactory if ($budgetId > 0) { /** @var Budget $budget */ $budget = $this->user->budgets()->find($budgetId); - if (!is_null($budget)) { + if (null !== $budget) { return $budget; } } if (strlen($budgetName) > 0) { $budget = $this->findByName($budgetName); - if (!is_null($budget)) { + if (null !== $budget) { return $budget; } } diff --git a/app/Factory/CategoryFactory.php b/app/Factory/CategoryFactory.php index c71d3d202d..85d42954ab 100644 --- a/app/Factory/CategoryFactory.php +++ b/app/Factory/CategoryFactory.php @@ -44,16 +44,18 @@ class CategoryFactory */ public function findByName(string $name): ?Category { + $result = null; /** @var Collection $collection */ $collection = $this->user->categories()->get(); /** @var Category $category */ foreach ($collection as $category) { if ($category->name === $name) { - return $category; + $result = $category; + break; } } - return null; + return $result; } /** @@ -64,8 +66,8 @@ class CategoryFactory */ public function findOrCreate(?int $categoryId, ?string $categoryName): ?Category { - $categoryId = intval($categoryId); - $categoryName = strval($categoryName); + $categoryId = (int)$categoryId; + $categoryName = (string)$categoryName; Log::debug(sprintf('Going to find category with ID %d and name "%s"', $categoryId, $categoryName)); @@ -76,14 +78,14 @@ class CategoryFactory if ($categoryId > 0) { /** @var Category $category */ $category = $this->user->categories()->find($categoryId); - if (!is_null($category)) { + if (null !== $category) { return $category; } } if (strlen($categoryName) > 0) { $category = $this->findByName($categoryName); - if (!is_null($category)) { + if (null !== $category) { return $category; } diff --git a/app/Factory/PiggyBankEventFactory.php b/app/Factory/PiggyBankEventFactory.php index f5e0005387..441bc9a130 100644 --- a/app/Factory/PiggyBankEventFactory.php +++ b/app/Factory/PiggyBankEventFactory.php @@ -46,7 +46,7 @@ class PiggyBankEventFactory public function create(TransactionJournal $journal, ?PiggyBank $piggyBank): ?PiggyBankEvent { Log::debug(sprintf('Now in PiggyBankEventCreate for a %s', $journal->transactionType->type)); - if (is_null($piggyBank)) { + if (null === $piggyBank) { return null; } diff --git a/app/Factory/PiggyBankFactory.php b/app/Factory/PiggyBankFactory.php index 4eb5f232ee..795f1044be 100644 --- a/app/Factory/PiggyBankFactory.php +++ b/app/Factory/PiggyBankFactory.php @@ -43,8 +43,8 @@ class PiggyBankFactory */ public function find(?int $piggyBankId, ?string $piggyBankName): ?PiggyBank { - $piggyBankId = intval($piggyBankId); - $piggyBankName = strval($piggyBankName); + $piggyBankId = (int)$piggyBankId; + $piggyBankName = (string)$piggyBankName; if (strlen($piggyBankName) === 0 && $piggyBankId === 0) { return null; } @@ -52,7 +52,7 @@ class PiggyBankFactory if ($piggyBankId > 0) { /** @var PiggyBank $piggyBank */ $piggyBank = $this->user->piggyBanks()->find($piggyBankId); - if (!is_null($piggyBank)) { + if (null !== $piggyBank) { return $piggyBank; } } @@ -61,7 +61,7 @@ class PiggyBankFactory if (strlen($piggyBankName) > 0) { /** @var PiggyBank $piggyBank */ $piggyBank = $this->findByName($piggyBankName); - if (!is_null($piggyBank)) { + if (null !== $piggyBank) { return $piggyBank; } } diff --git a/app/Factory/TagFactory.php b/app/Factory/TagFactory.php index ea9f36ec73..483255f246 100644 --- a/app/Factory/TagFactory.php +++ b/app/Factory/TagFactory.php @@ -65,7 +65,7 @@ class TagFactory */ public function findOrCreate(string $tag): ?Tag { - if (is_null($this->tags)) { + if (null === $this->tags) { $this->tags = $this->user->tags()->get(); } diff --git a/app/Factory/TransactionCurrencyFactory.php b/app/Factory/TransactionCurrencyFactory.php index 2cb05b23aa..623f441042 100644 --- a/app/Factory/TransactionCurrencyFactory.php +++ b/app/Factory/TransactionCurrencyFactory.php @@ -65,24 +65,24 @@ class TransactionCurrencyFactory */ public function find(?int $currencyId, ?string $currencyCode): ?TransactionCurrency { - $currencyCode = strval($currencyCode); - $currencyId = intval($currencyId); + $currencyCode = (string)$currencyCode; + $currencyId = (int)$currencyId; - if (strlen($currencyCode) === 0 && intval($currencyId) === 0) { + if (strlen($currencyCode) === 0 && (int)$currencyId === 0) { return null; } // first by ID: if ($currencyId > 0) { $currency = TransactionCurrency::find($currencyId); - if (!is_null($currency)) { + if (null !== $currency) { return $currency; } } // then by code: if (strlen($currencyCode) > 0) { $currency = TransactionCurrency::whereCode($currencyCode)->first(); - if (!is_null($currency)) { + if (null !== $currency) { return $currency; } } diff --git a/app/Factory/TransactionFactory.php b/app/Factory/TransactionFactory.php index 5dfdc9c60c..468ff3f17e 100644 --- a/app/Factory/TransactionFactory.php +++ b/app/Factory/TransactionFactory.php @@ -90,7 +90,7 @@ class TransactionFactory $source = $this->create( [ 'description' => $description, - 'amount' => app('steam')->negative(strval($data['amount'])), + 'amount' => app('steam')->negative((string)$data['amount']), 'foreign_amount' => null, 'currency' => $currency, 'account' => $sourceAccount, @@ -103,7 +103,7 @@ class TransactionFactory $dest = $this->create( [ 'description' => $description, - 'amount' => app('steam')->positive(strval($data['amount'])), + 'amount' => app('steam')->positive((string)$data['amount']), 'foreign_amount' => null, 'currency' => $currency, 'account' => $destinationAccount, @@ -119,9 +119,9 @@ class TransactionFactory $this->setForeignCurrency($dest, $foreign); // set foreign amount: - if (!is_null($data['foreign_amount'])) { - $this->setForeignAmount($source, app('steam')->negative(strval($data['foreign_amount']))); - $this->setForeignAmount($dest, app('steam')->positive(strval($data['foreign_amount']))); + if (null !== $data['foreign_amount']) { + $this->setForeignAmount($source, app('steam')->negative((string)$data['foreign_amount'])); + $this->setForeignAmount($dest, app('steam')->positive((string)$data['foreign_amount'])); } // set budget: diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index c96a1304d4..6d452d0a01 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -40,8 +40,6 @@ class TransactionJournalFactory private $user; /** - * Create a new transaction journal and associated transactions. - * * @param array $data * * @return TransactionJournal @@ -89,11 +87,11 @@ class TransactionJournalFactory $this->connectTags($journal, $data); // store note: - $this->storeNote($journal, strval($data['notes'])); + $this->storeNote($journal, (string)$data['notes']); // store date meta fields (if present): $fields = ['sepa-cc', 'sepa-ct-op', 'sepa-ct-id', 'sepa-db', 'sepa-country', 'sepa-ep', 'sepa-ci', 'interest_date', 'book_date', 'process_date', - 'due_date', 'payment_date', 'invoice_date', 'internal_reference','bunq_payment_id']; + 'due_date', 'payment_date', 'invoice_date', 'internal_reference', 'bunq_payment_id']; foreach ($fields as $field) { $this->storeMeta($journal, $data, $field); @@ -124,7 +122,7 @@ class TransactionJournalFactory $factory->setUser($this->user); $piggyBank = $factory->find($data['piggy_bank_id'], $data['piggy_bank_name']); - if (!is_null($piggyBank)) { + if (null !== $piggyBank) { /** @var PiggyBankEventFactory $factory */ $factory = app(PiggyBankEventFactory::class); $factory->create($journal, $piggyBank); @@ -144,7 +142,8 @@ class TransactionJournalFactory { $factory = app(TransactionTypeFactory::class); $transactionType = $factory->find($type); - if (is_null($transactionType)) { + if (null === $transactionType) { + Log::error(sprintf('Could not find transaction type for "%s"', $type)); // @codeCoverageIgnore throw new FireflyException(sprintf('Could not find transaction type for "%s"', $type)); // @codeCoverageIgnore } diff --git a/app/Generator/Chart/Basic/ChartJsGenerator.php b/app/Generator/Chart/Basic/ChartJsGenerator.php index 52021958d8..4b81a7148d 100644 --- a/app/Generator/Chart/Basic/ChartJsGenerator.php +++ b/app/Generator/Chart/Basic/ChartJsGenerator.php @@ -128,7 +128,7 @@ class ChartJsGenerator implements GeneratorInterface $index = 0; foreach ($data as $key => $value) { // make larger than 0 - $chartData['datasets'][0]['data'][] = floatval(Steam::positive($value)); + $chartData['datasets'][0]['data'][] = (float)Steam::positive($value); $chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index); $chartData['labels'][] = $key; ++$index; diff --git a/app/Generator/Report/Account/MonthReportGenerator.php b/app/Generator/Report/Account/MonthReportGenerator.php index 76ff55629b..3897e7b456 100644 --- a/app/Generator/Report/Account/MonthReportGenerator.php +++ b/app/Generator/Report/Account/MonthReportGenerator.php @@ -43,12 +43,11 @@ class MonthReportGenerator implements ReportGeneratorInterface /** * @return string * - * @throws \Throwable */ public function generate(): string { - $accountIds = join(',', $this->accounts->pluck('id')->toArray()); - $expenseIds = join(',', $this->expense->pluck('id')->toArray()); + $accountIds = implode(',', $this->accounts->pluck('id')->toArray()); + $expenseIds = implode(',', $this->expense->pluck('id')->toArray()); $reportType = 'account'; $preferredPeriod = $this->preferredPeriod(); diff --git a/app/Generator/Report/Audit/MonthReportGenerator.php b/app/Generator/Report/Audit/MonthReportGenerator.php index e8d9205417..a4acdfcb24 100644 --- a/app/Generator/Report/Audit/MonthReportGenerator.php +++ b/app/Generator/Report/Audit/MonthReportGenerator.php @@ -45,7 +45,6 @@ class MonthReportGenerator implements ReportGeneratorInterface /** * @return string - * @throws \Throwable */ public function generate(): string { @@ -61,7 +60,7 @@ class MonthReportGenerator implements ReportGeneratorInterface $defaultShow = ['icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'to']; $reportType = 'audit'; - $accountIds = join(',', $this->accounts->pluck('id')->toArray()); + $accountIds = implode(',', $this->accounts->pluck('id')->toArray()); $hideable = ['buttons', 'icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'interest_date', 'book_date', 'process_date', // three new optional fields. @@ -173,7 +172,7 @@ class MonthReportGenerator implements ReportGeneratorInterface $journals = $journals->reverse(); $dayBeforeBalance = Steam::balance($account, $date); $startBalance = $dayBeforeBalance; - $currency = $currencyRepos->find(intval($account->getMeta('currency_id'))); + $currency = $currencyRepos->find((int)$account->getMeta('currency_id')); /** @var Transaction $transaction */ foreach ($journals as $transaction) { @@ -193,9 +192,9 @@ class MonthReportGenerator implements ReportGeneratorInterface $return = [ 'journals' => $journals->reverse(), 'exists' => $journals->count() > 0, - 'end' => $this->end->formatLocalized(strval(trans('config.month_and_day'))), + 'end' => $this->end->formatLocalized((string)trans('config.month_and_day')), 'endBalance' => Steam::balance($account, $this->end), - 'dayBefore' => $date->formatLocalized(strval(trans('config.month_and_day'))), + 'dayBefore' => $date->formatLocalized((string)trans('config.month_and_day')), 'dayBeforeBalance' => $dayBeforeBalance, ]; diff --git a/app/Generator/Report/Budget/MonthReportGenerator.php b/app/Generator/Report/Budget/MonthReportGenerator.php index ad26a9d435..d5e0a8a9a0 100644 --- a/app/Generator/Report/Budget/MonthReportGenerator.php +++ b/app/Generator/Report/Budget/MonthReportGenerator.php @@ -63,12 +63,11 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface /** * @return string - * @throws \Throwable */ public function generate(): string { - $accountIds = join(',', $this->accounts->pluck('id')->toArray()); - $budgetIds = join(',', $this->budgets->pluck('id')->toArray()); + $accountIds = implode(',', $this->accounts->pluck('id')->toArray()); + $budgetIds = implode(',', $this->budgets->pluck('id')->toArray()); $expenses = $this->getExpenses(); $accountSummary = $this->summarizeByAccount($expenses); $budgetSummary = $this->summarizeByBudget($expenses); @@ -200,8 +199,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface ]; /** @var Transaction $transaction */ foreach ($collection as $transaction) { - $jrnlBudId = intval($transaction->transaction_journal_budget_id); - $transBudId = intval($transaction->transaction_budget_id); + $jrnlBudId = (int)$transaction->transaction_journal_budget_id; + $transBudId = (int)$transaction->transaction_budget_id; $budgetId = max($jrnlBudId, $transBudId); $result[$budgetId] = $result[$budgetId] ?? '0'; $result[$budgetId] = bcadd($transaction->transaction_amount, $result[$budgetId]); diff --git a/app/Generator/Report/Category/MonthReportGenerator.php b/app/Generator/Report/Category/MonthReportGenerator.php index 0b32b11007..31ca187d53 100644 --- a/app/Generator/Report/Category/MonthReportGenerator.php +++ b/app/Generator/Report/Category/MonthReportGenerator.php @@ -64,12 +64,11 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface /** * @return string - * @throws \Throwable */ public function generate(): string { - $accountIds = join(',', $this->accounts->pluck('id')->toArray()); - $categoryIds = join(',', $this->categories->pluck('id')->toArray()); + $accountIds = implode(',', $this->accounts->pluck('id')->toArray()); + $categoryIds = implode(',', $this->categories->pluck('id')->toArray()); $reportType = 'category'; $expenses = $this->getExpenses(); $income = $this->getIncome(); @@ -240,8 +239,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface $result = []; /** @var Transaction $transaction */ foreach ($collection as $transaction) { - $jrnlCatId = intval($transaction->transaction_journal_category_id); - $transCatId = intval($transaction->transaction_category_id); + $jrnlCatId = (int)$transaction->transaction_journal_category_id; + $transCatId = (int)$transaction->transaction_category_id; $categoryId = max($jrnlCatId, $transCatId); $result[$categoryId] = $result[$categoryId] ?? '0'; $result[$categoryId] = bcadd($transaction->transaction_amount, $result[$categoryId]); diff --git a/app/Generator/Report/Standard/MonthReportGenerator.php b/app/Generator/Report/Standard/MonthReportGenerator.php index c8f14e8923..792eb4bd31 100644 --- a/app/Generator/Report/Standard/MonthReportGenerator.php +++ b/app/Generator/Report/Standard/MonthReportGenerator.php @@ -42,14 +42,14 @@ class MonthReportGenerator implements ReportGeneratorInterface /** * @return string * - * @throws \Throwable + */ public function generate(): string { /** @var ReportHelperInterface $helper */ $helper = app(ReportHelperInterface::class); $bills = $helper->getBillReport($this->start, $this->end, $this->accounts); - $accountIds = join(',', $this->accounts->pluck('id')->toArray()); + $accountIds = implode(',', $this->accounts->pluck('id')->toArray()); $reportType = 'default'; // continue! diff --git a/app/Generator/Report/Standard/MultiYearReportGenerator.php b/app/Generator/Report/Standard/MultiYearReportGenerator.php index 7ddff3dfa5..558c395339 100644 --- a/app/Generator/Report/Standard/MultiYearReportGenerator.php +++ b/app/Generator/Report/Standard/MultiYearReportGenerator.php @@ -41,12 +41,12 @@ class MultiYearReportGenerator implements ReportGeneratorInterface /** * @return string * - * @throws \Throwable + */ public function generate(): string { // and some id's, joined: - $accountIds = join(',', $this->accounts->pluck('id')->toArray()); + $accountIds = implode(',', $this->accounts->pluck('id')->toArray()); $reportType = 'default'; // continue! diff --git a/app/Generator/Report/Standard/YearReportGenerator.php b/app/Generator/Report/Standard/YearReportGenerator.php index 258478c44a..fc0e06d2f7 100644 --- a/app/Generator/Report/Standard/YearReportGenerator.php +++ b/app/Generator/Report/Standard/YearReportGenerator.php @@ -41,12 +41,12 @@ class YearReportGenerator implements ReportGeneratorInterface /** * @return string * - * @throws \Throwable + */ public function generate(): string { // and some id's, joined: - $accountIds = join(',', $this->accounts->pluck('id')->toArray()); + $accountIds = implode(',', $this->accounts->pluck('id')->toArray()); $reportType = 'default'; // continue! diff --git a/app/Generator/Report/Support.php b/app/Generator/Report/Support.php index 4219f8f892..f739509769 100644 --- a/app/Generator/Report/Support.php +++ b/app/Generator/Report/Support.php @@ -35,9 +35,7 @@ class Support */ public function getTopExpenses(): Collection { - $transactions = $this->getExpenses()->sortBy('transaction_amount'); - - return $transactions; + return $this->getExpenses()->sortBy('transaction_amount'); } /** @@ -45,9 +43,7 @@ class Support */ public function getTopIncome(): Collection { - $transactions = $this->getIncome()->sortByDesc('transaction_amount'); - - return $transactions; + return $this->getIncome()->sortByDesc('transaction_amount'); } /** @@ -78,13 +74,13 @@ class Support } ++$result[$opposingId]['count']; $result[$opposingId]['sum'] = bcadd($result[$opposingId]['sum'], $transaction->transaction_amount); - $result[$opposingId]['average'] = bcdiv($result[$opposingId]['sum'], strval($result[$opposingId]['count'])); + $result[$opposingId]['average'] = bcdiv($result[$opposingId]['sum'], (string)$result[$opposingId]['count']); } // sort result by average: $average = []; foreach ($result as $key => $row) { - $average[$key] = floatval($row['average']); + $average[$key] = (float)$row['average']; } array_multisort($average, $sortFlag, $result); diff --git a/app/Generator/Report/Tag/MonthReportGenerator.php b/app/Generator/Report/Tag/MonthReportGenerator.php index e1cdc808fc..678339cc12 100644 --- a/app/Generator/Report/Tag/MonthReportGenerator.php +++ b/app/Generator/Report/Tag/MonthReportGenerator.php @@ -65,12 +65,11 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface /** * @return string - * @throws \Throwable */ public function generate(): string { - $accountIds = join(',', $this->accounts->pluck('id')->toArray()); - $tagTags = join(',', $this->tags->pluck('tag')->toArray()); + $accountIds = implode(',', $this->accounts->pluck('id')->toArray()); + $tagTags = implode(',', $this->tags->pluck('tag')->toArray()); $reportType = 'tag'; $expenses = $this->getExpenses(); $income = $this->getIncome(); diff --git a/app/Handlers/Events/AdminEventHandler.php b/app/Handlers/Events/AdminEventHandler.php index 2cfe634aa1..83225c7e53 100644 --- a/app/Handlers/Events/AdminEventHandler.php +++ b/app/Handlers/Events/AdminEventHandler.php @@ -22,13 +22,13 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events; +use Exception; use FireflyIII\Events\AdminRequestedTestMessage; use FireflyIII\Mail\AdminTestMail; use FireflyIII\Repositories\User\UserRepositoryInterface; use Log; use Mail; use Session; -use Swift_TransportException; /** * Class AdminEventHandler. @@ -61,7 +61,7 @@ class AdminEventHandler Log::debug('Trying to send message...'); Mail::to($email)->send(new AdminTestMail($email, $ipAddress)); // @codeCoverageIgnoreStart - } catch (Swift_TransportException $e) { + } catch (Exception $e) { Log::debug('Send message failed! :('); Log::error($e->getMessage()); Log::error($e->getTraceAsString()); diff --git a/app/Handlers/Events/UserEventHandler.php b/app/Handlers/Events/UserEventHandler.php index e89d04aa57..e953e039d1 100644 --- a/app/Handlers/Events/UserEventHandler.php +++ b/app/Handlers/Events/UserEventHandler.php @@ -22,6 +22,7 @@ declare(strict_types=1); namespace FireflyIII\Handlers\Events; +use Exception; use FireflyIII\Events\RegisteredUser; use FireflyIII\Events\RequestedNewPassword; use FireflyIII\Events\UserChangedEmail; @@ -36,7 +37,6 @@ use Illuminate\Auth\Events\Login; use Log; use Mail; use Preferences; -use Swift_TransportException; /** * Class UserEventHandler. @@ -95,7 +95,7 @@ class UserEventHandler } // user is the only user but does not have role "owner". $role = $repository->getRole('owner'); - if (is_null($role)) { + if (null === $role) { // create role, does not exist. Very strange situation so let's raise a big fuss about it. $role = $repository->createRole('owner', 'Site Owner', 'User runs this instance of FF3'); Log::error('Could not find role "owner". This is weird.'); @@ -124,7 +124,7 @@ class UserEventHandler try { Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $uri, $ipAddress)); // @codeCoverageIgnoreStart - } catch (Swift_TransportException $e) { + } catch (Exception $e) { Log::error($e->getMessage()); } @@ -148,7 +148,7 @@ class UserEventHandler try { Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $uri, $ipAddress)); // @codeCoverageIgnoreStart - } catch (Swift_TransportException $e) { + } catch (Exception $e) { Log::error($e->getMessage()); } @@ -173,7 +173,7 @@ class UserEventHandler try { Mail::to($email)->send(new RequestedNewPasswordMail($url, $ipAddress)); // @codeCoverageIgnoreStart - } catch (Swift_TransportException $e) { + } catch (Exception $e) { Log::error($e->getMessage()); } @@ -205,7 +205,7 @@ class UserEventHandler try { Mail::to($email)->send(new RegisteredUserMail($uri, $ipAddress)); // @codeCoverageIgnoreStart - } catch (Swift_TransportException $e) { + } catch (Exception $e) { Log::error($e->getMessage()); } diff --git a/app/Handlers/Events/VersionCheckEventHandler.php b/app/Handlers/Events/VersionCheckEventHandler.php index 9c5f2a6264..2cecd97947 100644 --- a/app/Handlers/Events/VersionCheckEventHandler.php +++ b/app/Handlers/Events/VersionCheckEventHandler.php @@ -99,7 +99,7 @@ class VersionCheckEventHandler } $string = 'no result: ' . $check; if ($check === -2) { - $string = strval(trans('firefly.update_check_error')); + $string = (string)trans('firefly.update_check_error'); } if ($check === -1) { // there is a new FF version! diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php index 6ade273a6a..d4e0aa5878 100644 --- a/app/Helpers/Attachments/AttachmentHelper.php +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -56,7 +56,7 @@ class AttachmentHelper implements AttachmentHelperInterface */ public function __construct() { - $this->maxUploadSize = intval(config('firefly.maxUploadSize')); + $this->maxUploadSize = (int)config('firefly.maxUploadSize'); $this->allowedMimes = (array)config('firefly.allowedMimes'); $this->errors = new MessageBag; $this->messages = new MessageBag; @@ -71,7 +71,7 @@ class AttachmentHelper implements AttachmentHelperInterface */ public function getAttachmentLocation(Attachment $attachment): string { - $path = sprintf('%s%sat-%d.data', storage_path('upload'), DIRECTORY_SEPARATOR, intval($attachment->id)); + $path = sprintf('%s%sat-%d.data', storage_path('upload'), DIRECTORY_SEPARATOR, (int)$attachment->id); return $path; } diff --git a/app/Helpers/Chart/MetaPieChart.php b/app/Helpers/Chart/MetaPieChart.php index 556b3422ce..de7694ef12 100644 --- a/app/Helpers/Chart/MetaPieChart.php +++ b/app/Helpers/Chart/MetaPieChart.php @@ -103,7 +103,7 @@ class MetaPieChart implements MetaPieChartInterface $transactions = $this->getTransactions($direction); $grouped = $this->groupByFields($transactions, $this->grouping[$group]); $chartData = $this->organizeByType($group, $grouped); - $key = strval(trans('firefly.everything_else')); + $key = (string)trans('firefly.everything_else'); // also collect all other transactions if ($this->collectOtherObjects && 'expense' === $direction) { @@ -113,7 +113,7 @@ class MetaPieChart implements MetaPieChartInterface $collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::WITHDRAWAL]); $journals = $collector->getJournals(); - $sum = strval($journals->sum('transaction_amount')); + $sum = (string)$journals->sum('transaction_amount'); $sum = bcmul($sum, '-1'); $sum = bcsub($sum, $this->total); $chartData[$key] = $sum; @@ -125,7 +125,7 @@ class MetaPieChart implements MetaPieChartInterface $collector->setUser($this->user); $collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::DEPOSIT]); $journals = $collector->getJournals(); - $sum = strval($journals->sum('transaction_amount')); + $sum = (string)$journals->sum('transaction_amount'); $sum = bcsub($sum, $this->total); $chartData[$key] = $sum; } @@ -308,7 +308,7 @@ class MetaPieChart implements MetaPieChartInterface foreach ($set as $transaction) { $values = []; foreach ($fields as $field) { - $values[] = intval($transaction->$field); + $values[] = (int)$transaction->$field; } $value = max($values); $grouped[$value] = $grouped[$value] ?? '0'; @@ -332,7 +332,7 @@ class MetaPieChart implements MetaPieChartInterface $repository->setUser($this->user); foreach ($array as $objectId => $amount) { if (!isset($names[$objectId])) { - $object = $repository->find(intval($objectId)); + $object = $repository->find((int)$objectId); $names[$objectId] = $object->name ?? $object->tag; } $amount = Steam::positive($amount); diff --git a/app/Helpers/Collection/BalanceLine.php b/app/Helpers/Collection/BalanceLine.php index c1de6d9211..a998b4784e 100644 --- a/app/Helpers/Collection/BalanceLine.php +++ b/app/Helpers/Collection/BalanceLine.php @@ -162,13 +162,13 @@ class BalanceLine return $this->getBudget()->name; } if (self::ROLE_DEFAULTROLE === $this->getRole()) { - return strval(trans('firefly.no_budget')); + return (string)trans('firefly.no_budget'); } if (self::ROLE_TAGROLE === $this->getRole()) { - return strval(trans('firefly.coveredWithTags')); + return (string)trans('firefly.coveredWithTags'); } if (self::ROLE_DIFFROLE === $this->getRole()) { - return strval(trans('firefly.leftUnbalanced')); + return (string)trans('firefly.leftUnbalanced'); } return ''; diff --git a/app/Helpers/Collection/Bill.php b/app/Helpers/Collection/Bill.php index 24b7174043..1cc2a7b50e 100644 --- a/app/Helpers/Collection/Bill.php +++ b/app/Helpers/Collection/Bill.php @@ -101,7 +101,7 @@ class Bill { $set = $this->bills->sortBy( function (BillLine $bill) { - $active = 0 === intval($bill->getBill()->active) ? 1 : 0; + $active = 0 === (int)$bill->getBill()->active ? 1 : 0; $name = $bill->getBill()->name; return $active . $name; diff --git a/app/Helpers/Collection/BillLine.php b/app/Helpers/Collection/BillLine.php index 180aefa3be..ed5bcbdaf1 100644 --- a/app/Helpers/Collection/BillLine.php +++ b/app/Helpers/Collection/BillLine.php @@ -190,7 +190,7 @@ class BillLine */ public function isActive(): bool { - return 1 === intval($this->bill->active); + return 1 === (int)$this->bill->active; } /** diff --git a/app/Helpers/Collector/JournalCollector.php b/app/Helpers/Collector/JournalCollector.php index 5463421094..4895be8241 100644 --- a/app/Helpers/Collector/JournalCollector.php +++ b/app/Helpers/Collector/JournalCollector.php @@ -237,7 +237,7 @@ class JournalCollector implements JournalCollectorInterface $countQuery->getQuery()->groups = null; $countQuery->getQuery()->orders = null; $countQuery->groupBy('accounts.user_id'); - $this->count = intval($countQuery->count()); + $this->count = (int)$countQuery->count(); return $this->count; } @@ -270,10 +270,10 @@ class JournalCollector implements JournalCollectorInterface $set->each( function (Transaction $transaction) { $transaction->date = new Carbon($transaction->date); - $transaction->description = Steam::decrypt(intval($transaction->encrypted), $transaction->description); + $transaction->description = Steam::decrypt((int)$transaction->encrypted, $transaction->description); if (null !== $transaction->bill_name) { - $transaction->bill_name = Steam::decrypt(intval($transaction->bill_name_encrypted), $transaction->bill_name); + $transaction->bill_name = Steam::decrypt((int)$transaction->bill_name_encrypted, $transaction->bill_name); } $transaction->account_name = app('steam')->tryDecrypt($transaction->account_name); $transaction->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name); @@ -338,7 +338,7 @@ class JournalCollector implements JournalCollectorInterface if ($accounts->count() > 0) { $accountIds = $accounts->pluck('id')->toArray(); $this->query->whereIn('transactions.account_id', $accountIds); - Log::debug(sprintf('setAccounts: %s', join(', ', $accountIds))); + Log::debug(sprintf('setAccounts: %s', implode(', ', $accountIds))); $this->accountIds = $accountIds; } @@ -834,7 +834,6 @@ class JournalCollector implements JournalCollectorInterface /** * - * @throws \InvalidArgumentException */ private function joinOpposingTables() { diff --git a/app/Helpers/Filter/AmountFilter.php b/app/Helpers/Filter/AmountFilter.php index 5183dbac82..c6530a129a 100644 --- a/app/Helpers/Filter/AmountFilter.php +++ b/app/Helpers/Filter/AmountFilter.php @@ -35,7 +35,7 @@ use Log; class AmountFilter implements FilterInterface { /** @var int */ - private $modifier = 0; + private $modifier; /** * AmountFilter constructor. diff --git a/app/Helpers/Filter/CountAttachmentsFilter.php b/app/Helpers/Filter/CountAttachmentsFilter.php index 3103de0e54..94a58c4bba 100644 --- a/app/Helpers/Filter/CountAttachmentsFilter.php +++ b/app/Helpers/Filter/CountAttachmentsFilter.php @@ -57,7 +57,7 @@ class CountAttachmentsFilter implements FilterInterface $set->each( function (Transaction $transaction) use ($counter) { $id = (int)$transaction->journal_id; - $count = $counter[$id] ?? 0; + $count = (int)($counter[$id] ?? 0.0); $transaction->attachmentCount = $count; } ); diff --git a/app/Helpers/Filter/InternalTransferFilter.php b/app/Helpers/Filter/InternalTransferFilter.php index 589310d7db..e9dcaeb215 100644 --- a/app/Helpers/Filter/InternalTransferFilter.php +++ b/app/Helpers/Filter/InternalTransferFilter.php @@ -36,7 +36,7 @@ use Log; class InternalTransferFilter implements FilterInterface { /** @var array */ - private $accounts = []; + private $accounts; /** * InternalTransferFilter constructor. diff --git a/app/Helpers/Filter/OpposingAccountFilter.php b/app/Helpers/Filter/OpposingAccountFilter.php index 890e4793dd..85f6cd0449 100644 --- a/app/Helpers/Filter/OpposingAccountFilter.php +++ b/app/Helpers/Filter/OpposingAccountFilter.php @@ -35,7 +35,7 @@ use Log; class OpposingAccountFilter implements FilterInterface { /** @var array */ - private $accounts = []; + private $accounts; /** * InternalTransferFilter constructor. diff --git a/app/Helpers/Filter/SplitIndicatorFilter.php b/app/Helpers/Filter/SplitIndicatorFilter.php index 5d59ce5496..c85880e098 100644 --- a/app/Helpers/Filter/SplitIndicatorFilter.php +++ b/app/Helpers/Filter/SplitIndicatorFilter.php @@ -54,7 +54,7 @@ class SplitIndicatorFilter implements FilterInterface $set->each( function (Transaction $transaction) use ($counter) { $id = (int)$transaction->journal_id; - $count = $counter[$id] ?? 0; + $count = (int)($counter[$id] ?? 0.0); $transaction->is_split = false; if ($count > 2) { $transaction->is_split = true; diff --git a/app/Helpers/Filter/TransferFilter.php b/app/Helpers/Filter/TransferFilter.php index 98efeb473c..5a9cbb86df 100644 --- a/app/Helpers/Filter/TransferFilter.php +++ b/app/Helpers/Filter/TransferFilter.php @@ -52,11 +52,11 @@ class TransferFilter implements FilterInterface // make property string: $journalId = $transaction->transaction_journal_id; $amount = Steam::positive($transaction->transaction_amount); - $accountIds = [intval($transaction->account_id), intval($transaction->opposing_account_id)]; - $transactionIds = [$transaction->id, intval($transaction->opposing_id)]; + $accountIds = [(int)$transaction->account_id, (int)$transaction->opposing_account_id]; + $transactionIds = [$transaction->id, (int)$transaction->opposing_id]; sort($accountIds); sort($transactionIds); - $key = $journalId . '-' . join(',', $transactionIds) . '-' . join(',', $accountIds) . '-' . $amount; + $key = $journalId . '-' . implode(',', $transactionIds) . '-' . implode(',', $accountIds) . '-' . $amount; if (!isset($count[$key])) { // not yet counted? add to new set and count it: $new->push($transaction); diff --git a/app/Helpers/FiscalHelper.php b/app/Helpers/FiscalHelper.php index 19faa6d579..10130eb16f 100644 --- a/app/Helpers/FiscalHelper.php +++ b/app/Helpers/FiscalHelper.php @@ -73,8 +73,8 @@ class FiscalHelper implements FiscalHelperInterface $startDate = clone $date; if (true === $this->useCustomFiscalYear) { $prefStartStr = Preferences::get('fiscalYearStart', '01-01')->data; - list($mth, $day) = explode('-', $prefStartStr); - $startDate->month(intval($mth))->day(intval($day)); + [$mth, $day] = explode('-', $prefStartStr); + $startDate->month((int)$mth)->day((int)$day); // if start date is after passed date, sub 1 year. if ($startDate > $date) { diff --git a/app/Helpers/Help/Help.php b/app/Helpers/Help/Help.php index db7d34fef9..cf7711bf55 100644 --- a/app/Helpers/Help/Help.php +++ b/app/Helpers/Help/Help.php @@ -23,10 +23,10 @@ declare(strict_types=1); namespace FireflyIII\Helpers\Help; use Cache; +use Exception; use League\CommonMark\CommonMarkConverter; use Log; use Requests; -use Requests_Exception; use Route; /** @@ -68,7 +68,7 @@ class Help implements HelpInterface $content = ''; try { $result = Requests::get($uri, [], $opt); - } catch (Requests_Exception $e) { + } catch (Exception $e) { Log::error($e); return ''; diff --git a/app/Helpers/Report/BudgetReportHelper.php b/app/Helpers/Report/BudgetReportHelper.php index 4ad44c2a2c..7e8382d84f 100644 --- a/app/Helpers/Report/BudgetReportHelper.php +++ b/app/Helpers/Report/BudgetReportHelper.php @@ -91,7 +91,7 @@ class BudgetReportHelper implements BudgetReportHelperInterface 'id' => $budget->id, 'name' => $budget->name, - 'budgeted' => strval($budgetLimit->amount), + 'budgeted' => (string)$budgetLimit->amount, 'spent' => $data['expenses'], 'left' => $data['left'], 'overspent' => $data['overspent'], diff --git a/app/Helpers/Report/PopupReport.php b/app/Helpers/Report/PopupReport.php index 188e21ec70..73e786e24b 100644 --- a/app/Helpers/Report/PopupReport.php +++ b/app/Helpers/Report/PopupReport.php @@ -75,9 +75,8 @@ class PopupReport implements PopupReportInterface /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); $collector->setAccounts(new Collection([$account]))->setRange($attributes['startDate'], $attributes['endDate'])->setBudget($budget); - $journals = $collector->getJournals(); - return $journals; + return $collector->getJournals(); } /** @@ -118,9 +117,8 @@ class PopupReport implements PopupReportInterface if (null !== $budget->id) { $collector->setBudget($budget); } - $journals = $collector->getJournals(); - return $journals; + return $collector->getJournals(); } /** @@ -136,9 +134,8 @@ class PopupReport implements PopupReportInterface $collector->setAccounts($attributes['accounts'])->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER]) ->setRange($attributes['startDate'], $attributes['endDate'])->withOpposingAccount() ->setCategory($category); - $journals = $collector->getJournals(); - return $journals; + return $collector->getJournals(); } /** diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index 5359c309a2..1365e1a27d 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -90,8 +90,8 @@ class ReportHelper implements ReportHelperInterface $billLine->setBill($bill); $billLine->setPayDate($payDate); $billLine->setEndOfPayDate($endOfPayPeriod); - $billLine->setMin(strval($bill->amount_min)); - $billLine->setMax(strval($bill->amount_max)); + $billLine->setMin((string)$bill->amount_min); + $billLine->setMax((string)$bill->amount_max); $billLine->setHit(false); $entry = $journals->filter( function (Transaction $transaction) use ($bill) { @@ -119,7 +119,6 @@ class ReportHelper implements ReportHelperInterface * @param Carbon $date * * @return array - * @throws \InvalidArgumentException */ public function listOfMonths(Carbon $date): array { diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php index 4ac431f472..a844c703f5 100644 --- a/app/Http/Controllers/Account/ReconcileController.php +++ b/app/Http/Controllers/Account/ReconcileController.php @@ -123,7 +123,6 @@ class ReconcileController extends Controller * @return \Illuminate\Http\JsonResponse * * @throws FireflyException - * @throws \Throwable */ public function overview(Request $request, Account $account, Carbon $start, Carbon $end) { @@ -189,7 +188,7 @@ class ReconcileController extends Controller return redirect(route('accounts.index', [config('firefly.shortNamesByFullName.' . $account->accountType->type)])); } - $currencyId = intval($this->accountRepos->getMetaValue($account, 'currency_id')); + $currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id'); $currency = $this->currencyRepos->findNull($currencyId); if (0 === $currencyId) { $currency = app('amount')->getDefaultCurrency(); // @codeCoverageIgnore @@ -263,7 +262,7 @@ class ReconcileController extends Controller /** @var Transaction $transaction */ foreach ($data['transactions'] as $transactionId) { - $repository->reconcileById(intval($transactionId)); + $repository->reconcileById((int)$transactionId); } Log::debug('Reconciled all transactions.'); @@ -300,7 +299,7 @@ class ReconcileController extends Controller 'tags' => null, 'interest_date' => null, 'transactions' => [[ - 'currency_id' => intval($this->accountRepos->getMetaValue($account, 'currency_id')), + 'currency_id' => (int)$this->accountRepos->getMetaValue($account, 'currency_id'), 'currency_code' => null, 'description' => null, 'amount' => app('steam')->positive($difference), @@ -338,7 +337,6 @@ class ReconcileController extends Controller * * @return mixed * - * @throws \Throwable * @throws FireflyException */ public function transactions(Account $account, Carbon $start, Carbon $end) @@ -350,7 +348,7 @@ class ReconcileController extends Controller $startDate = clone $start; $startDate->subDays(1); - $currencyId = intval($this->accountRepos->getMetaValue($account, 'currency_id')); + $currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id'); $currency = $this->currencyRepos->findNull($currencyId); if (0 === $currencyId) { $currency = app('amount')->getDefaultCurrency(); // @codeCoverageIgnore @@ -400,7 +398,7 @@ class ReconcileController extends Controller $destination = $this->repository->getJournalDestinationAccounts($journal)->first(); if (bccomp($submitted['amount'], '0') === 1) { // amount is positive, switch accounts: - list($source, $destination) = [$destination, $source]; + [$source, $destination] = [$destination, $source]; } // expand data with journal data: @@ -417,7 +415,7 @@ class ReconcileController extends Controller 'interest_date' => null, 'book_date' => null, 'transactions' => [[ - 'currency_id' => intval($journal->transaction_currency_id), + 'currency_id' => (int)$journal->transaction_currency_id, 'currency_code' => null, 'description' => null, 'amount' => app('steam')->positive($submitted['amount']), @@ -442,7 +440,7 @@ class ReconcileController extends Controller $this->repository->update($journal, $data); // @codeCoverageIgnoreStart - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { Session::put('reconcile.edit.fromUpdate', true); return redirect(route('accounts.reconcile.edit', [$journal->id]))->withInput(['return_to_edit' => 1]); diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index f43e22938e..6e92d75b4e 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -84,7 +84,6 @@ class AccountController extends Controller * @param string $what * * @return View - * @throws \RuntimeException */ public function create(Request $request, string $what = 'asset') { @@ -133,18 +132,17 @@ class AccountController extends Controller * @param Account $account * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function destroy(Request $request, Account $account) { $type = $account->accountType->type; $typeName = config('firefly.shortNamesByFullName.' . $type); $name = $account->name; - $moveTo = $this->repository->findNull(intval($request->get('move_account_before_delete'))); + $moveTo = $this->repository->findNull((int)$request->get('move_account_before_delete')); $this->repository->destroy($account, $moveTo); - $request->session()->flash('success', strval(trans('firefly.' . $typeName . '_deleted', ['name' => $name]))); + $request->session()->flash('success', (string)trans('firefly.' . $typeName . '_deleted', ['name' => $name])); Preferences::mark(); return redirect($this->getPreviousUri('accounts.delete.uri')); @@ -163,7 +161,7 @@ class AccountController extends Controller * @SuppressWarnings(PHPMD.CyclomaticComplexity) // long and complex but not that excessively so. * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * - * @throws \RuntimeException + */ public function edit(Request $request, Account $account, AccountRepositoryInterface $repository) { @@ -174,7 +172,7 @@ class AccountController extends Controller $currencySelectList = ExpandedForm::makeSelectList($allCurrencies); $roles = []; foreach (config('firefly.accountRoles') as $role) { - $roles[$role] = strval(trans('firefly.account_role_' . $role)); + $roles[$role] = (string)trans('firefly.account_role_' . $role); } // put previous url in session if not redirect from store (not "return_to_edit"). @@ -186,11 +184,11 @@ class AccountController extends Controller // pre fill some useful values. // the opening balance is tricky: - $openingBalanceAmount = strval($repository->getOpeningBalanceAmount($account)); + $openingBalanceAmount = (string)$repository->getOpeningBalanceAmount($account); $openingBalanceDate = $repository->getOpeningBalanceDate($account); $default = app('amount')->getDefaultCurrency(); - $currency = $this->currencyRepos->findNull(intval($repository->getMetaValue($account, 'currency_id'))); - if (is_null($currency)) { + $currency = $this->currencyRepos->findNull((int)$repository->getMetaValue($account, 'currency_id')); + if (null === $currency) { $currency = $default; } @@ -246,8 +244,8 @@ class AccountController extends Controller $types = config('firefly.accountTypesByIdentifier.' . $what); $collection = $this->repository->getAccountsByType($types); $total = $collection->count(); - $page = 0 === intval($request->get('page')) ? 1 : intval($request->get('page')); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page'); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; $accounts = $collection->slice(($page - 1) * $pageSize, $pageSize); unset($collection); /** @var Carbon $start */ @@ -378,7 +376,6 @@ class AccountController extends Controller * @param AccountFormRequest $request * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function store(AccountFormRequest $request) { @@ -396,7 +393,7 @@ class AccountController extends Controller // @codeCoverageIgnoreEnd } - if (1 === intval($request->get('create_another'))) { + if (1 === (int)$request->get('create_another')) { // set value so create routine will not overwrite URL: $request->session()->put('accounts.create.fromStore', true); @@ -412,17 +409,16 @@ class AccountController extends Controller * @param Account $account * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function update(AccountFormRequest $request, Account $account) { $data = $request->getAccountData(); $this->repository->update($account, $data); - $request->session()->flash('success', strval(trans('firefly.updated_account', ['name' => $account->name]))); + $request->session()->flash('success', (string)trans('firefly.updated_account', ['name' => $account->name])); Preferences::mark(); - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // set value so edit routine will not overwrite URL: $request->session()->put('accounts.edit.fromUpdate', true); @@ -467,7 +463,7 @@ class AccountController extends Controller $start = $this->repository->oldestJournalDate($account); $end = $date ?? new Carbon; if ($end < $start) { - list($start, $end) = [$end, $start]; // @codeCoverageIgnore + [$start, $end] = [$end, $start]; // @codeCoverageIgnore } // properties for cache diff --git a/app/Http/Controllers/Admin/ConfigurationController.php b/app/Http/Controllers/Admin/ConfigurationController.php index 8296d41c43..64c47a5be5 100644 --- a/app/Http/Controllers/Admin/ConfigurationController.php +++ b/app/Http/Controllers/Admin/ConfigurationController.php @@ -46,7 +46,7 @@ class ConfigurationController extends Controller $this->middleware( function ($request, $next) { - app('view')->share('title', strval(trans('firefly.administration'))); + app('view')->share('title', (string)trans('firefly.administration')); app('view')->share('mainTitleIcon', 'fa-hand-spock-o'); return $next($request); @@ -61,7 +61,7 @@ class ConfigurationController extends Controller */ public function index() { - $subTitle = strval(trans('firefly.instance_configuration')); + $subTitle = (string)trans('firefly.instance_configuration'); $subTitleIcon = 'fa-wrench'; // all available configuration and their default value in case @@ -91,7 +91,7 @@ class ConfigurationController extends Controller FireflyConfig::set('is_demo_site', $data['is_demo_site']); // flash message - Session::flash('success', strval(trans('firefly.configuration_updated'))); + Session::flash('success', (string)trans('firefly.configuration_updated')); Preferences::mark(); return Redirect::route('admin.configuration.index'); diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index fd4832b7fa..a13c54280b 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -50,7 +50,7 @@ class HomeController extends Controller */ public function index() { - $title = strval(trans('firefly.administration')); + $title = (string)trans('firefly.administration'); $mainTitleIcon = 'fa-hand-spock-o'; return view('admin.index', compact('title', 'mainTitleIcon')); @@ -66,7 +66,7 @@ class HomeController extends Controller $ipAddress = $request->ip(); Log::debug(sprintf('Now in testMessage() controller. IP is %s', $ipAddress)); event(new AdminRequestedTestMessage(auth()->user(), $ipAddress)); - Session::flash('info', strval(trans('firefly.send_test_triggered'))); + Session::flash('info', (string)trans('firefly.send_test_triggered')); return redirect(route('admin.index')); } diff --git a/app/Http/Controllers/Admin/LinkController.php b/app/Http/Controllers/Admin/LinkController.php index aa2078da42..be3be8fdb4 100644 --- a/app/Http/Controllers/Admin/LinkController.php +++ b/app/Http/Controllers/Admin/LinkController.php @@ -45,7 +45,7 @@ class LinkController extends Controller $this->middleware( function ($request, $next) { - app('view')->share('title', strval(trans('firefly.administration'))); + app('view')->share('title', (string)trans('firefly.administration')); app('view')->share('mainTitleIcon', 'fa-hand-spock-o'); return $next($request); @@ -76,12 +76,11 @@ class LinkController extends Controller * @param LinkType $linkType * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View - * @throws \RuntimeException */ public function delete(Request $request, LinkTypeRepositoryInterface $repository, LinkType $linkType) { if (!$linkType->editable) { - $request->session()->flash('error', strval(trans('firefly.cannot_edit_link_type', ['name' => $linkType->name]))); + $request->session()->flash('error', (string)trans('firefly.cannot_edit_link_type', ['name' => $linkType->name])); return redirect(route('admin.links.index')); } @@ -109,15 +108,14 @@ class LinkController extends Controller * @param LinkType $linkType * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function destroy(Request $request, LinkTypeRepositoryInterface $repository, LinkType $linkType) { $name = $linkType->name; - $moveTo = $repository->find(intval($request->get('move_link_type_before_delete'))); + $moveTo = $repository->find((int)$request->get('move_link_type_before_delete')); $repository->destroy($linkType, $moveTo); - $request->session()->flash('success', strval(trans('firefly.deleted_link_type', ['name' => $name]))); + $request->session()->flash('success', (string)trans('firefly.deleted_link_type', ['name' => $name])); Preferences::mark(); return redirect($this->getPreviousUri('link_types.delete.uri')); @@ -128,12 +126,11 @@ class LinkController extends Controller * @param LinkType $linkType * * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View - * @throws \RuntimeException */ public function edit(Request $request, LinkType $linkType) { if (!$linkType->editable) { - $request->session()->flash('error', strval(trans('firefly.cannot_edit_link_type', ['name' => $linkType->name]))); + $request->session()->flash('error', (string)trans('firefly.cannot_edit_link_type', ['name' => $linkType->name])); return redirect(route('admin.links.index')); } @@ -187,7 +184,6 @@ class LinkController extends Controller * @param LinkTypeRepositoryInterface $repository * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function store(LinkTypeFormRequest $request, LinkTypeRepositoryInterface $repository) { @@ -197,9 +193,9 @@ class LinkController extends Controller 'outward' => $request->string('outward'), ]; $linkType = $repository->store($data); - $request->session()->flash('success', strval(trans('firefly.stored_new_link_type', ['name' => $linkType->name]))); + $request->session()->flash('success', (string)trans('firefly.stored_new_link_type', ['name' => $linkType->name])); - if (1 === intval($request->get('create_another'))) { + if (1 === (int)$request->get('create_another')) { // set value so create routine will not overwrite URL: $request->session()->put('link_types.create.fromStore', true); @@ -216,12 +212,11 @@ class LinkController extends Controller * @param LinkType $linkType * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function update(LinkTypeFormRequest $request, LinkTypeRepositoryInterface $repository, LinkType $linkType) { if (!$linkType->editable) { - $request->session()->flash('error', strval(trans('firefly.cannot_edit_link_type', ['name' => $linkType->name]))); + $request->session()->flash('error', (string)trans('firefly.cannot_edit_link_type', ['name' => $linkType->name])); return redirect(route('admin.links.index')); } @@ -233,10 +228,10 @@ class LinkController extends Controller ]; $repository->update($linkType, $data); - $request->session()->flash('success', strval(trans('firefly.updated_link_type', ['name' => $linkType->name]))); + $request->session()->flash('success', (string)trans('firefly.updated_link_type', ['name' => $linkType->name])); Preferences::mark(); - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // set value so edit routine will not overwrite URL: $request->session()->put('link_types.edit.fromUpdate', true); diff --git a/app/Http/Controllers/Admin/UpdateController.php b/app/Http/Controllers/Admin/UpdateController.php index 423de9cb6b..44834b3597 100644 --- a/app/Http/Controllers/Admin/UpdateController.php +++ b/app/Http/Controllers/Admin/UpdateController.php @@ -49,7 +49,7 @@ class UpdateController extends Controller parent::__construct(); $this->middleware( function ($request, $next) { - app('view')->share('title', strval(trans('firefly.administration'))); + app('view')->share('title', (string)trans('firefly.administration')); app('view')->share('mainTitleIcon', 'fa-hand-spock-o'); return $next($request); @@ -87,10 +87,10 @@ class UpdateController extends Controller */ public function post(Request $request) { - $checkForUpdates = intval($request->get('check_for_updates')); + $checkForUpdates = (int)$request->get('check_for_updates'); FireflyConfig::set('permission_update_check', $checkForUpdates); FireflyConfig::set('last_update_check', time()); - Session::flash('success', strval(trans('firefly.configuration_updated'))); + Session::flash('success', (string)trans('firefly.configuration_updated')); return redirect(route('admin.update-check')); } @@ -118,7 +118,7 @@ class UpdateController extends Controller Log::error(sprintf('Could not check for updates: %s', $e->getMessage())); } if ($check === -2) { - $string = strval(trans('firefly.update_check_error')); + $string = (string)trans('firefly.update_check_error'); } if ($check === -1) { @@ -126,25 +126,23 @@ class UpdateController extends Controller // has it been released for more than three days? $today = new Carbon; if ($today->diffInDays($first->getUpdated(), true) > 3) { - $string = strval( - trans( - 'firefly.update_new_version_alert', - [ - 'your_version' => $current, - 'new_version' => $first->getTitle(), - 'date' => $first->getUpdated()->formatLocalized($this->monthAndDayFormat), - ] - ) + $string = (string)trans( + 'firefly.update_new_version_alert', + [ + 'your_version' => $current, + 'new_version' => $first->getTitle(), + 'date' => $first->getUpdated()->formatLocalized($this->monthAndDayFormat), + ] ); } } if ($check === 0) { // you are running the current version! - $string = strval(trans('firefly.update_current_version_alert', ['version' => $current])); + $string = (string)trans('firefly.update_current_version_alert', ['version' => $current]); } if ($check === 1) { // you are running a newer version! - $string = strval(trans('firefly.update_newer_version_alert', ['your_version' => $current, 'new_version' => $first->getTitle()])); + $string = (string)trans('firefly.update_newer_version_alert', ['your_version' => $current, 'new_version' => $first->getTitle()]); } return response()->json(['result' => $string]); diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index f4fa02a18b..a7f2e4e102 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -47,7 +47,7 @@ class UserController extends Controller $this->middleware( function ($request, $next) { - app('view')->share('title', strval(trans('firefly.administration'))); + app('view')->share('title', (string)trans('firefly.administration')); app('view')->share('mainTitleIcon', 'fa-hand-spock-o'); return $next($request); @@ -78,7 +78,7 @@ class UserController extends Controller public function destroy(User $user, UserRepositoryInterface $repository) { $repository->destroy($user); - Session::flash('success', strval(trans('firefly.user_deleted'))); + Session::flash('success', (string)trans('firefly.user_deleted')); return redirect(route('admin.users')); } @@ -96,13 +96,13 @@ class UserController extends Controller } Session::forget('users.edit.fromUpdate'); - $subTitle = strval(trans('firefly.edit_user', ['email' => $user->email])); + $subTitle = (string)trans('firefly.edit_user', ['email' => $user->email]); $subTitleIcon = 'fa-user-o'; $codes = [ - '' => strval(trans('firefly.no_block_code')), - 'bounced' => strval(trans('firefly.block_code_bounced')), - 'expired' => strval(trans('firefly.block_code_expired')), - 'email_changed' => strval(trans('firefly.block_code_email_changed')), + '' => (string)trans('firefly.no_block_code'), + 'bounced' => (string)trans('firefly.block_code_bounced'), + 'expired' => (string)trans('firefly.block_code_expired'), + 'email_changed' => (string)trans('firefly.block_code_email_changed'), ]; return view('admin.users.edit', compact('user', 'subTitle', 'subTitleIcon', 'codes')); @@ -115,7 +115,7 @@ class UserController extends Controller */ public function index(UserRepositoryInterface $repository) { - $subTitle = strval(trans('firefly.user_administration')); + $subTitle = (string)trans('firefly.user_administration'); $subTitleIcon = 'fa-users'; $users = $repository->all(); @@ -143,9 +143,9 @@ class UserController extends Controller */ public function show(UserRepositoryInterface $repository, User $user) { - $title = strval(trans('firefly.administration')); + $title = (string)trans('firefly.administration'); $mainTitleIcon = 'fa-hand-spock-o'; - $subTitle = strval(trans('firefly.single_user_administration', ['email' => $user->email])); + $subTitle = (string)trans('firefly.single_user_administration', ['email' => $user->email]); $subTitleIcon = 'fa-user'; $information = $repository->getUserData($user); @@ -182,10 +182,10 @@ class UserController extends Controller $repository->changeStatus($user, $data['blocked'], $data['blocked_code']); $repository->updateEmail($user, $data['email']); - Session::flash('success', strval(trans('firefly.updated_user', ['email' => $user->email]))); + Session::flash('success', (string)trans('firefly.updated_user', ['email' => $user->email])); Preferences::mark(); - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart Session::put('users.edit.fromUpdate', true); diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php index bce1cde2fe..df25aec1db 100644 --- a/app/Http/Controllers/AttachmentController.php +++ b/app/Http/Controllers/AttachmentController.php @@ -80,7 +80,6 @@ class AttachmentController extends Controller * @param Attachment $attachment * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function destroy(Request $request, Attachment $attachment) { @@ -88,7 +87,7 @@ class AttachmentController extends Controller $this->repository->destroy($attachment); - $request->session()->flash('success', strval(trans('firefly.attachment_deleted', ['name' => $name]))); + $request->session()->flash('success', (string)trans('firefly.attachment_deleted', ['name' => $name])); Preferences::mark(); return redirect($this->getPreviousUri('attachments.delete.uri')); @@ -130,7 +129,6 @@ class AttachmentController extends Controller * @param Attachment $attachment * * @return View - * @throws \RuntimeException */ public function edit(Request $request, Attachment $attachment) { @@ -154,17 +152,16 @@ class AttachmentController extends Controller * @param Attachment $attachment * * @return \Illuminate\Http\RedirectResponse - * @throws \RuntimeException */ public function update(AttachmentFormRequest $request, Attachment $attachment) { $data = $request->getAttachmentData(); $this->repository->update($attachment, $data); - $request->session()->flash('success', strval(trans('firefly.attachment_updated', ['name' => $attachment->filename]))); + $request->session()->flash('success', (string)trans('firefly.attachment_updated', ['name' => $attachment->filename])); Preferences::mark(); - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart $request->session()->put('attachments.edit.fromUpdate', true); diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 89bbf55b54..bd870e2b45 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -73,7 +73,7 @@ class ForgotPasswordController extends Controller // verify if the user is not a demo user. If so, we give him back an error. $user = User::where('email', $request->get('email'))->first(); - if (!is_null($user) && $repository->hasRole($user, 'demo')) { + if (null !== $user && $repository->hasRole($user, 'demo')) { return back()->withErrors(['email' => trans('firefly.cannot_reset_demo_user')]); } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 1c621d6866..8b76348ea1 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -65,7 +65,6 @@ class LoginController extends Controller * * @return \Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response * - * @throws \RuntimeException * @throws \Illuminate\Validation\ValidationException */ public function login(Request $request) @@ -103,7 +102,6 @@ class LoginController extends Controller * @param CookieJar $cookieJar * * @return $this|\Illuminate\Http\RedirectResponse - * @throws \RuntimeException */ public function logout(Request $request, CookieJar $cookieJar) { @@ -121,7 +119,6 @@ class LoginController extends Controller * @param Request $request * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View - * @throws \RuntimeException */ public function showLoginForm(Request $request) { diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index f2ebccb86e..7e78ef8f2d 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -83,7 +83,7 @@ class RegisterController extends Controller $this->guard()->login($user); - Session::flash('success', strval(trans('firefly.registered'))); + Session::flash('success', (string)trans('firefly.registered')); return $this->registered($request, $user) ?: redirect($this->redirectPath()); diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.php index b54e9fdf8a..2ce3ddf14b 100644 --- a/app/Http/Controllers/Auth/TwoFactorController.php +++ b/app/Http/Controllers/Auth/TwoFactorController.php @@ -40,7 +40,6 @@ class TwoFactorController extends Controller * * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View * - * @throws \RuntimeException * @throws FireflyException * * @SuppressWarnings(PHPMD.CyclomaticComplexity) @@ -52,7 +51,7 @@ class TwoFactorController extends Controller // to make sure the validator in the next step gets the secret, we push it in session $secretPreference = Preferences::get('twoFactorAuthSecret', null); $secret = null === $secretPreference ? null : $secretPreference->data; - $title = strval(trans('firefly.two_factor_title')); + $title = (string)trans('firefly.two_factor_title'); // make sure the user has two factor configured: $has2FA = Preferences::get('twoFactorAuthEnabled', false)->data; @@ -60,7 +59,7 @@ class TwoFactorController extends Controller return redirect(route('index')); } - if (0 === strlen(strval($secret))) { + if (0 === strlen((string)$secret)) { throw new FireflyException('Your two factor authentication secret is empty, which it cannot be at this point. Please check the log files.'); } $request->session()->flash('two-factor-secret', $secret); @@ -75,7 +74,7 @@ class TwoFactorController extends Controller { $user = auth()->user(); $siteOwner = env('SITE_OWNER', ''); - $title = strval(trans('firefly.two_factor_forgot_title')); + $title = (string)trans('firefly.two_factor_forgot_title'); Log::info( 'To reset the two factor authentication for user #' . $user->id . @@ -92,7 +91,6 @@ class TwoFactorController extends Controller * * @return mixed * @SuppressWarnings(PHPMD.UnusedFormalParameter) // it's unused but the class does some validation. - * @throws \RuntimeException */ public function postIndex(TokenFormRequest $request, CookieJar $cookieJar) { diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index e275a2f2b1..ee3e104bde 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -75,7 +75,6 @@ class BillController extends Controller * @param Request $request * * @return View - * @throws \RuntimeException */ public function create(Request $request) { @@ -114,14 +113,13 @@ class BillController extends Controller * @param Bill $bill * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function destroy(Request $request, BillRepositoryInterface $repository, Bill $bill) { $name = $bill->name; $repository->destroy($bill); - $request->session()->flash('success', strval(trans('firefly.deleted_bill', ['name' => $name]))); + $request->session()->flash('success', (string)trans('firefly.deleted_bill', ['name' => $name])); Preferences::mark(); return redirect($this->getPreviousUri('bills.delete.uri')); @@ -132,7 +130,6 @@ class BillController extends Controller * @param Bill $bill * * @return View - * @throws \RuntimeException */ public function edit(Request $request, Bill $bill) { @@ -177,7 +174,7 @@ class BillController extends Controller { $start = session('start'); $end = session('end'); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; $paginator = $repository->getPaginator($pageSize); $parameters = new ParameterBag(); $parameters->set('start', $start); @@ -201,12 +198,11 @@ class BillController extends Controller * @param Bill $bill * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function rescan(Request $request, BillRepositoryInterface $repository, Bill $bill) { - if (0 === intval($bill->active)) { - $request->session()->flash('warning', strval(trans('firefly.cannot_scan_inactive_bill'))); + if (0 === (int)$bill->active) { + $request->session()->flash('warning', (string)trans('firefly.cannot_scan_inactive_bill')); return redirect(URL::previous()); } @@ -217,7 +213,7 @@ class BillController extends Controller $repository->scan($bill, $journal); } - $request->session()->flash('success', strval(trans('firefly.rescanned_bill'))); + $request->session()->flash('success', (string)trans('firefly.rescanned_bill')); Preferences::mark(); return redirect(URL::previous()); @@ -236,8 +232,8 @@ class BillController extends Controller $start = session('start'); $end = session('end'); $year = $start->year; - $page = intval($request->get('page')); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $page = (int)$request->get('page'); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; $yearAverage = $repository->getYearAverage($bill, $start); $overallAverage = $repository->getOverallAverage($bill); $manager = new Manager(); @@ -268,13 +264,12 @@ class BillController extends Controller * @param BillRepositoryInterface $repository * * @return \Illuminate\Http\RedirectResponse - * @throws \RuntimeException */ public function store(BillFormRequest $request, BillRepositoryInterface $repository) { $billData = $request->getBillData(); $bill = $repository->store($billData); - $request->session()->flash('success', strval(trans('firefly.stored_new_bill', ['name' => $bill->name]))); + $request->session()->flash('success', (string)trans('firefly.stored_new_bill', ['name' => $bill->name])); Preferences::mark(); /** @var array $files */ @@ -286,7 +281,7 @@ class BillController extends Controller $request->session()->flash('info', $this->attachments->getMessages()->get('attachments')); // @codeCoverageIgnore } - if (1 === intval($request->get('create_another'))) { + if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart $request->session()->put('bills.create.fromStore', true); @@ -304,14 +299,13 @@ class BillController extends Controller * @param Bill $bill * * @return \Illuminate\Http\RedirectResponse - * @throws \RuntimeException */ public function update(BillFormRequest $request, BillRepositoryInterface $repository, Bill $bill) { $billData = $request->getBillData(); $bill = $repository->update($bill, $billData); - $request->session()->flash('success', strval(trans('firefly.updated_bill', ['name' => $bill->name]))); + $request->session()->flash('success', (string)trans('firefly.updated_bill', ['name' => $bill->name])); Preferences::mark(); /** @var array $files */ @@ -323,7 +317,7 @@ class BillController extends Controller $request->session()->flash('info', $this->attachments->getMessages()->get('attachments')); // @codeCoverageIgnore } - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart $request->session()->put('bills.edit.fromUpdate', true); diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index b4e35b81e2..ebe0ca12e3 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -78,11 +78,10 @@ class BudgetController extends Controller * @param Budget $budget * * @return \Illuminate\Http\JsonResponse - * @throws \InvalidArgumentException */ public function amount(Request $request, BudgetRepositoryInterface $repository, Budget $budget) { - $amount = strval($request->get('amount')); + $amount = (string)$request->get('amount'); $start = Carbon::createFromFormat('Y-m-d', $request->get('start')); $end = Carbon::createFromFormat('Y-m-d', $request->get('end')); $budgetLimit = $this->repository->updateLimitAmount($budget, $start, $end, $amount); @@ -106,18 +105,16 @@ class BudgetController extends Controller $diff = $start->diffInDays($end); $current = $amount; if ($diff > 0) { - $current = bcdiv($amount, strval($diff)); + $current = bcdiv($amount, (string)$diff); } if (bccomp(bcmul('1.1', $average), $current) === -1) { $largeDiff = true; - $warnText = strval( - trans( - 'firefly.over_budget_warn', - [ - 'amount' => app('amount')->formatAnything($currency, $average, false), - 'over_amount' => app('amount')->formatAnything($currency, $current, false), - ] - ) + $warnText = (string)trans( + 'firefly.over_budget_warn', + [ + 'amount' => app('amount')->formatAnything($currency, $average, false), + 'over_amount' => app('amount')->formatAnything($currency, $current, false), + ] ); } @@ -142,7 +139,6 @@ class BudgetController extends Controller * @param Request $request * * @return View - * @throws \RuntimeException */ public function create(Request $request) { @@ -176,13 +172,12 @@ class BudgetController extends Controller * @param Budget $budget * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function destroy(Request $request, Budget $budget) { $name = $budget->name; $this->repository->destroy($budget); - $request->session()->flash('success', strval(trans('firefly.deleted_budget', ['name' => $name]))); + $request->session()->flash('success', (string)trans('firefly.deleted_budget', ['name' => $name])); Preferences::mark(); return redirect($this->getPreviousUri('budgets.delete.uri')); @@ -193,7 +188,6 @@ class BudgetController extends Controller * @param Budget $budget * * @return View - * @throws \RuntimeException */ public function edit(Request $request, Budget $budget) { @@ -222,8 +216,8 @@ class BudgetController extends Controller $range = Preferences::get('viewRange', '1M')->data; $start = session('start', new Carbon); $end = session('end', new Carbon); - $page = 0 === intval($request->get('page')) ? 1 : intval($request->get('page')); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page'); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; // make date if present: if (null !== $moment || '' !== (string)$moment) { @@ -366,7 +360,7 @@ class BudgetController extends Controller if (0 === $count) { $count = 1; } - $result['available'] = bcdiv($total, strval($count)); + $result['available'] = bcdiv($total, (string)$count); // amount earned in this period: $subDay = clone $end; @@ -374,13 +368,13 @@ class BudgetController extends Controller /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); $collector->setAllAssetAccounts()->setRange($begin, $subDay)->setTypes([TransactionType::DEPOSIT])->withOpposingAccount(); - $result['earned'] = bcdiv(strval($collector->getJournals()->sum('transaction_amount')), strval($count)); + $result['earned'] = bcdiv((string)$collector->getJournals()->sum('transaction_amount'), (string)$count); // amount spent in period /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); $collector->setAllAssetAccounts()->setRange($begin, $subDay)->setTypes([TransactionType::WITHDRAWAL])->withOpposingAccount(); - $result['spent'] = bcdiv(strval($collector->getJournals()->sum('transaction_amount')), strval($count)); + $result['spent'] = bcdiv((string)$collector->getJournals()->sum('transaction_amount'), (string)$count); // suggestion starts with the amount spent $result['suggested'] = bcmul($result['spent'], '-1'); $result['suggested'] = 1 === bccomp($result['suggested'], $result['earned']) ? $result['earned'] : $result['suggested']; @@ -439,8 +433,8 @@ class BudgetController extends Controller ); } - $page = intval($request->get('page')); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $page = (int)$request->get('page'); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollectorInterface::class); @@ -456,7 +450,6 @@ class BudgetController extends Controller * @param BudgetIncomeRequest $request * * @return \Illuminate\Http\RedirectResponse - * @throws \InvalidArgumentException */ public function postUpdateIncome(BudgetIncomeRequest $request) { @@ -477,7 +470,6 @@ class BudgetController extends Controller * @param Budget $budget * * @return View - * @throws \InvalidArgumentException */ public function show(Request $request, Budget $budget) { @@ -508,7 +500,6 @@ class BudgetController extends Controller * * @return View * - * @throws \InvalidArgumentException * @throws FireflyException */ public function showByBudgetLimit(Request $request, Budget $budget, BudgetLimit $budgetLimit) @@ -517,8 +508,8 @@ class BudgetController extends Controller throw new FireflyException('This budget limit is not part of this budget.'); } - $page = intval($request->get('page')); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $page = (int)$request->get('page'); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; $subTitle = trans( 'firefly.budget_in_period', [ @@ -546,17 +537,16 @@ class BudgetController extends Controller * @param BudgetFormRequest $request * * @return \Illuminate\Http\RedirectResponse - * @throws \RuntimeException */ public function store(BudgetFormRequest $request) { $data = $request->getBudgetData(); $budget = $this->repository->store($data); $this->repository->cleanupBudgets(); - $request->session()->flash('success', strval(trans('firefly.stored_new_budget', ['name' => $budget->name]))); + $request->session()->flash('success', (string)trans('firefly.stored_new_budget', ['name' => $budget->name])); Preferences::mark(); - if (1 === intval($request->get('create_another'))) { + if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart $request->session()->put('budgets.create.fromStore', true); @@ -572,18 +562,17 @@ class BudgetController extends Controller * @param Budget $budget * * @return \Illuminate\Http\RedirectResponse - * @throws \RuntimeException */ public function update(BudgetFormRequest $request, Budget $budget) { $data = $request->getBudgetData(); $this->repository->update($budget, $data); - $request->session()->flash('success', strval(trans('firefly.updated_budget', ['name' => $budget->name]))); + $request->session()->flash('success', (string)trans('firefly.updated_budget', ['name' => $budget->name])); $this->repository->cleanupBudgets(); Preferences::mark(); - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart $request->session()->put('budgets.edit.fromUpdate', true); @@ -606,7 +595,7 @@ class BudgetController extends Controller $defaultCurrency = app('amount')->getDefaultCurrency(); $available = $this->repository->getAvailableBudget($defaultCurrency, $start, $end); $available = round($available, $defaultCurrency->decimal_places); - $page = intval($request->get('page')); + $page = (int)$request->get('page'); return view('budgets.income', compact('available', 'start', 'end', 'page')); } @@ -672,7 +661,7 @@ class BudgetController extends Controller [TransactionType::WITHDRAWAL] ); $set = $collector->getJournals(); - $sum = strval($set->sum('transaction_amount') ?? '0'); + $sum = (string)($set->sum('transaction_amount') ?? '0'); $journals = $set->count(); $dateStr = $date['end']->format('Y-m-d'); $dateName = app('navigation')->periodShow($date['end'], $date['period']); diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index bb1bbea092..0598240fd3 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -77,7 +77,6 @@ class CategoryController extends Controller * @param Request $request * * @return View - * @throws \RuntimeException */ public function create(Request $request) { @@ -110,14 +109,13 @@ class CategoryController extends Controller * @param Category $category * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function destroy(Request $request, Category $category) { $name = $category->name; $this->repository->destroy($category); - $request->session()->flash('success', strval(trans('firefly.deleted_category', ['name' => $name]))); + $request->session()->flash('success', (string)trans('firefly.deleted_category', ['name' => $name])); Preferences::mark(); return redirect($this->getPreviousUri('categories.delete.uri')); @@ -128,7 +126,6 @@ class CategoryController extends Controller * @param Category $category * * @return View - * @throws \RuntimeException */ public function edit(Request $request, Category $category) { @@ -150,8 +147,8 @@ class CategoryController extends Controller */ public function index(Request $request) { - $page = 0 === intval($request->get('page')) ? 1 : intval($request->get('page')); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page'); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; $collection = $this->repository->getCategories(); $total = $collection->count(); $collection = $collection->slice(($page - 1) * $pageSize, $pageSize); @@ -182,8 +179,8 @@ class CategoryController extends Controller $start = null; $end = null; $periods = new Collection; - $page = intval($request->get('page')); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $page = (int)$request->get('page'); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; // prep for "all" view. if ('all' === $moment) { @@ -239,8 +236,8 @@ class CategoryController extends Controller // default values: $subTitle = $category->name; $subTitleIcon = 'fa-bar-chart'; - $page = intval($request->get('page')); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $page = (int)$request->get('page'); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; $range = Preferences::get('viewRange', '1M')->data; $start = null; $end = null; @@ -252,7 +249,7 @@ class CategoryController extends Controller $subTitle = trans('firefly.all_journals_for_category', ['name' => $category->name]); $first = $repository->firstUseDate($category); /** @var Carbon $start */ - $start = null === $first ? new Carbon : $first; + $start = $first ?? new Carbon; $end = new Carbon; $path = route('categories.show', [$category->id, 'all']); } @@ -300,17 +297,16 @@ class CategoryController extends Controller * @param CategoryRepositoryInterface $repository * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function store(CategoryFormRequest $request, CategoryRepositoryInterface $repository) { $data = $request->getCategoryData(); $category = $repository->store($data); - $request->session()->flash('success', strval(trans('firefly.stored_category', ['name' => $category->name]))); + $request->session()->flash('success', (string)trans('firefly.stored_category', ['name' => $category->name])); Preferences::mark(); - if (1 === intval($request->get('create_another'))) { + if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart $request->session()->put('categories.create.fromStore', true); @@ -327,17 +323,16 @@ class CategoryController extends Controller * @param Category $category * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function update(CategoryFormRequest $request, CategoryRepositoryInterface $repository, Category $category) { $data = $request->getCategoryData(); $repository->update($category, $data); - $request->session()->flash('success', strval(trans('firefly.updated_category', ['name' => $category->name]))); + $request->session()->flash('success', (string)trans('firefly.updated_category', ['name' => $category->name])); Preferences::mark(); - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart $request->session()->put('categories.edit.fromUpdate', true); diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 6006316482..8e417dfe58 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -93,7 +93,7 @@ class AccountController extends Controller } arsort($chartData); - $data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData); + $data = $this->generator->singleSet((string)trans('firefly.spent'), $chartData); $cache->store($data); return response()->json($data); @@ -124,8 +124,8 @@ class AccountController extends Controller /** @var Transaction $transaction */ foreach ($transactions as $transaction) { - $jrnlBudgetId = intval($transaction->transaction_journal_budget_id); - $transBudgetId = intval($transaction->transaction_budget_id); + $jrnlBudgetId = (int)$transaction->transaction_journal_budget_id; + $transBudgetId = (int)$transaction->transaction_budget_id; $budgetId = max($jrnlBudgetId, $transBudgetId); $result[$budgetId] = $result[$budgetId] ?? '0'; $result[$budgetId] = bcadd($transaction->transaction_amount, $result[$budgetId]); @@ -181,8 +181,8 @@ class AccountController extends Controller $chartData = []; /** @var Transaction $transaction */ foreach ($transactions as $transaction) { - $jrnlCatId = intval($transaction->transaction_journal_category_id); - $transCatId = intval($transaction->transaction_category_id); + $jrnlCatId = (int)$transaction->transaction_journal_category_id; + $transCatId = (int)$transaction->transaction_category_id; $categoryId = max($jrnlCatId, $transCatId); $result[$categoryId] = $result[$categoryId] ?? '0'; $result[$categoryId] = bcadd($transaction->transaction_amount, $result[$categoryId]); @@ -264,8 +264,8 @@ class AccountController extends Controller $chartData = []; /** @var Transaction $transaction */ foreach ($transactions as $transaction) { - $jrnlCatId = intval($transaction->transaction_journal_category_id); - $transCatId = intval($transaction->transaction_category_id); + $jrnlCatId = (int)$transaction->transaction_journal_category_id; + $transCatId = (int)$transaction->transaction_category_id; $categoryId = max($jrnlCatId, $transCatId); $result[$categoryId] = $result[$categoryId] ?? '0'; $result[$categoryId] = bcadd($transaction->transaction_amount, $result[$categoryId]); @@ -336,7 +336,7 @@ class AccountController extends Controller $theDate = $current->format('Y-m-d'); $balance = $range[$theDate] ?? $previous; $label = $current->formatLocalized($format); - $chartData[$label] = floatval($balance); + $chartData[$label] = (float)$balance; $previous = $balance; $current->addDay(); } @@ -346,7 +346,7 @@ class AccountController extends Controller case '1M': case '1Y': while ($end >= $current) { - $balance = floatval(app('steam')->balance($account, $current)); + $balance = (float)app('steam')->balance($account, $current); $label = app('navigation')->periodShow($current, $step); $chartData[$label] = $balance; $current = app('navigation')->addPeriod($current, $step, 1); @@ -411,7 +411,7 @@ class AccountController extends Controller } arsort($chartData); - $data = $this->generator->singleSet(strval(trans('firefly.earned')), $chartData); + $data = $this->generator->singleSet((string)trans('firefly.earned'), $chartData); $cache->store($data); return response()->json($data); @@ -442,7 +442,7 @@ class AccountController extends Controller $chartData = []; foreach ($accounts as $account) { - $currency = $repository->findNull(intval($account->getMeta('currency_id'))); + $currency = $repository->findNull((int)$account->getMeta('currency_id')); $currentSet = [ 'label' => $account->name, 'currency_symbol' => $currency->symbol, @@ -453,7 +453,7 @@ class AccountController extends Controller $previous = array_values($range)[0]; while ($currentStart <= $end) { $format = $currentStart->format('Y-m-d'); - $label = $currentStart->formatLocalized(strval(trans('config.month_and_day'))); + $label = $currentStart->formatLocalized((string)trans('config.month_and_day')); $balance = isset($range[$format]) ? round($range[$format], 12) : $previous; $previous = $balance; $currentStart->addDay(); diff --git a/app/Http/Controllers/Chart/BillController.php b/app/Http/Controllers/Chart/BillController.php index d5794c45a9..b145249092 100644 --- a/app/Http/Controllers/Chart/BillController.php +++ b/app/Http/Controllers/Chart/BillController.php @@ -71,8 +71,8 @@ class BillController extends Controller $paid = $repository->getBillsPaidInRange($start, $end); // will be a negative amount. $unpaid = $repository->getBillsUnpaidInRange($start, $end); // will be a positive amount. $chartData = [ - strval(trans('firefly.unpaid')) => $unpaid, - strval(trans('firefly.paid')) => $paid, + (string)trans('firefly.unpaid') => $unpaid, + (string)trans('firefly.paid') => $paid, ]; $data = $this->generator->pieChart($chartData); @@ -110,7 +110,7 @@ class BillController extends Controller /** @var Transaction $entry */ foreach ($results as $entry) { - $date = $entry->date->formatLocalized(strval(trans('config.month_and_day'))); + $date = $entry->date->formatLocalized((string)trans('config.month_and_day')); $chartData[0]['entries'][$date] = $bill->amount_min; // minimum amount of bill $chartData[1]['entries'][$date] = $bill->amount_max; // maximum amount of bill $chartData[2]['entries'][$date] = bcmul($entry->transaction_amount, '-1'); // amount of journal diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index da87461707..379c4efa8a 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -112,12 +112,12 @@ class BudgetController extends Controller } $spent = $this->repository->spentInPeriod($budgetCollection, new Collection, $current, $currentEnd); $label = app('navigation')->periodShow($current, $step); - $chartData[$label] = floatval(bcmul($spent, '-1')); + $chartData[$label] = (float)bcmul($spent, '-1'); $current = clone $currentEnd; $current->addDay(); } - $data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData); + $data = $this->generator->singleSet((string)trans('firefly.spent'), $chartData); $cache->store($data); @@ -161,12 +161,12 @@ class BudgetController extends Controller while ($start <= $end) { $spent = $this->repository->spentInPeriod($budgetCollection, new Collection, $start, $start); $amount = bcadd($amount, $spent); - $format = $start->formatLocalized(strval(trans('config.month_and_day'))); + $format = $start->formatLocalized((string)trans('config.month_and_day')); $entries[$format] = $amount; $start->addDay(); } - $data = $this->generator->singleSet(strval(trans('firefly.left')), $entries); + $data = $this->generator->singleSet((string)trans('firefly.left'), $entries); $cache->store($data); return response()->json($data); @@ -200,7 +200,7 @@ class BudgetController extends Controller $chartData = []; /** @var Transaction $transaction */ foreach ($transactions as $transaction) { - $assetId = intval($transaction->account_id); + $assetId = (int)$transaction->account_id; $result[$assetId] = $result[$assetId] ?? '0'; $result[$assetId] = bcadd($transaction->transaction_amount, $result[$assetId]); } @@ -244,8 +244,8 @@ class BudgetController extends Controller $chartData = []; /** @var Transaction $transaction */ foreach ($transactions as $transaction) { - $jrnlCatId = intval($transaction->transaction_journal_category_id); - $transCatId = intval($transaction->transaction_category_id); + $jrnlCatId = (int)$transaction->transaction_journal_category_id; + $transCatId = (int)$transaction->transaction_category_id; $categoryId = max($jrnlCatId, $transCatId); $result[$categoryId] = $result[$categoryId] ?? '0'; $result[$categoryId] = bcadd($transaction->transaction_amount, $result[$categoryId]); @@ -290,7 +290,7 @@ class BudgetController extends Controller $chartData = []; /** @var Transaction $transaction */ foreach ($transactions as $transaction) { - $opposingId = intval($transaction->opposing_account_id); + $opposingId = (int)$transaction->opposing_account_id; $result[$opposingId] = $result[$opposingId] ?? '0'; $result[$opposingId] = bcadd($transaction->transaction_amount, $result[$opposingId]); } @@ -329,9 +329,9 @@ class BudgetController extends Controller } $budgets = $this->repository->getActiveBudgets(); $chartData = [ - ['label' => strval(trans('firefly.spent_in_budget')), 'entries' => [], 'type' => 'bar'], - ['label' => strval(trans('firefly.left_to_spend')), 'entries' => [], 'type' => 'bar'], - ['label' => strval(trans('firefly.overspent')), 'entries' => [], 'type' => 'bar'], + ['label' => (string)trans('firefly.spent_in_budget'), 'entries' => [], 'type' => 'bar'], + ['label' => (string)trans('firefly.left_to_spend'), 'entries' => [], 'type' => 'bar'], + ['label' => (string)trans('firefly.overspent'), 'entries' => [], 'type' => 'bar'], ]; /** @var Budget $budget */ @@ -348,7 +348,7 @@ class BudgetController extends Controller } // for no budget: $spent = $this->spentInPeriodWithout($start, $end); - $name = strval(trans('firefly.no_budget')); + $name = (string)trans('firefly.no_budget'); if (0 !== bccomp($spent, '0')) { $chartData[0]['entries'][$name] = bcmul($spent, '-1'); $chartData[1]['entries'][$name] = '0'; @@ -389,14 +389,14 @@ class BudgetController extends Controller // join them into one set of data: $chartData = [ - ['label' => strval(trans('firefly.spent')), 'type' => 'bar', 'entries' => []], - ['label' => strval(trans('firefly.budgeted')), 'type' => 'bar', 'entries' => []], + ['label' => (string)trans('firefly.spent'), 'type' => 'bar', 'entries' => []], + ['label' => (string)trans('firefly.budgeted'), 'type' => 'bar', 'entries' => []], ]; foreach (array_keys($periods) as $period) { $label = $periods[$period]; - $spent = isset($entries[$budget->id]['entries'][$period]) ? $entries[$budget->id]['entries'][$period] : '0'; - $limit = isset($budgeted[$period]) ? $budgeted[$period] : 0; + $spent = $entries[$budget->id]['entries'][$period] ?? '0'; + $limit = (int)($budgeted[$period] ?? 0); $chartData[0]['entries'][$label] = round(bcmul($spent, '-1'), 12); $chartData[1]['entries'][$label] = $limit; } @@ -433,10 +433,10 @@ class BudgetController extends Controller // join them: foreach (array_keys($periods) as $period) { $label = $periods[$period]; - $spent = isset($entries['entries'][$period]) ? $entries['entries'][$period] : '0'; + $spent = $entries['entries'][$period] ?? '0'; $chartData[$label] = bcmul($spent, '-1'); } - $data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData); + $data = $this->generator->singleSet((string)trans('firefly.spent'), $chartData); $cache->store($data); return response()->json($data); @@ -568,7 +568,7 @@ class BudgetController extends Controller private function spentInPeriodMulti(Budget $budget, Collection $limits): array { $return = []; - $format = strval(trans('config.month_and_day')); + $format = (string)trans('config.month_and_day'); $name = $budget->name; /** @var BudgetLimit $budgetLimit */ foreach ($limits as $budgetLimit) { diff --git a/app/Http/Controllers/Chart/BudgetReportController.php b/app/Http/Controllers/Chart/BudgetReportController.php index e7aaf052a4..e4285a2ef9 100644 --- a/app/Http/Controllers/Chart/BudgetReportController.php +++ b/app/Http/Controllers/Chart/BudgetReportController.php @@ -83,7 +83,7 @@ class BudgetReportController extends Controller $helper->setBudgets($budgets); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(1 === intval($others)); + $helper->setCollectOtherObjects(1 === (int)$others); $chartData = $helper->generate('expense', 'account'); $data = $this->generator->pieChart($chartData); @@ -107,7 +107,7 @@ class BudgetReportController extends Controller $helper->setBudgets($budgets); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(1 === intval($others)); + $helper->setCollectOtherObjects(1 === (int)$others); $chartData = $helper->generate('expense', 'budget'); $data = $this->generator->pieChart($chartData); @@ -141,20 +141,20 @@ class BudgetReportController extends Controller // prep chart data: foreach ($budgets as $budget) { $chartData[$budget->id] = [ - 'label' => strval(trans('firefly.spent_in_specific_budget', ['budget' => $budget->name])), + 'label' => (string)trans('firefly.spent_in_specific_budget', ['budget' => $budget->name]), 'type' => 'bar', 'yAxisID' => 'y-axis-0', 'entries' => [], ]; $chartData[$budget->id . '-sum'] = [ - 'label' => strval(trans('firefly.sum_of_expenses_in_budget', ['budget' => $budget->name])), + 'label' => (string)trans('firefly.sum_of_expenses_in_budget', ['budget' => $budget->name]), 'type' => 'line', 'fill' => false, 'yAxisID' => 'y-axis-1', 'entries' => [], ]; $chartData[$budget->id . '-left'] = [ - 'label' => strval(trans('firefly.left_in_budget_limit', ['budget' => $budget->name])), + 'label' => (string)trans('firefly.left_in_budget_limit', ['budget' => $budget->name]), 'type' => 'bar', 'fill' => false, 'yAxisID' => 'y-axis-0', @@ -182,7 +182,7 @@ class BudgetReportController extends Controller if (count($budgetLimits) > 0) { $budgetLimitId = $budgetLimits->first()->id; - $leftOfLimits[$budgetLimitId] = $leftOfLimits[$budgetLimitId] ?? strval($budgetLimits->sum('amount')); + $leftOfLimits[$budgetLimitId] = $leftOfLimits[$budgetLimitId] ?? (string)$budgetLimits->sum('amount'); $leftOfLimits[$budgetLimitId] = bcadd($leftOfLimits[$budgetLimitId], $currentExpenses); $chartData[$budget->id . '-left']['entries'][$label] = $leftOfLimits[$budgetLimitId]; } @@ -244,9 +244,7 @@ class BudgetReportController extends Controller $collector->addFilter(OpposingAccountFilter::class); $collector->addFilter(PositiveAmountFilter::class); - $transactions = $collector->getJournals(); - - return $transactions; + return $collector->getJournals(); } /** @@ -260,8 +258,8 @@ class BudgetReportController extends Controller $grouped = []; /** @var Transaction $transaction */ foreach ($set as $transaction) { - $jrnlBudId = intval($transaction->transaction_journal_budget_id); - $transBudId = intval($transaction->transaction_budget_id); + $jrnlBudId = (int)$transaction->transaction_journal_budget_id; + $transBudId = (int)$transaction->transaction_budget_id; $budgetId = max($jrnlBudId, $transBudId); $grouped[$budgetId] = $grouped[$budgetId] ?? '0'; $grouped[$budgetId] = bcadd($transaction->transaction_amount, $grouped[$budgetId]); diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index db05731ab0..130c482aea 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -81,17 +81,17 @@ class CategoryController extends Controller $accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $chartData = [ [ - 'label' => strval(trans('firefly.spent')), + 'label' => (string)trans('firefly.spent'), 'entries' => [], 'type' => 'bar', ], [ - 'label' => strval(trans('firefly.earned')), + 'label' => (string)trans('firefly.earned'), 'entries' => [], 'type' => 'bar', ], [ - 'label' => strval(trans('firefly.sum')), + 'label' => (string)trans('firefly.sum'), 'entries' => [], 'type' => 'line', 'fill' => false, @@ -145,12 +145,12 @@ class CategoryController extends Controller } } - $chartData[strval(trans('firefly.no_category'))] = bcmul($repository->spentInPeriodWithoutCategory(new Collection, $start, $end), '-1'); + $chartData[(string)trans('firefly.no_category')] = bcmul($repository->spentInPeriodWithoutCategory(new Collection, $start, $end), '-1'); // sort arsort($chartData); - $data = $this->generator->singleSet(strval(trans('firefly.spent')), $chartData); + $data = $this->generator->singleSet((string)trans('firefly.spent'), $chartData); $cache->store($data); return response()->json($data); @@ -181,17 +181,17 @@ class CategoryController extends Controller $periods = app('navigation')->listOfPeriods($start, $end); $chartData = [ [ - 'label' => strval(trans('firefly.spent')), + 'label' => (string)trans('firefly.spent'), 'entries' => [], 'type' => 'bar', ], [ - 'label' => strval(trans('firefly.earned')), + 'label' => (string)trans('firefly.earned'), 'entries' => [], 'type' => 'bar', ], [ - 'label' => strval(trans('firefly.sum')), + 'label' => (string)trans('firefly.sum'), 'entries' => [], 'type' => 'line', 'fill' => false, @@ -237,17 +237,17 @@ class CategoryController extends Controller $periods = app('navigation')->listOfPeriods($start, $end); $chartData = [ [ - 'label' => strval(trans('firefly.spent')), + 'label' => (string)trans('firefly.spent'), 'entries' => [], 'type' => 'bar', ], [ - 'label' => strval(trans('firefly.earned')), + 'label' => (string)trans('firefly.earned'), 'entries' => [], 'type' => 'bar', ], [ - 'label' => strval(trans('firefly.sum')), + 'label' => (string)trans('firefly.sum'), 'entries' => [], 'type' => 'line', 'fill' => false, @@ -313,17 +313,17 @@ class CategoryController extends Controller // chart data $chartData = [ [ - 'label' => strval(trans('firefly.spent')), + 'label' => (string)trans('firefly.spent'), 'entries' => [], 'type' => 'bar', ], [ - 'label' => strval(trans('firefly.earned')), + 'label' => (string)trans('firefly.earned'), 'entries' => [], 'type' => 'bar', ], [ - 'label' => strval(trans('firefly.sum')), + 'label' => (string)trans('firefly.sum'), 'entries' => [], 'type' => 'line', 'fill' => false, diff --git a/app/Http/Controllers/Chart/CategoryReportController.php b/app/Http/Controllers/Chart/CategoryReportController.php index d2405d2af5..a62db6c9c4 100644 --- a/app/Http/Controllers/Chart/CategoryReportController.php +++ b/app/Http/Controllers/Chart/CategoryReportController.php @@ -75,7 +75,7 @@ class CategoryReportController extends Controller { /** @var MetaPieChartInterface $helper */ $helper = app(MetaPieChartInterface::class); - $helper->setAccounts($accounts)->setCategories($categories)->setStart($start)->setEnd($end)->setCollectOtherObjects(1 === intval($others)); + $helper->setAccounts($accounts)->setCategories($categories)->setStart($start)->setEnd($end)->setCollectOtherObjects(1 === (int)$others); $chartData = $helper->generate('expense', 'account'); $data = $this->generator->pieChart($chartData); @@ -100,7 +100,7 @@ class CategoryReportController extends Controller $helper->setCategories($categories); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(1 === intval($others)); + $helper->setCollectOtherObjects(1 === (int)$others); $chartData = $helper->generate('income', 'account'); $data = $this->generator->pieChart($chartData); @@ -124,7 +124,7 @@ class CategoryReportController extends Controller $helper->setCategories($categories); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(1 === intval($others)); + $helper->setCollectOtherObjects(1 === (int)$others); $chartData = $helper->generate('expense', 'category'); $data = $this->generator->pieChart($chartData); @@ -148,7 +148,7 @@ class CategoryReportController extends Controller $helper->setCategories($categories); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(1 === intval($others)); + $helper->setCollectOtherObjects(1 === (int)$others); $chartData = $helper->generate('income', 'category'); $data = $this->generator->pieChart($chartData); @@ -183,27 +183,27 @@ class CategoryReportController extends Controller // prep chart data: foreach ($categories as $category) { $chartData[$category->id . '-in'] = [ - 'label' => $category->name . ' (' . strtolower(strval(trans('firefly.income'))) . ')', + 'label' => $category->name . ' (' . strtolower((string)trans('firefly.income')) . ')', 'type' => 'bar', 'yAxisID' => 'y-axis-0', 'entries' => [], ]; $chartData[$category->id . '-out'] = [ - 'label' => $category->name . ' (' . strtolower(strval(trans('firefly.expenses'))) . ')', + 'label' => $category->name . ' (' . strtolower((string)trans('firefly.expenses')) . ')', 'type' => 'bar', 'yAxisID' => 'y-axis-0', 'entries' => [], ]; // total in, total out: $chartData[$category->id . '-total-in'] = [ - 'label' => $category->name . ' (' . strtolower(strval(trans('firefly.sum_of_income'))) . ')', + 'label' => $category->name . ' (' . strtolower((string)trans('firefly.sum_of_income')) . ')', 'type' => 'line', 'fill' => false, 'yAxisID' => 'y-axis-1', 'entries' => [], ]; $chartData[$category->id . '-total-out'] = [ - 'label' => $category->name . ' (' . strtolower(strval(trans('firefly.sum_of_expenses'))) . ')', + 'label' => $category->name . ' (' . strtolower((string)trans('firefly.sum_of_expenses')) . ')', 'type' => 'line', 'fill' => false, 'yAxisID' => 'y-axis-1', @@ -279,9 +279,7 @@ class CategoryReportController extends Controller $collector->addFilter(OpposingAccountFilter::class); $collector->addFilter(PositiveAmountFilter::class); - $transactions = $collector->getJournals(); - - return $transactions; + return $collector->getJournals(); } /** @@ -302,9 +300,7 @@ class CategoryReportController extends Controller $collector->addFilter(OpposingAccountFilter::class); $collector->addFilter(NegativeAmountFilter::class); - $transactions = $collector->getJournals(); - - return $transactions; + return $collector->getJournals(); } /** @@ -318,8 +314,8 @@ class CategoryReportController extends Controller $grouped = []; /** @var Transaction $transaction */ foreach ($set as $transaction) { - $jrnlCatId = intval($transaction->transaction_journal_category_id); - $transCatId = intval($transaction->transaction_category_id); + $jrnlCatId = (int)$transaction->transaction_journal_category_id; + $transCatId = (int)$transaction->transaction_category_id; $categoryId = max($jrnlCatId, $transCatId); $grouped[$categoryId] = $grouped[$categoryId] ?? '0'; $grouped[$categoryId] = bcadd($transaction->transaction_amount, $grouped[$categoryId]); diff --git a/app/Http/Controllers/Chart/ExpenseReportController.php b/app/Http/Controllers/Chart/ExpenseReportController.php index 3772e5c5c0..031d5f113b 100644 --- a/app/Http/Controllers/Chart/ExpenseReportController.php +++ b/app/Http/Controllers/Chart/ExpenseReportController.php @@ -100,27 +100,27 @@ class ExpenseReportController extends Controller /** @var Account $exp */ $exp = $combi->first(); $chartData[$exp->id . '-in'] = [ - 'label' => $name . ' (' . strtolower(strval(trans('firefly.income'))) . ')', + 'label' => $name . ' (' . strtolower((string)trans('firefly.income')) . ')', 'type' => 'bar', 'yAxisID' => 'y-axis-0', 'entries' => [], ]; $chartData[$exp->id . '-out'] = [ - 'label' => $name . ' (' . strtolower(strval(trans('firefly.expenses'))) . ')', + 'label' => $name . ' (' . strtolower((string)trans('firefly.expenses')) . ')', 'type' => 'bar', 'yAxisID' => 'y-axis-0', 'entries' => [], ]; // total in, total out: $chartData[$exp->id . '-total-in'] = [ - 'label' => $name . ' (' . strtolower(strval(trans('firefly.sum_of_income'))) . ')', + 'label' => $name . ' (' . strtolower((string)trans('firefly.sum_of_income')) . ')', 'type' => 'line', 'fill' => false, 'yAxisID' => 'y-axis-1', 'entries' => [], ]; $chartData[$exp->id . '-total-out'] = [ - 'label' => $name . ' (' . strtolower(strval(trans('firefly.sum_of_expenses'))) . ')', + 'label' => $name . ' (' . strtolower((string)trans('firefly.sum_of_expenses')) . ')', 'type' => 'line', 'fill' => false, 'yAxisID' => 'y-axis-1', @@ -196,7 +196,7 @@ class ExpenseReportController extends Controller $collection->push($expenseAccount); $revenue = $this->accountRepository->findByName($expenseAccount->name, [AccountType::REVENUE]); - if (!is_null($revenue)) { + if (null !== $revenue) { $collection->push($revenue); } $combined[$expenseAccount->name] = $collection; @@ -219,9 +219,7 @@ class ExpenseReportController extends Controller $collector = app(JournalCollectorInterface::class); $collector->setAccounts($accounts)->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setOpposingAccounts($opposing); - $transactions = $collector->getJournals(); - - return $transactions; + return $collector->getJournals(); } /** @@ -239,9 +237,7 @@ class ExpenseReportController extends Controller $collector = app(JournalCollectorInterface::class); $collector->setAccounts($accounts)->setRange($start, $end)->setTypes([TransactionType::DEPOSIT])->setOpposingAccounts($opposing); - $transactions = $collector->getJournals(); - - return $transactions; + return $collector->getJournals(); } /** diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index 12beec2072..37beb074ce 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -71,7 +71,7 @@ class PiggyBankController extends Controller $sum = '0'; /** @var PiggyBankEvent $entry */ foreach ($set as $entry) { - $label = $entry->date->formatLocalized(strval(trans('config.month_and_day'))); + $label = $entry->date->formatLocalized((string)trans('config.month_and_day')); $sum = bcadd($sum, $entry->amount); $chartData[$label] = $sum; } diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 5120b807bf..30c5657d59 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -75,12 +75,12 @@ class ReportController extends Controller while ($current < $end) { $balances = Steam::balancesByAccounts($accounts, $current); $sum = $this->arraySum($balances); - $label = $current->formatLocalized(strval(trans('config.month_and_day'))); + $label = $current->formatLocalized((string)trans('config.month_and_day')); $chartData[$label] = $sum; $current->addDays(7); } - $data = $this->generator->singleSet(strval(trans('firefly.net_worth')), $chartData); + $data = $this->generator->singleSet((string)trans('firefly.net_worth'), $chartData); $cache->store($data); return response()->json($data); @@ -188,19 +188,19 @@ class ReportController extends Controller $chartData = [ [ - 'label' => strval(trans('firefly.income')), + 'label' => (string)trans('firefly.income'), 'type' => 'bar', 'entries' => [ - strval(trans('firefly.sum_of_period')) => $numbers['sum_earned'], - strval(trans('firefly.average_in_period')) => $numbers['avg_earned'], + (string)trans('firefly.sum_of_period') => $numbers['sum_earned'], + (string)trans('firefly.average_in_period') => $numbers['avg_earned'], ], ], [ 'label' => trans('firefly.expenses'), 'type' => 'bar', 'entries' => [ - strval(trans('firefly.sum_of_period')) => $numbers['sum_spent'], - strval(trans('firefly.average_in_period')) => $numbers['avg_spent'], + (string)trans('firefly.sum_of_period') => $numbers['sum_spent'], + (string)trans('firefly.average_in_period') => $numbers['avg_spent'], ], ], ]; @@ -255,25 +255,21 @@ class ReportController extends Controller while ($currentStart <= $end) { $currentEnd = app('navigation')->endOfPeriod($currentStart, '1M'); - $earned = strval( - array_sum( - array_map( - function ($item) { - return $item['sum']; - }, - $tasker->getIncomeReport($currentStart, $currentEnd, $accounts) - ) + $earned = (string)array_sum( + array_map( + function ($item) { + return $item['sum']; + }, + $tasker->getIncomeReport($currentStart, $currentEnd, $accounts) ) ); - $spent = strval( - array_sum( - array_map( - function ($item) { - return $item['sum']; - }, - $tasker->getExpenseReport($currentStart, $currentEnd, $accounts) - ) + $spent = (string)array_sum( + array_map( + function ($item) { + return $item['sum']; + }, + $tasker->getExpenseReport($currentStart, $currentEnd, $accounts) ) ); diff --git a/app/Http/Controllers/Chart/TagReportController.php b/app/Http/Controllers/Chart/TagReportController.php index 58a7d2c7eb..ceb4b52105 100644 --- a/app/Http/Controllers/Chart/TagReportController.php +++ b/app/Http/Controllers/Chart/TagReportController.php @@ -72,7 +72,7 @@ class TagReportController extends Controller $helper->setTags($tags); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(1 === intval($others)); + $helper->setCollectOtherObjects(1 === (int)$others); $chartData = $helper->generate('expense', 'account'); $data = $this->generator->pieChart($chartData); @@ -96,7 +96,7 @@ class TagReportController extends Controller $helper->setTags($tags); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(1 === intval($others)); + $helper->setCollectOtherObjects(1 === (int)$others); $chartData = $helper->generate('income', 'account'); $data = $this->generator->pieChart($chartData); @@ -177,27 +177,27 @@ class TagReportController extends Controller // prep chart data: foreach ($tags as $tag) { $chartData[$tag->id . '-in'] = [ - 'label' => $tag->tag . ' (' . strtolower(strval(trans('firefly.income'))) . ')', + 'label' => $tag->tag . ' (' . strtolower((string)trans('firefly.income')) . ')', 'type' => 'bar', 'yAxisID' => 'y-axis-0', 'entries' => [], ]; $chartData[$tag->id . '-out'] = [ - 'label' => $tag->tag . ' (' . strtolower(strval(trans('firefly.expenses'))) . ')', + 'label' => $tag->tag . ' (' . strtolower((string)trans('firefly.expenses')) . ')', 'type' => 'bar', 'yAxisID' => 'y-axis-0', 'entries' => [], ]; // total in, total out: $chartData[$tag->id . '-total-in'] = [ - 'label' => $tag->tag . ' (' . strtolower(strval(trans('firefly.sum_of_income'))) . ')', + 'label' => $tag->tag . ' (' . strtolower((string)trans('firefly.sum_of_income')) . ')', 'type' => 'line', 'fill' => false, 'yAxisID' => 'y-axis-1', 'entries' => [], ]; $chartData[$tag->id . '-total-out'] = [ - 'label' => $tag->tag . ' (' . strtolower(strval(trans('firefly.sum_of_expenses'))) . ')', + 'label' => $tag->tag . ' (' . strtolower((string)trans('firefly.sum_of_expenses')) . ')', 'type' => 'line', 'fill' => false, 'yAxisID' => 'y-axis-1', @@ -271,7 +271,7 @@ class TagReportController extends Controller $helper->setTags($tags); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(1 === intval($others)); + $helper->setCollectOtherObjects(1 === (int)$others); $chartData = $helper->generate('expense', 'tag'); $data = $this->generator->pieChart($chartData); @@ -295,7 +295,7 @@ class TagReportController extends Controller $helper->setTags($tags); $helper->setStart($start); $helper->setEnd($end); - $helper->setCollectOtherObjects(1 === intval($others)); + $helper->setCollectOtherObjects(1 === (int)$others); $chartData = $helper->generate('income', 'tag'); $data = $this->generator->pieChart($chartData); @@ -321,9 +321,7 @@ class TagReportController extends Controller $collector->addFilter(OpposingAccountFilter::class); $collector->addFilter(PositiveAmountFilter::class); - $transactions = $collector->getJournals(); - - return $transactions; + return $collector->getJournals(); } /** @@ -344,9 +342,7 @@ class TagReportController extends Controller $collector->addFilter(OpposingAccountFilter::class); $collector->addFilter(NegativeAmountFilter::class); - $transactions = $collector->getJournals(); - - return $transactions; + return $collector->getJournals(); } /** diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 02e8aa7793..851a8efff5 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -121,7 +121,7 @@ class Controller extends BaseController */ protected function getPreviousUri(string $identifier): string { - $uri = strval(session($identifier)); + $uri = (string)session($identifier); if (!(false === strpos($identifier, 'delete')) && !(false === strpos($uri, '/show/'))) { $uri = $this->redirectUri; } @@ -159,7 +159,7 @@ class Controller extends BaseController } } // @codeCoverageIgnoreStart - Session::flash('error', strval(trans('firefly.cannot_redirect_to_account'))); + Session::flash('error', (string)trans('firefly.cannot_redirect_to_account')); return redirect(route('index')); // @codeCoverageIgnoreEnd diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php index 1a2ce4c916..67d62ea22f 100644 --- a/app/Http/Controllers/CurrencyController.php +++ b/app/Http/Controllers/CurrencyController.php @@ -67,7 +67,6 @@ class CurrencyController extends Controller * @param Request $request * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View - * @throws \RuntimeException */ public function create(Request $request) { @@ -94,7 +93,6 @@ class CurrencyController extends Controller * @param TransactionCurrency $currency * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function defaultCurrency(Request $request, TransactionCurrency $currency) { @@ -113,7 +111,6 @@ class CurrencyController extends Controller * @param TransactionCurrency $currency * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View - * @throws \RuntimeException */ public function delete(Request $request, TransactionCurrency $currency) { @@ -143,7 +140,6 @@ class CurrencyController extends Controller * @param TransactionCurrency $currency * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function destroy(Request $request, TransactionCurrency $currency) { @@ -172,7 +168,6 @@ class CurrencyController extends Controller * @param TransactionCurrency $currency * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|View - * @throws \RuntimeException */ public function edit(Request $request, TransactionCurrency $currency) { @@ -201,12 +196,11 @@ class CurrencyController extends Controller * @param Request $request * * @return View - * @throws \RuntimeException */ public function index(Request $request) { - $page = 0 === intval($request->get('page')) ? 1 : intval($request->get('page')); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page'); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; $collection = $this->repository->get(); $total = $collection->count(); $collection = $collection->sortBy( @@ -232,7 +226,6 @@ class CurrencyController extends Controller * @param CurrencyFormRequest $request * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function store(CurrencyFormRequest $request) { @@ -248,7 +241,7 @@ class CurrencyController extends Controller $currency = $this->repository->store($data); $request->session()->flash('success', trans('firefly.created_currency', ['name' => $currency->name])); - if (1 === intval($request->get('create_another'))) { + if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart $request->session()->put('currencies.create.fromStore', true); @@ -264,7 +257,6 @@ class CurrencyController extends Controller * @param TransactionCurrency $currency * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function update(CurrencyFormRequest $request, TransactionCurrency $currency) { @@ -281,7 +273,7 @@ class CurrencyController extends Controller $request->session()->flash('success', trans('firefly.updated_currency', ['name' => $currency->name])); Preferences::mark(); - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart $request->session()->put('currencies.edit.fromUpdate', true); diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index 38bf6e7fea..4a56acf427 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -50,7 +50,6 @@ class DebugController extends Controller * @param Request $request * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View - * @throws \InvalidArgumentException */ public function index(Request $request) { @@ -69,7 +68,7 @@ class DebugController extends Controller $isDocker = var_export(env('IS_DOCKER', 'unknown'), true); $trustedProxies = env('TRUSTED_PROXIES', '(none)'); $displayErrors = ini_get('display_errors'); - $errorReporting = $this->errorReporting(intval(ini_get('error_reporting'))); + $errorReporting = $this->errorReporting((int)ini_get('error_reporting')); $appEnv = env('APP_ENV', ''); $appDebug = var_export(env('APP_DEBUG', false), true); $appLog = env('APP_LOG', ''); @@ -156,7 +155,7 @@ class DebugController extends Controller return $array[$value]; } - return strval($value); // @codeCoverageIgnore + return (string)$value; // @codeCoverageIgnore } /** diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php index 4cb9e5c422..3ff7d4f982 100644 --- a/app/Http/Controllers/ExportController.php +++ b/app/Http/Controllers/ExportController.php @@ -111,7 +111,6 @@ class ExportController extends Controller * @param ExportJobRepositoryInterface $jobs * * @return View - * @throws \InvalidArgumentException */ public function index(AccountRepositoryInterface $repository, ExportJobRepositoryInterface $jobs) { @@ -121,7 +120,7 @@ class ExportController extends Controller $jobs->cleanup(); // does the user have shared accounts? - $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $accountList = ExpandedForm::makeSelectList($accounts); $checked = array_keys($accountList); $formats = array_keys(config('firefly.export_formats')); diff --git a/app/Http/Controllers/HelpController.php b/app/Http/Controllers/HelpController.php index 1f7e13f4b9..eb13a6a623 100644 --- a/app/Http/Controllers/HelpController.php +++ b/app/Http/Controllers/HelpController.php @@ -72,7 +72,7 @@ class HelpController extends Controller private function getHelpText(string $route, string $language): string { // get language and default variables. - $content = '
' . strval(trans('firefly.route_has_no_help')) . '
'; + $content = '' . (string)trans('firefly.route_has_no_help') . '
'; // if no such route, log error and return default text. if (!$this->help->hasRoute($route)) { @@ -114,6 +114,6 @@ class HelpController extends Controller return $content; } - return '' . strval(trans('firefly.route_has_no_help')) . '
'; + return '' . (string)trans('firefly.route_has_no_help') . '
'; } } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index a32d290b40..f47bce951f 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -62,7 +62,6 @@ class HomeController extends Controller * @param Request $request * * @return \Illuminate\Http\JsonResponse - * @throws \RuntimeException */ public function dateRange(Request $request) { @@ -75,7 +74,7 @@ class HomeController extends Controller // check if the label is "everything" or "Custom range" which will betray // a possible problem with the budgets. - if ($label === strval(trans('firefly.everything')) || $label === strval(trans('firefly.customRange'))) { + if ($label === (string)trans('firefly.everything') || $label === (string)trans('firefly.customRange')) { $isCustomRange = true; Log::debug('Range is now marked as "custom".'); } @@ -83,7 +82,7 @@ class HomeController extends Controller $diff = $start->diffInDays($end); if ($diff > 50) { - $request->session()->flash('warning', strval(trans('firefly.warning_much_data', ['days' => $diff]))); + $request->session()->flash('warning', (string)trans('firefly.warning_much_data', ['days' => $diff])); } $request->session()->put('is_custom_range', $isCustomRange); @@ -117,7 +116,6 @@ class HomeController extends Controller * @param Request $request * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function flush(Request $request) { @@ -232,7 +230,6 @@ class HomeController extends Controller * @param Request $request * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function testFlash(Request $request) { diff --git a/app/Http/Controllers/Import/ConfigurationController.php b/app/Http/Controllers/Import/ConfigurationController.php index 3c3df4f9c5..8450c26aab 100644 --- a/app/Http/Controllers/Import/ConfigurationController.php +++ b/app/Http/Controllers/Import/ConfigurationController.php @@ -97,7 +97,6 @@ class ConfigurationController extends Controller * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector * - * @throws \RuntimeException * @throws FireflyException */ public function post(Request $request, ImportJob $job) diff --git a/app/Http/Controllers/Import/PrerequisitesController.php b/app/Http/Controllers/Import/PrerequisitesController.php index 81065bb670..76b4973321 100644 --- a/app/Http/Controllers/Import/PrerequisitesController.php +++ b/app/Http/Controllers/Import/PrerequisitesController.php @@ -69,7 +69,7 @@ class PrerequisitesController extends Controller if (true === !config(sprintf('import.enabled.%s', $bank))) { throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); // @codeCoverageIgnore } - $class = strval(config(sprintf('import.prerequisites.%s', $bank))); + $class = (string)config(sprintf('import.prerequisites.%s', $bank)); if (!class_exists($class)) { throw new FireflyException(sprintf('No class to handle "%s".', $bank)); // @codeCoverageIgnore } @@ -80,7 +80,7 @@ class PrerequisitesController extends Controller if ($object->hasPrerequisites()) { $view = $object->getView(); - $parameters = ['title' => strval(trans('firefly.import_index_title')), 'mainTitleIcon' => 'fa-archive']; + $parameters = ['title' => (string)trans('firefly.import_index_title'), 'mainTitleIcon' => 'fa-archive']; $parameters = array_merge($object->getViewParameters(), $parameters); return view($view, $parameters); @@ -103,7 +103,6 @@ class PrerequisitesController extends Controller * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector * - * @throws \RuntimeException * @throws FireflyException */ public function post(Request $request, string $bank) @@ -114,7 +113,7 @@ class PrerequisitesController extends Controller throw new FireflyException(sprintf('Cannot import from "%s" at this time.', $bank)); // @codeCoverageIgnore } - $class = strval(config(sprintf('import.prerequisites.%s', $bank))); + $class = (string)config(sprintf('import.prerequisites.%s', $bank)); if (!class_exists($class)) { throw new FireflyException(sprintf('Cannot find class %s', $class)); // @codeCoverageIgnore } diff --git a/app/Http/Controllers/Import/StatusController.php b/app/Http/Controllers/Import/StatusController.php index d476cd3578..6c33e3695a 100644 --- a/app/Http/Controllers/Import/StatusController.php +++ b/app/Http/Controllers/Import/StatusController.php @@ -97,7 +97,7 @@ class StatusController extends Controller } if ('finished' === $job->status) { $result['finished'] = true; - $tagId = intval($job->extended_status['tag']); + $tagId = (int)$job->extended_status['tag']; if ($tagId !== 0) { /** @var TagRepositoryInterface $repository */ $repository = app(TagRepositoryInterface::class); diff --git a/app/Http/Controllers/JavascriptController.php b/app/Http/Controllers/JavascriptController.php index 4fcdc4f734..d47992d9ed 100644 --- a/app/Http/Controllers/JavascriptController.php +++ b/app/Http/Controllers/JavascriptController.php @@ -54,7 +54,7 @@ class JavascriptController extends Controller /** @var Account $account */ foreach ($accounts as $account) { $accountId = $account->id; - $currency = intval($repository->getMetaValue($account, 'currency_id')); + $currency = (int)$repository->getMetaValue($account, 'currency_id'); $currency = 0 === $currency ? $default->id : $currency; $entry = ['preferredCurrency' => $currency, 'name' => $account->name]; $data['accounts'][$accountId] = $entry; @@ -92,14 +92,13 @@ class JavascriptController extends Controller * @param CurrencyRepositoryInterface $currencyRepository * * @return \Illuminate\Http\Response - * @throws \RuntimeException */ public function variables(Request $request, AccountRepositoryInterface $repository, CurrencyRepositoryInterface $currencyRepository) { - $account = $repository->findNull(intval($request->get('account'))); + $account = $repository->findNull((int)$request->get('account')); $currencyId = 0; if (null !== $account) { - $currencyId = intval($repository->getMetaValue($account, 'currency_id')); + $currencyId = (int)$repository->getMetaValue($account, 'currency_id'); } /** @var TransactionCurrency $currency */ $currency = $currencyRepository->findNull($currencyId); @@ -175,21 +174,21 @@ class JavascriptController extends Controller $todayStart = app('navigation')->startOfPeriod($today, $viewRange); $todayEnd = app('navigation')->endOfPeriod($todayStart, $viewRange); if ($todayStart->ne($start) || $todayEnd->ne($end)) { - $ranges[ucfirst(strval(trans('firefly.today')))] = [$todayStart, $todayEnd]; + $ranges[ucfirst((string)trans('firefly.today'))] = [$todayStart, $todayEnd]; } // everything - $index = strval(trans('firefly.everything')); + $index = (string)trans('firefly.everything'); $ranges[$index] = [$first, new Carbon]; $return = [ 'title' => $title, 'configuration' => [ - 'apply' => strval(trans('firefly.apply')), - 'cancel' => strval(trans('firefly.cancel')), - 'from' => strval(trans('firefly.from')), - 'to' => strval(trans('firefly.to')), - 'customRange' => strval(trans('firefly.customRange')), + 'apply' => (string)trans('firefly.apply'), + 'cancel' => (string)trans('firefly.cancel'), + 'from' => (string)trans('firefly.from'), + 'to' => (string)trans('firefly.to'), + 'customRange' => (string)trans('firefly.customRange'), 'start' => $start->format('Y-m-d'), 'end' => $end->format('Y-m-d'), 'ranges' => $ranges, diff --git a/app/Http/Controllers/Json/AutoCompleteController.php b/app/Http/Controllers/Json/AutoCompleteController.php index 2efcc72696..2a0b712545 100644 --- a/app/Http/Controllers/Json/AutoCompleteController.php +++ b/app/Http/Controllers/Json/AutoCompleteController.php @@ -113,7 +113,7 @@ class AutoCompleteController extends Controller $set = $collector->getJournals()->pluck('description', 'journal_id')->toArray(); $return = []; foreach ($set as $id => $description) { - $id = intval($id); + $id = (int)$id; if ($id !== $except->id) { $return[] = [ 'id' => $id, diff --git a/app/Http/Controllers/Json/BoxController.php b/app/Http/Controllers/Json/BoxController.php index dbd80ec03e..132ea0c829 100644 --- a/app/Http/Controllers/Json/BoxController.php +++ b/app/Http/Controllers/Json/BoxController.php @@ -123,7 +123,7 @@ class BoxController extends Controller $set = $collector->getJournals(); /** @var Transaction $transaction */ foreach ($set as $transaction) { - $currencyId = intval($transaction->transaction_currency_id); + $currencyId = (int)$transaction->transaction_currency_id; $incomes[$currencyId] = $incomes[$currencyId] ?? '0'; $incomes[$currencyId] = bcadd($incomes[$currencyId], $transaction->transaction_amount); $sums[$currencyId] = $sums[$currencyId] ?? '0'; diff --git a/app/Http/Controllers/Json/ExchangeController.php b/app/Http/Controllers/Json/ExchangeController.php index 7752fec71e..e4846f43f7 100644 --- a/app/Http/Controllers/Json/ExchangeController.php +++ b/app/Http/Controllers/Json/ExchangeController.php @@ -50,9 +50,6 @@ class ExchangeController extends Controller $rate = $repository->getExchangeRate($fromCurrency, $toCurrency, $date); - - - if (null === $rate->id) { Log::debug(sprintf('No cached exchange rate in database for %s to %s on %s', $fromCurrency->code, $toCurrency->code, $date->format('Y-m-d'))); @@ -69,7 +66,7 @@ class ExchangeController extends Controller $return['amount'] = null; if (null !== $request->get('amount')) { // assume amount is in "from" currency: - $return['amount'] = bcmul($request->get('amount'), strval($rate->rate), 12); + $return['amount'] = bcmul($request->get('amount'), (string)$rate->rate, 12); // round to toCurrency decimal places: $return['amount'] = round($return['amount'], $toCurrency->decimal_places); } diff --git a/app/Http/Controllers/Json/FrontpageController.php b/app/Http/Controllers/Json/FrontpageController.php index 0fef3453eb..0051608c91 100644 --- a/app/Http/Controllers/Json/FrontpageController.php +++ b/app/Http/Controllers/Json/FrontpageController.php @@ -36,7 +36,7 @@ class FrontpageController extends Controller * * @return \Illuminate\Http\JsonResponse * - * @throws \Throwable + */ public function piggyBanks(PiggyBankRepositoryInterface $repository) { diff --git a/app/Http/Controllers/Json/IntroController.php b/app/Http/Controllers/Json/IntroController.php index 2a8d2b5bf9..6b1c6c1be1 100644 --- a/app/Http/Controllers/Json/IntroController.php +++ b/app/Http/Controllers/Json/IntroController.php @@ -76,14 +76,17 @@ class IntroController $routeKey = str_replace('.', '_', $route); Log::debug(sprintf('Has outro step for route %s', $routeKey)); $elements = config(sprintf('intro.%s', $routeKey)); - if (!is_array($elements)) { + if (!\is_array($elements)) { return false; } + + $hasStep = array_key_exists('outro', $elements); + Log::debug('Elements is array', $elements); Log::debug('Keys is', array_keys($elements)); - Log::debug(sprintf('Keys has "outro": %s', var_export(in_array('outro', array_keys($elements)), true))); + Log::debug(sprintf('Keys has "outro": %s', var_export($hasStep, true))); - return in_array('outro', array_keys($elements)); + return $hasStep; } /** diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php index 33c5ce17ac..199d342d48 100644 --- a/app/Http/Controllers/JsonController.php +++ b/app/Http/Controllers/JsonController.php @@ -33,24 +33,16 @@ use Illuminate\Http\Request; */ class JsonController extends Controller { - /** - * JsonController constructor. - */ - public function __construct() - { - parent::__construct(); - } - /** * @param Request $request * * @return \Illuminate\Http\JsonResponse * - * @throws \Throwable + */ public function action(Request $request) { - $count = intval($request->get('count')) > 0 ? intval($request->get('count')) : 1; + $count = (int)$request->get('count') > 0 ? (int)$request->get('count') : 1; $keys = array_keys(config('firefly.rule-actions')); $actions = []; foreach ($keys as $key) { @@ -122,11 +114,11 @@ class JsonController extends Controller * * @return \Illuminate\Http\JsonResponse * - * @throws \Throwable + */ public function trigger(Request $request) { - $count = intval($request->get('count')) > 0 ? intval($request->get('count')) : 1; + $count = (int)$request->get('count') > 0 ? (int)$request->get('count') : 1; $keys = array_keys(config('firefly.rule-triggers')); $triggers = []; foreach ($keys as $key) { diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index 341c3b7852..2be34e546d 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -85,7 +85,7 @@ class NewUserController extends Controller $this->createSavingsAccount($request, $repository); // also store currency preference from input: - $currency = $currencyRepository->findNull(intval($request->input('amount_currency_id_bank_balance'))); + $currency = $currencyRepository->findNull((int)$request->input('amount_currency_id_bank_balance')); if (null !== $currency) { // store currency preference: @@ -107,7 +107,7 @@ class NewUserController extends Controller ]; Preferences::set('transaction_journal_optional_fields', $visibleFields); - Session::flash('success', strval(trans('firefly.stored_new_accounts_new_user'))); + Session::flash('success', (string)trans('firefly.stored_new_accounts_new_user')); Preferences::mark(); return redirect(route('index')); @@ -131,7 +131,7 @@ class NewUserController extends Controller 'accountRole' => 'defaultAsset', 'openingBalance' => $request->input('bank_balance'), 'openingBalanceDate' => new Carbon, - 'currency_id' => intval($request->input('amount_currency_id_bank_balance')), + 'currency_id' => (int)$request->input('amount_currency_id_bank_balance'), ]; $repository->store($assetAccount); @@ -157,7 +157,7 @@ class NewUserController extends Controller 'accountRole' => 'savingAsset', 'openingBalance' => $request->input('savings_balance'), 'openingBalanceDate' => new Carbon, - 'currency_id' => intval($request->input('amount_currency_id_bank_balance')), + 'currency_id' => (int)$request->input('amount_currency_id_bank_balance'), ]; $repository->store($savingsAccount); diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index d81ed60593..f4e587cd33 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -83,6 +83,7 @@ class PiggyBankController extends Controller * @param PiggyBank $piggyBank * * @param PiggyBankRepositoryInterface $repository + * * @return View */ public function addMobile(PiggyBank $piggyBank, PiggyBankRepositoryInterface $repository) @@ -137,7 +138,7 @@ class PiggyBankController extends Controller */ public function destroy(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank) { - Session::flash('success', strval(trans('firefly.deleted_piggy_bank', ['name' => $piggyBank->name]))); + Session::flash('success', (string)trans('firefly.deleted_piggy_bank', ['name' => $piggyBank->name])); Preferences::mark(); $repository->destroy($piggyBank); @@ -192,8 +193,8 @@ class PiggyBankController extends Controller { $collection = $piggyRepository->getPiggyBanks(); $total = $collection->count(); - $page = 0 === intval($request->get('page')) ? 1 : intval($request->get('page')); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page'); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; /** @var Carbon $end */ $end = session('end', Carbon::now()->endOfMonth()); @@ -203,8 +204,8 @@ class PiggyBankController extends Controller foreach ($collection as $piggyBank) { $piggyBank->savedSoFar = $piggyRepository->getCurrentAmount($piggyBank); - $piggyBank->percentage = 0 !== bccomp('0', $piggyBank->savedSoFar) ? intval($piggyBank->savedSoFar / $piggyBank->targetamount * 100) : 0; - $piggyBank->leftToSave = bcsub($piggyBank->targetamount, strval($piggyBank->savedSoFar)); + $piggyBank->percentage = 0 !== bccomp('0', $piggyBank->savedSoFar) ? (int)$piggyBank->savedSoFar / $piggyBank->targetamount * 100 : 0; + $piggyBank->leftToSave = bcsub($piggyBank->targetamount, (string)$piggyBank->savedSoFar); $piggyBank->percentage = $piggyBank->percentage > 100 ? 100 : $piggyBank->percentage; // Fill account information: @@ -216,13 +217,13 @@ class PiggyBankController extends Controller 'name' => $account->name, 'balance' => Steam::balanceIgnoreVirtual($account, $end), 'leftForPiggyBanks' => $piggyBank->leftOnAccount($end), - 'sumOfSaved' => strval($piggyBank->savedSoFar), + 'sumOfSaved' => (string)$piggyBank->savedSoFar, 'sumOfTargets' => $piggyBank->targetamount, 'leftToSave' => $piggyBank->leftToSave, ]; } if (isset($accounts[$account->id]) && false === $new) { - $accounts[$account->id]['sumOfSaved'] = bcadd($accounts[$account->id]['sumOfSaved'], strval($piggyBank->savedSoFar)); + $accounts[$account->id]['sumOfSaved'] = bcadd($accounts[$account->id]['sumOfSaved'], (string)$piggyBank->savedSoFar); $accounts[$account->id]['sumOfTargets'] = bcadd($accounts[$account->id]['sumOfTargets'], $piggyBank->targetamount); $accounts[$account->id]['leftToSave'] = bcadd($accounts[$account->id]['leftToSave'], $piggyBank->leftToSave); } @@ -251,7 +252,7 @@ class PiggyBankController extends Controller if (is_array($data)) { foreach ($data as $order => $id) { - $repository->setOrder(intval($id), $order + 1); + $repository->setOrder((int)$id, $order + 1); } } @@ -273,11 +274,9 @@ class PiggyBankController extends Controller $repository->addAmount($piggyBank, $amount); Session::flash( 'success', - strval( - trans( - 'firefly.added_amount_to_piggy', - ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] - ) + (string)trans( + 'firefly.added_amount_to_piggy', + ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] ) ); Preferences::mark(); @@ -288,11 +287,9 @@ class PiggyBankController extends Controller Log::error('Cannot add ' . $amount . ' because canAddAmount returned false.'); Session::flash( 'error', - strval( - trans( - 'firefly.cannot_add_amount_piggy', - ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] - ) + (string)trans( + 'firefly.cannot_add_amount_piggy', + ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] ) ); @@ -314,11 +311,9 @@ class PiggyBankController extends Controller $repository->removeAmount($piggyBank, $amount); Session::flash( 'success', - strval( - trans( - 'firefly.removed_amount_from_piggy', - ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] - ) + (string)trans( + 'firefly.removed_amount_from_piggy', + ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] ) ); Preferences::mark(); @@ -326,15 +321,13 @@ class PiggyBankController extends Controller return redirect(route('piggy-banks.index')); } - $amount = strval(round($request->get('amount'), 12)); + $amount = (string)round($request->get('amount'), 12); Session::flash( 'error', - strval( - trans( - 'firefly.cannot_remove_from_piggy', - ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] - ) + (string)trans( + 'firefly.cannot_remove_from_piggy', + ['amount' => app('amount')->formatAnything($currency, $amount, false), 'name' => $piggyBank->name] ) ); @@ -392,10 +385,10 @@ class PiggyBankController extends Controller } $piggyBank = $repository->store($data); - Session::flash('success', strval(trans('firefly.stored_piggy_bank', ['name' => $piggyBank->name]))); + Session::flash('success', (string)trans('firefly.stored_piggy_bank', ['name' => $piggyBank->name])); Preferences::mark(); - if (1 === intval($request->get('create_another'))) { + if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart Session::put('piggy-banks.create.fromStore', true); @@ -418,10 +411,10 @@ class PiggyBankController extends Controller $data = $request->getPiggyBankData(); $piggyBank = $repository->update($piggyBank, $data); - Session::flash('success', strval(trans('firefly.updated_piggy_bank', ['name' => $piggyBank->name]))); + Session::flash('success', (string)trans('firefly.updated_piggy_bank', ['name' => $piggyBank->name])); Preferences::mark(); - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart Session::put('piggy-banks.edit.fromUpdate', true); diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.php index 456be43bec..b20a9b15a0 100644 --- a/app/Http/Controllers/Popup/ReportController.php +++ b/app/Http/Controllers/Popup/ReportController.php @@ -81,11 +81,6 @@ class ReportController extends Controller * @return \Illuminate\Http\JsonResponse * * @throws FireflyException - * @throws \Throwable - * @throws \Throwable - * @throws \Throwable - * @throws \Throwable - * @throws \Throwable */ public function general(Request $request) { @@ -124,13 +119,12 @@ class ReportController extends Controller * @return string * * @throws FireflyException - * @throws \Throwable */ private function balanceAmount(array $attributes): string { - $role = intval($attributes['role']); - $budget = $this->budgetRepository->findNull(intval($attributes['budgetId'])); - $account = $this->accountRepository->findNull(intval($attributes['accountId'])); + $role = (int)$attributes['role']; + $budget = $this->budgetRepository->findNull((int)$attributes['budgetId']); + $account = $this->accountRepository->findNull((int)$attributes['accountId']); switch (true) { case BalanceLine::ROLE_DEFAULTROLE === $role && null !== $budget->id: @@ -140,11 +134,11 @@ class ReportController extends Controller case BalanceLine::ROLE_DEFAULTROLE === $role && null === $budget->id: // normal row without a budget: $journals = $this->popupHelper->balanceForNoBudget($account, $attributes); - $budget->name = strval(trans('firefly.no_budget')); + $budget->name = (string)trans('firefly.no_budget'); break; case BalanceLine::ROLE_DIFFROLE === $role: $journals = $this->popupHelper->balanceDifference($account, $attributes); - $budget->name = strval(trans('firefly.leftUnbalanced')); + $budget->name = (string)trans('firefly.leftUnbalanced'); break; case BalanceLine::ROLE_TAGROLE === $role: // row with tag info. @@ -162,11 +156,11 @@ class ReportController extends Controller * * @return string * - * @throws \Throwable + */ private function budgetSpentAmount(array $attributes): string { - $budget = $this->budgetRepository->findNull(intval($attributes['budgetId'])); + $budget = $this->budgetRepository->findNull((int)$attributes['budgetId']); $journals = $this->popupHelper->byBudget($budget, $attributes); $view = view('popup.report.budget-spent-amount', compact('journals', 'budget'))->render(); @@ -180,11 +174,11 @@ class ReportController extends Controller * * @return string * - * @throws \Throwable + */ private function categoryEntry(array $attributes): string { - $category = $this->categoryRepository->findNull(intval($attributes['categoryId'])); + $category = $this->categoryRepository->findNull((int)$attributes['categoryId']); $journals = $this->popupHelper->byCategory($category, $attributes); $view = view('popup.report.category-entry', compact('journals', 'category'))->render(); @@ -198,11 +192,11 @@ class ReportController extends Controller * * @return string * - * @throws \Throwable + */ private function expenseEntry(array $attributes): string { - $account = $this->accountRepository->findNull(intval($attributes['accountId'])); + $account = $this->accountRepository->findNull((int)$attributes['accountId']); $journals = $this->popupHelper->byExpenses($account, $attributes); $view = view('popup.report.expense-entry', compact('journals', 'account'))->render(); @@ -216,11 +210,11 @@ class ReportController extends Controller * * @return string * - * @throws \Throwable + */ private function incomeEntry(array $attributes): string { - $account = $this->accountRepository->findNull(intval($attributes['accountId'])); + $account = $this->accountRepository->findNull((int)$attributes['accountId']); $journals = $this->popupHelper->byIncome($account, $attributes); $view = view('popup.report.income-entry', compact('journals', 'account'))->render(); diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index b4e5d68855..6b3082ba38 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -97,7 +97,7 @@ class PreferencesController extends Controller $frontPageAccounts = []; if (is_array($request->get('frontPageAccounts'))) { foreach ($request->get('frontPageAccounts') as $id) { - $frontPageAccounts[] = intval($id); + $frontPageAccounts[] = (int)$id; } Preferences::set('frontPageAccounts', $frontPageAccounts); } @@ -110,21 +110,21 @@ class PreferencesController extends Controller Session::forget('range'); // custom fiscal year - $customFiscalYear = 1 === intval($request->get('customFiscalYear')); - $fiscalYearStart = date('m-d', strtotime(strval($request->get('fiscalYearStart')))); + $customFiscalYear = 1 === (int)$request->get('customFiscalYear'); + $fiscalYearStart = date('m-d', strtotime((string)$request->get('fiscalYearStart'))); Preferences::set('customFiscalYear', $customFiscalYear); Preferences::set('fiscalYearStart', $fiscalYearStart); // save page size: Preferences::set('listPageSize', 50); - $listPageSize = intval($request->get('listPageSize')); + $listPageSize = (int)$request->get('listPageSize'); if ($listPageSize > 0 && $listPageSize < 1337) { Preferences::set('listPageSize', $listPageSize); } // language: $lang = $request->get('language'); - if (in_array($lang, array_keys(config('firefly.languages')))) { + if (array_key_exists($lang, config('firefly.languages'))) { Preferences::set('language', $lang); } @@ -143,7 +143,7 @@ class PreferencesController extends Controller ]; Preferences::set('transaction_journal_optional_fields', $optionalTj); - Session::flash('success', strval(trans('firefly.saved_preferences'))); + Session::flash('success', (string)trans('firefly.saved_preferences')); Preferences::mark(); return redirect(route('preferences.index')); diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index a039ec2212..1270707146 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Http\Controllers; use Auth; +use DB; use FireflyIII\Events\UserChangedEmail; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\ValidationException; @@ -38,7 +39,10 @@ use FireflyIII\User; use Google2FA; use Hash; use Illuminate\Contracts\Auth\Guard; +use Laravel\Passport\ClientRepository; +use Laravel\Passport\Passport; use Log; +use phpseclib\Crypt\RSA; use Preferences; use Session; use View; @@ -76,7 +80,7 @@ class ProfileController extends Controller { $title = auth()->user()->email; $email = auth()->user()->email; - $subTitle = strval(trans('firefly.change_your_email')); + $subTitle = (string)trans('firefly.change_your_email'); $subTitleIcon = 'fa-envelope'; return view('profile.change-email', compact('title', 'subTitle', 'subTitleIcon', 'email')); @@ -88,7 +92,7 @@ class ProfileController extends Controller public function changePassword() { $title = auth()->user()->email; - $subTitle = strval(trans('firefly.change_your_password')); + $subTitle = (string)trans('firefly.change_your_password'); $subTitleIcon = 'fa-key'; return view('profile.change-password', compact('title', 'subTitle', 'subTitleIcon')); @@ -139,7 +143,7 @@ class ProfileController extends Controller $repository->unblockUser($user); // return to login. - Session::flash('success', strval(trans('firefly.login_with_new_email'))); + Session::flash('success', (string)trans('firefly.login_with_new_email')); return redirect(route('login')); } @@ -150,7 +154,7 @@ class ProfileController extends Controller public function deleteAccount() { $title = auth()->user()->email; - $subTitle = strval(trans('firefly.delete_account')); + $subTitle = (string)trans('firefly.delete_account'); $subTitleIcon = 'fa-trash'; return view('profile.delete-account', compact('title', 'subTitle', 'subTitleIcon')); @@ -163,8 +167,8 @@ class ProfileController extends Controller { Preferences::delete('twoFactorAuthEnabled'); Preferences::delete('twoFactorAuthSecret'); - Session::flash('success', strval(trans('firefly.pref_two_factor_auth_disabled'))); - Session::flash('info', strval(trans('firefly.pref_two_factor_auth_remove_it'))); + Session::flash('success', (string)trans('firefly.pref_two_factor_auth_disabled')); + Session::flash('info', (string)trans('firefly.pref_two_factor_auth_remove_it')); return redirect(route('profile.index')); } @@ -199,9 +203,21 @@ class ProfileController extends Controller */ public function index() { + // check if client token thing exists (default one) + $count = DB::table('oauth_clients') + ->where('personal_access_client', 1) + ->whereNull('user_id')->count(); + + $this->createOAuthKeys(); + + if ($count === 0) { + /** @var ClientRepository $repository */ + $repository = app(ClientRepository::class); + $repository->createPersonalAccessClient(null, config('app.name') . ' Personal Access Client', 'http://localhost'); + } $subTitle = auth()->user()->email; $userId = auth()->user()->id; - $enabled2FA = intval(Preferences::get('twoFactorAuthEnabled', 0)->data) === 1; + $enabled2FA = (int)Preferences::get('twoFactorAuthEnabled', 0)->data === 1; // get access token or create one. $accessToken = Preferences::get('access_token', null); @@ -218,7 +234,6 @@ class ProfileController extends Controller * @param UserRepositoryInterface $repository * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector - * @throws \RuntimeException */ public function postChangeEmail(EmailFormRequest $request, UserRepositoryInterface $repository) { @@ -227,7 +242,7 @@ class ProfileController extends Controller $newEmail = $request->string('email'); $oldEmail = $user->email; if ($newEmail === $user->email) { - Session::flash('error', strval(trans('firefly.email_not_changed'))); + Session::flash('error', (string)trans('firefly.email_not_changed')); return redirect(route('profile.change-email'))->withInput(); } @@ -237,7 +252,7 @@ class ProfileController extends Controller Auth::guard()->logout(); $request->session()->invalidate(); - Session::flash('success', strval(trans('firefly.email_changed'))); + Session::flash('success', (string)trans('firefly.email_changed')); return redirect(route('index')); } @@ -252,7 +267,7 @@ class ProfileController extends Controller // force user logout. Auth::guard()->logout(); $request->session()->invalidate(); - Session::flash('success', strval(trans('firefly.email_changed'))); + Session::flash('success', (string)trans('firefly.email_changed')); return redirect(route('index')); } @@ -278,7 +293,7 @@ class ProfileController extends Controller } $repository->changePassword(auth()->user(), $request->get('new_password')); - Session::flash('success', strval(trans('firefly.password_changed'))); + Session::flash('success', (string)trans('firefly.password_changed')); return redirect(route('profile.index')); } @@ -294,7 +309,7 @@ class ProfileController extends Controller Preferences::set('twoFactorAuthEnabled', 1); Preferences::set('twoFactorAuthSecret', Session::get('two-factor-secret')); - Session::flash('success', strval(trans('firefly.saved_preferences'))); + Session::flash('success', (string)trans('firefly.saved_preferences')); Preferences::mark(); return redirect(route('profile.index')); @@ -309,7 +324,7 @@ class ProfileController extends Controller public function postDeleteAccount(UserRepositoryInterface $repository, DeleteAccountFormRequest $request) { if (!Hash::check($request->get('password'), auth()->user()->password)) { - Session::flash('error', strval(trans('firefly.invalid_password'))); + Session::flash('error', (string)trans('firefly.invalid_password')); return redirect(route('profile.delete-account')); } @@ -330,7 +345,7 @@ class ProfileController extends Controller { $token = auth()->user()->generateAccessToken(); Preferences::set('access_token', $token); - Session::flash('success', strval(trans('firefly.token_regenerated'))); + Session::flash('success', (string)trans('firefly.token_regenerated')); return redirect(route('profile.index')); } @@ -380,7 +395,7 @@ class ProfileController extends Controller $repository->unblockUser($user); // return to login. - Session::flash('success', strval(trans('firefly.login_with_old_email'))); + Session::flash('success', (string)trans('firefly.login_with_old_email')); return redirect(route('login')); } @@ -397,16 +412,38 @@ class ProfileController extends Controller protected function validatePassword(User $user, string $current, string $new): bool { if (!Hash::check($current, $user->password)) { - throw new ValidationException(strval(trans('firefly.invalid_current_password'))); + throw new ValidationException((string)trans('firefly.invalid_current_password')); } if ($current === $new) { - throw new ValidationException(strval(trans('firefly.should_change'))); + throw new ValidationException((string)trans('firefly.should_change')); } return true; } + /** + * + */ + private function createOAuthKeys() + { + $rsa = new RSA(); + $keys = $rsa->createKey(4096); + + [$publicKey, $privateKey] = [ + Passport::keyPath('oauth-public.key'), + Passport::keyPath('oauth-private.key'), + ]; + + if (file_exists($publicKey) || file_exists($privateKey)) { + return; + } + Log::alert('NO OAuth keys were found. They have been created.'); + + file_put_contents($publicKey, array_get($keys, 'publickey')); + file_put_contents($privateKey, array_get($keys, 'privatekey')); + } + /** * @return string */ diff --git a/app/Http/Controllers/Report/AccountController.php b/app/Http/Controllers/Report/AccountController.php index c7c8ff447f..db107b0eba 100644 --- a/app/Http/Controllers/Report/AccountController.php +++ b/app/Http/Controllers/Report/AccountController.php @@ -40,7 +40,7 @@ class AccountController extends Controller * * @return mixed|string * - * @throws \Throwable + */ public function general(Collection $accounts, Carbon $start, Carbon $end) { diff --git a/app/Http/Controllers/Report/BalanceController.php b/app/Http/Controllers/Report/BalanceController.php index 77aec1cc00..c66c7f666e 100644 --- a/app/Http/Controllers/Report/BalanceController.php +++ b/app/Http/Controllers/Report/BalanceController.php @@ -41,7 +41,7 @@ class BalanceController extends Controller * * @return mixed|string * - * @throws \Throwable + */ public function general(BalanceReportHelperInterface $helper, Collection $accounts, Carbon $start, Carbon $end) { diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php index 09b42e0a5a..9e6a8cb5e4 100644 --- a/app/Http/Controllers/Report/BudgetController.php +++ b/app/Http/Controllers/Report/BudgetController.php @@ -42,7 +42,7 @@ class BudgetController extends Controller * * @return mixed|string * - * @throws \Throwable + */ public function general(BudgetReportHelperInterface $helper, Collection $accounts, Carbon $start, Carbon $end) { @@ -71,7 +71,7 @@ class BudgetController extends Controller * * @return mixed|string * - * @throws \Throwable + */ public function period(Collection $accounts, Carbon $start, Carbon $end) { diff --git a/app/Http/Controllers/Report/CategoryController.php b/app/Http/Controllers/Report/CategoryController.php index 7491bd34a2..f55aa23429 100644 --- a/app/Http/Controllers/Report/CategoryController.php +++ b/app/Http/Controllers/Report/CategoryController.php @@ -41,7 +41,7 @@ class CategoryController extends Controller * * @return mixed|string * - * @throws \Throwable + */ public function expenses(Collection $accounts, Carbon $start, Carbon $end) { @@ -74,7 +74,7 @@ class CategoryController extends Controller * * @return string * - * @throws \Throwable + */ public function income(Collection $accounts, Carbon $start, Carbon $end) { @@ -109,7 +109,7 @@ class CategoryController extends Controller * * @internal param ReportHelperInterface $helper * - * @throws \Throwable + */ public function operations(Collection $accounts, Carbon $start, Carbon $end) { @@ -139,7 +139,7 @@ class CategoryController extends Controller // Obtain a list of columns $sum = []; foreach ($report as $categoryId => $row) { - $sum[$categoryId] = floatval($row['spent']); + $sum[$categoryId] = (float)$row['spent']; } array_multisort($sum, SORT_ASC, $report); diff --git a/app/Http/Controllers/Report/ExpenseController.php b/app/Http/Controllers/Report/ExpenseController.php index 3fb3b9b7cd..2f4df4daef 100644 --- a/app/Http/Controllers/Report/ExpenseController.php +++ b/app/Http/Controllers/Report/ExpenseController.php @@ -68,7 +68,7 @@ class ExpenseController extends Controller * * @return string * - * @throws \Throwable + */ public function budget(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) { @@ -116,7 +116,7 @@ class ExpenseController extends Controller * * @return string * - * @throws \Throwable + */ public function category(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) { @@ -174,7 +174,7 @@ class ExpenseController extends Controller * * @return array|mixed|string * - * @throws \Throwable + */ public function spent(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) { @@ -219,7 +219,7 @@ class ExpenseController extends Controller * * @return string * - * @throws \Throwable + */ public function topExpense(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) { @@ -246,7 +246,7 @@ class ExpenseController extends Controller $set = $collector->getJournals(); $sorted = $set->sortBy( function (Transaction $transaction) { - return floatval($transaction->transaction_amount); + return (float)$transaction->transaction_amount; } ); $result = view('reports.partials.top-transactions', compact('sorted'))->render(); @@ -263,7 +263,7 @@ class ExpenseController extends Controller * * @return mixed|string * - * @throws \Throwable + */ public function topIncome(Collection $accounts, Collection $expense, Carbon $start, Carbon $end) { @@ -290,7 +290,7 @@ class ExpenseController extends Controller $set = $collector->getJournals(); $sorted = $set->sortByDesc( function (Transaction $transaction) { - return floatval($transaction->transaction_amount); + return (float)$transaction->transaction_amount; } ); $result = view('reports.partials.top-transactions', compact('sorted'))->render(); @@ -313,7 +313,7 @@ class ExpenseController extends Controller $collection->push($expenseAccount); $revenue = $this->accountRepository->findByName($expenseAccount->name, [AccountType::REVENUE]); - if (!is_null($revenue)) { + if (null !== $revenue) { $collection->push($revenue); } $combined[$expenseAccount->name] = $collection; @@ -342,11 +342,11 @@ class ExpenseController extends Controller foreach ($set as $transaction) { $currencyId = $transaction->transaction_currency_id; $categoryName = $transaction->transaction_category_name; - $categoryId = intval($transaction->transaction_category_id); + $categoryId = (int)$transaction->transaction_category_id; // if null, grab from journal: if (0 === $categoryId) { $categoryName = $transaction->transaction_journal_category_name; - $categoryId = intval($transaction->transaction_journal_category_id); + $categoryId = (int)$transaction->transaction_journal_category_id; } if (0 !== $categoryId) { $categoryName = app('steam')->tryDecrypt($categoryName); @@ -445,11 +445,11 @@ class ExpenseController extends Controller foreach ($set as $transaction) { $currencyId = $transaction->transaction_currency_id; $budgetName = $transaction->transaction_budget_name; - $budgetId = intval($transaction->transaction_budget_id); + $budgetId = (int)$transaction->transaction_budget_id; // if null, grab from journal: if (0 === $budgetId) { $budgetName = $transaction->transaction_journal_budget_name; - $budgetId = intval($transaction->transaction_journal_budget_id); + $budgetId = (int)$transaction->transaction_journal_budget_id; } if (0 !== $budgetId) { $budgetName = app('steam')->tryDecrypt($budgetName); @@ -506,11 +506,11 @@ class ExpenseController extends Controller foreach ($set as $transaction) { $currencyId = $transaction->transaction_currency_id; $categoryName = $transaction->transaction_category_name; - $categoryId = intval($transaction->transaction_category_id); + $categoryId = (int)$transaction->transaction_category_id; // if null, grab from journal: if (0 === $categoryId) { $categoryName = $transaction->transaction_journal_category_name; - $categoryId = intval($transaction->transaction_journal_category_id); + $categoryId = (int)$transaction->transaction_journal_category_id; } if (0 !== $categoryId) { $categoryName = app('steam')->tryDecrypt($categoryName); @@ -568,7 +568,7 @@ class ExpenseController extends Controller ]; // loop to support multi currency foreach ($set as $transaction) { - $currencyId = intval($transaction->transaction_currency_id); + $currencyId = (int)$transaction->transaction_currency_id; // if not set, set to zero: if (!isset($sum['per_currency'][$currencyId])) { diff --git a/app/Http/Controllers/Report/OperationsController.php b/app/Http/Controllers/Report/OperationsController.php index c86d3c07d2..d112384006 100644 --- a/app/Http/Controllers/Report/OperationsController.php +++ b/app/Http/Controllers/Report/OperationsController.php @@ -41,7 +41,7 @@ class OperationsController extends Controller * * @return mixed|string * - * @throws \Throwable + */ public function expenses(AccountTaskerInterface $tasker, Collection $accounts, Carbon $start, Carbon $end) { @@ -70,7 +70,7 @@ class OperationsController extends Controller * * @return string * - * @throws \Throwable + */ public function income(AccountTaskerInterface $tasker, Collection $accounts, Carbon $start, Carbon $end) { @@ -100,7 +100,7 @@ class OperationsController extends Controller * * @return mixed|string * - * @throws \Throwable + */ public function operations(AccountTaskerInterface $tasker, Collection $accounts, Carbon $start, Carbon $end) { diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index c79b940008..9681f9440f 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -175,9 +175,8 @@ class ReportController extends Controller $generator = ReportGeneratorFactory::reportGenerator('Budget', $start, $end); $generator->setAccounts($accounts); $generator->setBudgets($budgets); - $result = $generator->generate(); - return $result; + return $generator->generate(); } /** @@ -214,9 +213,8 @@ class ReportController extends Controller $generator = ReportGeneratorFactory::reportGenerator('Category', $start, $end); $generator->setAccounts($accounts); $generator->setCategories($categories); - $result = $generator->generate(); - return $result; + return $generator->generate(); } /** @@ -252,9 +250,8 @@ class ReportController extends Controller $generator = ReportGeneratorFactory::reportGenerator('Standard', $start, $end); $generator->setAccounts($accounts); - $result = $generator->generate(); - return $result; + return $generator->generate(); } /** @@ -269,7 +266,7 @@ class ReportController extends Controller $months = $this->helper->listOfMonths($start); $customFiscalYear = Preferences::get('customFiscalYear', 0)->data; $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); - $accountList = join(',', $accounts->pluck('id')->toArray()); + $accountList = implode(',', $accounts->pluck('id')->toArray()); $this->repository->cleanupBudgets(); return view('reports.index', compact('months', 'accounts', 'start', 'accountList', 'customFiscalYear')); @@ -280,7 +277,7 @@ class ReportController extends Controller * * @return mixed * - * @throws \Throwable + */ public function options(string $reportType) { @@ -319,11 +316,11 @@ class ReportController extends Controller $reportType = $request->get('report_type'); $start = $request->getStartDate()->format('Ymd'); $end = $request->getEndDate()->format('Ymd'); - $accounts = join(',', $request->getAccountList()->pluck('id')->toArray()); - $categories = join(',', $request->getCategoryList()->pluck('id')->toArray()); - $budgets = join(',', $request->getBudgetList()->pluck('id')->toArray()); - $tags = join(',', $request->getTagList()->pluck('tag')->toArray()); - $expense = join(',', $request->getExpenseList()->pluck('id')->toArray()); + $accounts = implode(',', $request->getAccountList()->pluck('id')->toArray()); + $categories = implode(',', $request->getCategoryList()->pluck('id')->toArray()); + $budgets = implode(',', $request->getBudgetList()->pluck('id')->toArray()); + $tags = implode(',', $request->getTagList()->pluck('tag')->toArray()); + $expense = implode(',', $request->getExpenseList()->pluck('id')->toArray()); $uri = route('reports.index'); if (0 === $request->getAccountList()->count()) { @@ -413,15 +410,14 @@ class ReportController extends Controller $generator = ReportGeneratorFactory::reportGenerator('Tag', $start, $end); $generator->setAccounts($accounts); $generator->setTags($tags); - $result = $generator->generate(); - return $result; + return $generator->generate(); } /** * @return string * - * @throws \Throwable + */ private function accountReportOptions(): string { @@ -437,45 +433,41 @@ class ReportController extends Controller } } - $result = view('reports.options.account', compact('set'))->render(); - - return $result; + return view('reports.options.account', compact('set'))->render(); } /** * @return string * - * @throws \Throwable + */ private function budgetReportOptions(): string { /** @var BudgetRepositoryInterface $repository */ $repository = app(BudgetRepositoryInterface::class); $budgets = $repository->getBudgets(); - $result = view('reports.options.budget', compact('budgets'))->render(); - return $result; + return view('reports.options.budget', compact('budgets'))->render(); } /** * @return string * - * @throws \Throwable + */ private function categoryReportOptions(): string { /** @var CategoryRepositoryInterface $repository */ $repository = app(CategoryRepositoryInterface::class); $categories = $repository->getCategories(); - $result = view('reports.options.category', compact('categories'))->render(); - return $result; + return view('reports.options.category', compact('categories'))->render(); } /** * @return string * - * @throws \Throwable + */ private function noReportOptions(): string { @@ -485,7 +477,7 @@ class ReportController extends Controller /** * @return string * - * @throws \Throwable + */ private function tagReportOptions(): string { @@ -496,8 +488,7 @@ class ReportController extends Controller return $tag->tag; } ); - $result = view('reports.options.tag', compact('tags'))->render(); - return $result; + return view('reports.options.tag', compact('tags'))->render(); } } diff --git a/app/Http/Controllers/RuleController.php b/app/Http/Controllers/RuleController.php index 2959754ece..c6b550967f 100644 --- a/app/Http/Controllers/RuleController.php +++ b/app/Http/Controllers/RuleController.php @@ -72,8 +72,8 @@ class RuleController extends Controller * * @return View * - * @throws \Throwable - * @throws \Throwable + + */ public function create(Request $request, RuleGroup $ruleGroup) { @@ -167,10 +167,10 @@ class RuleController extends Controller * * @return View * - * @throws \Throwable - * @throws \Throwable - * @throws \Throwable - * @throws \Throwable + + + + */ public function edit(Request $request, RuleRepositoryInterface $repository, Rule $rule) { @@ -253,7 +253,7 @@ class RuleController extends Controller $this->dispatch($job); // Tell the user that the job is queued - Session::flash('success', strval(trans('firefly.applied_rule_selection', ['title' => $rule->title]))); + Session::flash('success', (string)trans('firefly.applied_rule_selection', ['title' => $rule->title])); return redirect()->route('rules.index'); } @@ -311,7 +311,6 @@ class RuleController extends Controller * @param Rule $rule * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View - * @throws \InvalidArgumentException */ public function selectTransactions(AccountRepositoryInterface $repository, Rule $rule) { @@ -342,7 +341,7 @@ class RuleController extends Controller Session::flash('success', trans('firefly.stored_new_rule', ['title' => $rule->title])); Preferences::mark(); - if (1 === intval($request->get('create_another'))) { + if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart Session::put('rules.create.fromStore', true); @@ -365,7 +364,7 @@ class RuleController extends Controller * * @return \Illuminate\Http\JsonResponse * - * @throws \Throwable + */ public function testTriggers(TestRuleFormRequest $request) { @@ -376,8 +375,8 @@ class RuleController extends Controller return response()->json(['html' => '', 'warning' => trans('firefly.warning_no_valid_triggers')]); // @codeCoverageIgnore } - $limit = intval(config('firefly.test-triggers.limit')); - $range = intval(config('firefly.test-triggers.range')); + $limit = (int)config('firefly.test-triggers.limit'); + $range = (int)config('firefly.test-triggers.range'); /** @var TransactionMatcher $matcher */ $matcher = app(TransactionMatcher::class); @@ -414,7 +413,7 @@ class RuleController extends Controller * * @return \Illuminate\Http\JsonResponse * - * @throws \Throwable + */ public function testTriggersByRule(Rule $rule) { @@ -424,8 +423,8 @@ class RuleController extends Controller return response()->json(['html' => '', 'warning' => trans('firefly.warning_no_valid_triggers')]); // @codeCoverageIgnore } - $limit = intval(config('firefly.test-triggers.limit')); - $range = intval(config('firefly.test-triggers.range')); + $limit = (int)config('firefly.test-triggers.limit'); + $range = (int)config('firefly.test-triggers.range'); /** @var TransactionMatcher $matcher */ $matcher = app(TransactionMatcher::class); @@ -477,7 +476,7 @@ class RuleController extends Controller Session::flash('success', trans('firefly.updated_rule', ['title' => $rule->title])); Preferences::mark(); - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart Session::put('rules.edit.fromUpdate', true); @@ -540,7 +539,7 @@ class RuleController extends Controller * * @return array * - * @throws \Throwable + */ private function getCurrentActions(Rule $rule) { @@ -570,7 +569,7 @@ class RuleController extends Controller * * @return array * - * @throws \Throwable + */ private function getCurrentTriggers(Rule $rule) { @@ -602,7 +601,7 @@ class RuleController extends Controller * * @return array * - * @throws \Throwable + */ private function getPreviousActions(Request $request) { @@ -633,7 +632,7 @@ class RuleController extends Controller * * @return array * - * @throws \Throwable + */ private function getPreviousTriggers(Request $request) { @@ -674,7 +673,7 @@ class RuleController extends Controller ]; if (is_array($data['rule-triggers'])) { foreach ($data['rule-triggers'] as $index => $triggerType) { - $data['rule-trigger-stop'][$index] = $data['rule-trigger-stop'][$index] ?? 0; + $data['rule-trigger-stop'][$index] = (int)($data['rule-trigger-stop'][$index] ?? 0.0); $triggers[] = [ 'type' => $triggerType, 'value' => $data['rule-trigger-values'][$index], diff --git a/app/Http/Controllers/RuleGroupController.php b/app/Http/Controllers/RuleGroupController.php index 366c5c6d0e..adf37c3746 100644 --- a/app/Http/Controllers/RuleGroupController.php +++ b/app/Http/Controllers/RuleGroupController.php @@ -104,11 +104,11 @@ class RuleGroupController extends Controller public function destroy(Request $request, RuleGroupRepositoryInterface $repository, RuleGroup $ruleGroup) { $title = $ruleGroup->title; - $moveTo = auth()->user()->ruleGroups()->find(intval($request->get('move_rules_before_delete'))); + $moveTo = auth()->user()->ruleGroups()->find((int)$request->get('move_rules_before_delete')); $repository->destroy($ruleGroup, $moveTo); - Session::flash('success', strval(trans('firefly.deleted_rule_group', ['title' => $title]))); + Session::flash('success', (string)trans('firefly.deleted_rule_group', ['title' => $title])); Preferences::mark(); return redirect($this->getPreviousUri('rule-groups.delete.uri')); @@ -174,7 +174,7 @@ class RuleGroupController extends Controller $this->dispatch($job); // Tell the user that the job is queued - Session::flash('success', strval(trans('firefly.applied_rule_group_selection', ['title' => $ruleGroup->title]))); + Session::flash('success', (string)trans('firefly.applied_rule_group_selection', ['title' => $ruleGroup->title])); return redirect()->route('rules.index'); } @@ -184,12 +184,11 @@ class RuleGroupController extends Controller * @param RuleGroup $ruleGroup * * @return View - * @throws \InvalidArgumentException */ public function selectTransactions(AccountRepositoryInterface $repository, RuleGroup $ruleGroup) { // does the user have shared accounts? - $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); + $accounts = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]); $accountList = ExpandedForm::makeSelectList($accounts); $checkedAccounts = array_keys($accountList); $first = session('first')->format('Y-m-d'); @@ -210,10 +209,10 @@ class RuleGroupController extends Controller $data = $request->getRuleGroupData(); $ruleGroup = $repository->store($data); - Session::flash('success', strval(trans('firefly.created_new_rule_group', ['title' => $ruleGroup->title]))); + Session::flash('success', (string)trans('firefly.created_new_rule_group', ['title' => $ruleGroup->title])); Preferences::mark(); - if (1 === intval($request->get('create_another'))) { + if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart Session::put('rule-groups.create.fromStore', true); @@ -249,15 +248,15 @@ class RuleGroupController extends Controller $data = [ 'title' => $request->input('title'), 'description' => $request->input('description'), - 'active' => 1 === intval($request->input('active')), + 'active' => 1 === (int)$request->input('active'), ]; $repository->update($ruleGroup, $data); - Session::flash('success', strval(trans('firefly.updated_rule_group', ['title' => $ruleGroup->title]))); + Session::flash('success', (string)trans('firefly.updated_rule_group', ['title' => $ruleGroup->title])); Preferences::mark(); - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart Session::put('rule-groups.edit.fromUpdate', true); diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 65f5fc6ab0..401f9bcc8f 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -58,7 +58,7 @@ class SearchController extends Controller */ public function index(Request $request, SearchInterface $searcher) { - $fullQuery = strval($request->get('q')); + $fullQuery = (string)$request->get('q'); // parse search terms: $searcher->parseQuery($fullQuery); @@ -74,11 +74,11 @@ class SearchController extends Controller * * @return \Illuminate\Http\JsonResponse * - * @throws \Throwable + */ public function search(Request $request, SearchInterface $searcher) { - $fullQuery = strval($request->get('query')); + $fullQuery = (string)$request->get('query'); $transactions = new Collection; // cache $cache = new CacheProperties; @@ -92,7 +92,7 @@ class SearchController extends Controller if (!$cache->has()) { // parse search terms: $searcher->parseQuery($fullQuery); - $searcher->setLimit(intval(env('SEARCH_RESULT_LIMIT', 50))); + $searcher->setLimit((int)env('SEARCH_RESULT_LIMIT', 50)); $transactions = $searcher->searchTransactions(); $cache->store($transactions); } diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php index cd9bb698f0..5aded663df 100644 --- a/app/Http/Controllers/System/InstallController.php +++ b/app/Http/Controllers/System/InstallController.php @@ -36,6 +36,7 @@ use phpseclib\Crypt\RSA; class InstallController extends Controller { /** @noinspection MagicMethodsValidityInspection */ + /** @noinspection PhpMissingParentConstructorInspection */ /** * InstallController constructor. */ @@ -62,7 +63,7 @@ class InstallController extends Controller $rsa = new RSA(); $keys = $rsa->createKey(4096); - list($publicKey, $privateKey) = [ + [$publicKey, $privateKey] = [ Passport::keyPath('oauth-public.key'), Passport::keyPath('oauth-private.key'), ]; diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index c4e1e05d69..0957c6db62 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -63,7 +63,7 @@ class TagController extends Controller $this->middleware( function ($request, $next) { $this->repository = app(TagRepositoryInterface::class); - app('view')->share('title', strval(trans('firefly.tags'))); + app('view')->share('title', (string)trans('firefly.tags')); app('view')->share('mainTitleIcon', 'fa-tags'); return $next($request); @@ -118,7 +118,7 @@ class TagController extends Controller $tagName = $tag->tag; $this->repository->destroy($tag); - Session::flash('success', strval(trans('firefly.deleted_tag', ['tag' => $tagName]))); + Session::flash('success', (string)trans('firefly.deleted_tag', ['tag' => $tagName])); Preferences::mark(); return redirect($this->getPreviousUri('tags.delete.uri')); @@ -195,8 +195,8 @@ class TagController extends Controller // default values: $subTitle = $tag->tag; $subTitleIcon = 'fa-tag'; - $page = intval($request->get('page')); - $pageSize = intval(Preferences::get('listPageSize', 50)->data); + $page = (int)$request->get('page'); + $pageSize = (int)Preferences::get('listPageSize', 50)->data; $range = Preferences::get('viewRange', '1M')->data; $start = null; $end = null; @@ -260,10 +260,10 @@ class TagController extends Controller $data = $request->collectTagData(); $this->repository->store($data); - Session::flash('success', strval(trans('firefly.created_tag', ['tag' => $data['tag']]))); + Session::flash('success', (string)trans('firefly.created_tag', ['tag' => $data['tag']])); Preferences::mark(); - if (1 === intval($request->get('create_another'))) { + if (1 === (int)$request->get('create_another')) { // @codeCoverageIgnoreStart Session::put('tags.create.fromStore', true); @@ -285,10 +285,10 @@ class TagController extends Controller $data = $request->collectTagData(); $this->repository->update($tag, $data); - Session::flash('success', strval(trans('firefly.updated_tag', ['tag' => $data['tag']]))); + Session::flash('success', (string)trans('firefly.updated_tag', ['tag' => $data['tag']])); Preferences::mark(); - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // @codeCoverageIgnoreStart Session::put('tags.edit.fromUpdate', true); diff --git a/app/Http/Controllers/Transaction/BulkController.php b/app/Http/Controllers/Transaction/BulkController.php index 3c98c177a3..d4ed300ea6 100644 --- a/app/Http/Controllers/Transaction/BulkController.php +++ b/app/Http/Controllers/Transaction/BulkController.php @@ -70,7 +70,6 @@ class BulkController extends Controller * @param Collection $journals * * @return View - * @throws \RuntimeException */ public function edit(Request $request, Collection $journals) { @@ -140,22 +139,21 @@ class BulkController extends Controller * @param JournalRepositoryInterface $repository * * @return mixed - * @throws \RuntimeException */ public function update(BulkEditJournalRequest $request, JournalRepositoryInterface $repository) { /** @var JournalUpdateService $service */ $service = app(JournalUpdateService::class); $journalIds = $request->get('journals'); - $ignoreCategory = intval($request->get('ignore_category')) === 1; - $ignoreBudget = intval($request->get('ignore_budget')) === 1; - $ignoreTags = intval($request->get('ignore_tags')) === 1; + $ignoreCategory = (int)$request->get('ignore_category') === 1; + $ignoreBudget = (int)$request->get('ignore_budget') === 1; + $ignoreTags = (int)$request->get('ignore_tags') === 1; $count = 0; if (is_array($journalIds)) { foreach ($journalIds as $journalId) { - $journal = $repository->find(intval($journalId)); - if (!is_null($journal)) { + $journal = $repository->find((int)$journalId); + if (null !== $journal) { $count++; Log::debug(sprintf('Found journal #%d', $journal->id)); // update category if not told to ignore diff --git a/app/Http/Controllers/Transaction/ConvertController.php b/app/Http/Controllers/Transaction/ConvertController.php index d536705bcd..2d4cb53068 100644 --- a/app/Http/Controllers/Transaction/ConvertController.php +++ b/app/Http/Controllers/Transaction/ConvertController.php @@ -191,7 +191,7 @@ class ConvertController extends Controller break; case TransactionType::WITHDRAWAL . '-' . TransactionType::TRANSFER: // two - $destination = $accountRepository->findNull(intval($data['destination_account_asset'])); + $destination = $accountRepository->findNull((int)$data['destination_account_asset']); break; case TransactionType::DEPOSIT . '-' . TransactionType::WITHDRAWAL: case TransactionType::TRANSFER . '-' . TransactionType::WITHDRAWAL: @@ -266,7 +266,7 @@ class ConvertController extends Controller $source = $destinationAccount; break; case TransactionType::DEPOSIT . '-' . TransactionType::TRANSFER: - $source = $accountRepository->findNull(intval($data['source_account_asset'])); + $source = $accountRepository->findNull((int)$data['source_account_asset']); break; } diff --git a/app/Http/Controllers/Transaction/LinkController.php b/app/Http/Controllers/Transaction/LinkController.php index 86d6618e18..0c7f0b02b2 100644 --- a/app/Http/Controllers/Transaction/LinkController.php +++ b/app/Http/Controllers/Transaction/LinkController.php @@ -86,10 +86,10 @@ class LinkController extends Controller { $this->repository->destroyLink($link); - Session::flash('success', strval(trans('firefly.deleted_link'))); + Session::flash('success', (string)trans('firefly.deleted_link')); Preferences::mark(); - return redirect(strval(session('journal_links.delete.uri'))); + return redirect((string)session('journal_links.delete.uri')); } /** @@ -111,7 +111,7 @@ class LinkController extends Controller $other = $this->journalRepository->find($linkInfo['transaction_journal_id']); $alreadyLinked = $this->repository->findLink($journal, $other); - if($other->id === $journal->id) { + if ($other->id === $journal->id) { Session::flash('error', trans('firefly.journals_link_to_self')); return redirect(route('transactions.show', [$journal->id])); diff --git a/app/Http/Controllers/Transaction/MassController.php b/app/Http/Controllers/Transaction/MassController.php index e21f296f4c..bfd29a23e2 100644 --- a/app/Http/Controllers/Transaction/MassController.php +++ b/app/Http/Controllers/Transaction/MassController.php @@ -92,8 +92,8 @@ class MassController extends Controller /** @var int $journalId */ foreach ($ids as $journalId) { /** @var TransactionJournal $journal */ - $journal = $this->repository->find(intval($journalId)); - if (null !== $journal->id && intval($journalId) === $journal->id) { + $journal = $this->repository->find((int)$journalId); + if (null !== $journal->id && (int)$journalId === $journal->id) { $set->push($journal); } } @@ -174,14 +174,14 @@ class MassController extends Controller function (TransactionJournal $journal) { $transaction = $this->repository->getFirstPosTransaction($journal); $currency = $transaction->transactionCurrency; - $journal->amount = floatval($transaction->amount); + $journal->amount = (float)$transaction->amount; $sources = $this->repository->getJournalSourceAccounts($journal); $destinations = $this->repository->getJournalDestinationAccounts($journal); $journal->transaction_count = $journal->transactions()->count(); $journal->currency_symbol = $currency->symbol; $journal->transaction_type_type = $journal->transactionType->type; - $journal->foreign_amount = floatval($transaction->foreign_amount); + $journal->foreign_amount = (float)$transaction->foreign_amount; $journal->foreign_currency = $transaction->foreignCurrency; if (null !== $sources->first()) { @@ -216,8 +216,8 @@ class MassController extends Controller $count = 0; if (is_array($journalIds)) { foreach ($journalIds as $journalId) { - $journal = $repository->find(intval($journalId)); - if (!is_null($journal)) { + $journal = $repository->find((int)$journalId); + if (null !== $journal) { // get optional fields: $what = strtolower($this->repository->getTransactionType($journal)); $sourceAccountId = $request->get('source_account_id')[$journal->id] ?? null; @@ -225,13 +225,13 @@ class MassController extends Controller $sourceAccountName = $request->get('source_account_name')[$journal->id] ?? null; $destAccountId = $request->get('destination_account_id')[$journal->id] ?? null; $destAccountName = $request->get('destination_account_name')[$journal->id] ?? null; - $budgetId = $request->get('budget_id')[$journal->id] ?? 0; + $budgetId = (int)($request->get('budget_id')[$journal->id] ?? 0.0); $category = $request->get('category')[$journal->id]; $tags = $journal->tags->pluck('tag')->toArray(); $amount = round($request->get('amount')[$journal->id], 12); $foreignAmount = isset($request->get('foreign_amount')[$journal->id]) ? round($request->get('foreign_amount')[$journal->id], 12) : null; $foreignCurrencyId = isset($request->get('foreign_currency_id')[$journal->id]) ? - intval($request->get('foreign_currency_id')[$journal->id]) : null; + (int)$request->get('foreign_currency_id')[$journal->id] : null; // build data array $data = [ 'id' => $journal->id, @@ -245,16 +245,16 @@ class MassController extends Controller 'category_id' => null, 'category_name' => $category, - 'budget_id' => intval($budgetId), + 'budget_id' => (int)$budgetId, 'budget_name' => null, - 'source_id' => intval($sourceAccountId), + 'source_id' => (int)$sourceAccountId, 'source_name' => $sourceAccountName, - 'destination_id' => intval($destAccountId), + 'destination_id' => (int)$destAccountId, 'destination_name' => $destAccountName, 'amount' => $amount, 'identifier' => 0, 'reconciled' => false, - 'currency_id' => intval($currencyId), + 'currency_id' => (int)$currencyId, 'currency_code' => null, 'description' => null, 'foreign_amount' => $foreignAmount, diff --git a/app/Http/Controllers/Transaction/SingleController.php b/app/Http/Controllers/Transaction/SingleController.php index b9dcc296a6..c76a87dc9c 100644 --- a/app/Http/Controllers/Transaction/SingleController.php +++ b/app/Http/Controllers/Transaction/SingleController.php @@ -162,7 +162,7 @@ class SingleController extends Controller $subTitle = trans('form.add_new_' . $what); $subTitleIcon = 'fa-plus'; $optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; - $source = intval($request->get('source')); + $source = (int)$request->get('source'); if (($what === 'withdrawal' || $what === 'transfer') && $source > 0) { $preFilled['source_account_id'] = $source; @@ -227,7 +227,7 @@ class SingleController extends Controller } // @codeCoverageIgnoreEnd $type = $transactionJournal->transactionTypeStr(); - Session::flash('success', strval(trans('firefly.deleted_' . strtolower($type), ['description' => $transactionJournal->description]))); + Session::flash('success', (string)trans('firefly.deleted_' . strtolower($type), ['description' => $transactionJournal->description])); $this->repository->destroy($transactionJournal); @@ -272,7 +272,7 @@ class SingleController extends Controller $destinationAccounts = $repository->getJournalDestinationAccounts($journal); $optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; $pTransaction = $repository->getFirstPosTransaction($journal); - $foreignCurrency = null !== $pTransaction->foreignCurrency ? $pTransaction->foreignCurrency : $pTransaction->transactionCurrency; + $foreignCurrency = $pTransaction->foreignCurrency ?? $pTransaction->transactionCurrency; $preFilled = [ 'date' => $repository->getJournalDate($journal, null), // $journal->dateAsString() 'interest_date' => $repository->getJournalDate($journal, 'interest_date'), @@ -334,16 +334,16 @@ class SingleController extends Controller */ public function store(JournalFormRequest $request, JournalRepositoryInterface $repository) { - $doSplit = 1 === intval($request->get('split_journal')); - $createAnother = 1 === intval($request->get('create_another')); + $doSplit = 1 === (int)$request->get('split_journal'); + $createAnother = 1 === (int)$request->get('create_another'); $data = $request->getJournalData(); $journal = $repository->store($data); if (null === $journal->id) { // error! - Log::error('Could not store transaction journal: ', $journal->getErrors()->toArray()); - Session::flash('error', $journal->getErrors()->first()); + Log::error('Could not store transaction journal.'); + Session::flash('error', (string)trans('firefly.unknown_journal_error')); return redirect(route('transactions.create', [$request->input('what')]))->withInput(); } @@ -354,17 +354,17 @@ class SingleController extends Controller // store the journal only, flash the rest. Log::debug(sprintf('Count of error messages is %d', $this->attachments->getErrors()->count())); - if (count($this->attachments->getErrors()->get('attachments')) > 0) { + if (\count($this->attachments->getErrors()->get('attachments')) > 0) { Session::flash('error', $this->attachments->getErrors()->get('attachments')); } // flash messages - if (count($this->attachments->getMessages()->get('attachments')) > 0) { + if (\count($this->attachments->getMessages()->get('attachments')) > 0) { Session::flash('info', $this->attachments->getMessages()->get('attachments')); } event(new StoredTransactionJournal($journal, $data['piggy_bank_id'])); - Session::flash('success', strval(trans('firefly.stored_journal', ['description' => $journal->description]))); + Session::flash('success', (string)trans('firefly.stored_journal', ['description' => $journal->description])); Preferences::mark(); // @codeCoverageIgnoreStart @@ -417,11 +417,11 @@ class SingleController extends Controller // update, get events by date and sort DESC $type = strtolower($this->repository->getTransactionType($journal)); - Session::flash('success', strval(trans('firefly.updated_' . $type, ['description' => $data['description']]))); + Session::flash('success', (string)trans('firefly.updated_' . $type, ['description' => $data['description']])); Preferences::mark(); // @codeCoverageIgnoreStart - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { Session::put('transactions.edit.fromUpdate', true); return redirect(route('transactions.edit', [$journal->id]))->withInput(['return_to_edit' => 1]); diff --git a/app/Http/Controllers/Transaction/SplitController.php b/app/Http/Controllers/Transaction/SplitController.php index be620809ce..807bf1ab10 100644 --- a/app/Http/Controllers/Transaction/SplitController.php +++ b/app/Http/Controllers/Transaction/SplitController.php @@ -114,7 +114,7 @@ class SplitController extends Controller /** @var Account $account */ foreach ($accountList as $account) { $accountArray[$account->id] = $account; - $accountArray[$account->id]['currency_id'] = intval($account->getMeta('currency_id')); + $accountArray[$account->id]['currency_id'] = (int)$account->getMeta('currency_id'); } // put previous url in session if not redirect from store (not "return_to_edit"). @@ -126,8 +126,7 @@ class SplitController extends Controller return view( 'transactions.split.edit', compact( 'subTitleIcon', 'currencies', 'optionalFields', 'preFilled', 'subTitle', 'uploadSize', 'budgets', - 'journal', 'accountArray', - 'previous' + 'journal', 'accountArray' ) ); } @@ -160,11 +159,11 @@ class SplitController extends Controller // @codeCoverageIgnoreEnd $type = strtolower($this->repository->getTransactionType($journal)); - Session::flash('success', strval(trans('firefly.updated_' . $type, ['description' => $journal->description]))); + Session::flash('success', (string)trans('firefly.updated_' . $type, ['description' => $journal->description])); Preferences::mark(); // @codeCoverageIgnoreStart - if (1 === intval($request->get('return_to_edit'))) { + if (1 === (int)$request->get('return_to_edit')) { // set value so edit routine will not overwrite URL: Session::put('transactions.edit-split.fromUpdate', true); diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 0d7a950ed2..f010d38b26 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -94,7 +94,7 @@ class TransactionController extends Controller } if ($end < $start) { - list($start, $end) = [$end, $start]; + [$start, $end] = [$end, $start]; } $startStr = $start->formatLocalized($this->monthAndDayFormat); $endStr = $end->formatLocalized($this->monthAndDayFormat); @@ -240,9 +240,9 @@ class TransactionController extends Controller */ private function getPeriodOverview(string $what, Carbon $date): Collection { - $range = Preferences::get('viewRange', '1M')->data; - $first = $this->repository->first(); - $start = new Carbon; + $range = Preferences::get('viewRange', '1M')->data; + $first = $this->repository->firstNull(); + $start = new Carbon; $start->subYear(); $types = config('firefly.transactionTypesByWhat.' . $what); $entries = new Collection; @@ -250,7 +250,7 @@ class TransactionController extends Controller $start = $first->date; } if ($date < $start) { - list($start, $date) = [$date, $start]; // @codeCoverageIgnore + [$start, $date] = [$date, $start]; // @codeCoverageIgnore } /** @var array $dates */ diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 372655d233..cfd265b47b 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -84,10 +84,10 @@ class Authenticate if ($this->auth->check()) { // do an extra check on user object. $user = $this->auth->authenticate(); - if (1 === intval($user->blocked)) { - $message = strval(trans('firefly.block_account_logout')); + if (1 === (int)$user->blocked) { + $message = (string)trans('firefly.block_account_logout'); if ('email_changed' === $user->blocked_code) { - $message = strval(trans('firefly.email_changed_logout')); + $message = (string)trans('firefly.email_changed_logout'); } app('session')->flash('logoutMessage', $message); $this->auth->logout(); diff --git a/app/Http/Middleware/AuthenticateTwoFactor.php b/app/Http/Middleware/AuthenticateTwoFactor.php index e78a155a0a..61e747bd02 100644 --- a/app/Http/Middleware/AuthenticateTwoFactor.php +++ b/app/Http/Middleware/AuthenticateTwoFactor.php @@ -58,7 +58,6 @@ class AuthenticateTwoFactor * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|mixed * @throws \Psr\Container\NotFoundExceptionInterface * @throws \Psr\Container\ContainerExceptionInterface - * @throws \Illuminate\Container\EntryNotFoundException */ public function handle($request, Closure $next, ...$guards) { diff --git a/app/Http/Middleware/Binder.php b/app/Http/Middleware/Binder.php index 3e58b67dee..fd321892fa 100644 --- a/app/Http/Middleware/Binder.php +++ b/app/Http/Middleware/Binder.php @@ -63,7 +63,7 @@ class Binder * * @return mixed * - * @throws \LogicException + */ public function handle($request, Closure $next, ...$guards) { diff --git a/app/Http/Middleware/Installer.php b/app/Http/Middleware/Installer.php index f5ff6ec02c..1afa004cdf 100644 --- a/app/Http/Middleware/Installer.php +++ b/app/Http/Middleware/Installer.php @@ -58,8 +58,8 @@ class Installer } // older version in config than database? - $configVersion = intval(config('firefly.db_version')); - $dbVersion = intval(FireflyConfig::getFresh('db_version', 1)->data); + $configVersion = (int)config('firefly.db_version'); + $dbVersion = (int)FireflyConfig::getFresh('db_version', 1)->data; if ($configVersion > $dbVersion) { Log::warning( sprintf( diff --git a/app/Http/Middleware/IsDemoUser.php b/app/Http/Middleware/IsDemoUser.php index bd9e708bd5..f89e05cc30 100644 --- a/app/Http/Middleware/IsDemoUser.php +++ b/app/Http/Middleware/IsDemoUser.php @@ -39,18 +39,17 @@ class IsDemoUser * @param \Closure $next * * @return mixed - * @throws \RuntimeException */ public function handle(Request $request, Closure $next) { /** @var User $user */ $user = $request->user(); - if (is_null($user)) { + if (null === $user) { return $next($request); } if ($user->hasRole('demo')) { - $request->session()->flash('info', strval(trans('firefly.not_available_demo_user'))); + $request->session()->flash('info', (string)trans('firefly.not_available_demo_user')); $current = $request->url(); $previous = $request->session()->previousUrl(); if ($current !== $previous) { diff --git a/app/Http/Middleware/IsSandStormUser.php b/app/Http/Middleware/IsSandStormUser.php index 4847fdef31..227151199b 100644 --- a/app/Http/Middleware/IsSandStormUser.php +++ b/app/Http/Middleware/IsSandStormUser.php @@ -48,8 +48,8 @@ class IsSandStormUser return $next($request); } - if (1 === intval(getenv('SANDSTORM'))) { - Session::flash('warning', strval(trans('firefly.sandstorm_not_available'))); + if (1 === (int)getenv('SANDSTORM')) { + Session::flash('warning', (string)trans('firefly.sandstorm_not_available')); return response()->redirectTo(route('index')); } diff --git a/app/Http/Middleware/Sandstorm.php b/app/Http/Middleware/Sandstorm.php index c8b6e3e878..30ad044198 100644 --- a/app/Http/Middleware/Sandstorm.php +++ b/app/Http/Middleware/Sandstorm.php @@ -52,7 +52,7 @@ class Sandstorm public function handle(Request $request, Closure $next, $guard = null) { // is in Sandstorm environment? - $sandstorm = 1 === intval(getenv('SANDSTORM')); + $sandstorm = 1 === (int)getenv('SANDSTORM'); View::share('SANDSTORM', $sandstorm); if (!$sandstorm) { return $next($request); @@ -62,7 +62,7 @@ class Sandstorm if (Auth::guard($guard)->guest()) { /** @var UserRepositoryInterface $repository */ $repository = app(UserRepositoryInterface::class); - $userId = strval($request->header('X-Sandstorm-User-Id')); + $userId = (string)$request->header('X-Sandstorm-User-Id'); Log::debug(sprintf('Sandstorm user ID is "%s"', $userId)); $count = $repository->count(); @@ -120,7 +120,7 @@ class Sandstorm } } // if in Sandstorm, user logged in, still must check if user is anon. - $userId = strval($request->header('X-Sandstorm-User-Id')); + $userId = (string)$request->header('X-Sandstorm-User-Id'); if (strlen($userId) === 0) { View::share('SANDSTORM_ANON', true); diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 63cbdbd2f3..7fbac67e3c 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -51,7 +51,7 @@ class TrustProxies extends Middleware { $trustedProxies = env('TRUSTED_PROXIES', null); if (false !== $trustedProxies && null !== $trustedProxies && strlen($trustedProxies) > 0) { - $this->proxies = strval($trustedProxies); + $this->proxies = (string)$trustedProxies; } parent::__construct($config); diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.php index e380bcd243..289be2b07b 100644 --- a/app/Http/Requests/AccountFormRequest.php +++ b/app/Http/Requests/AccountFormRequest.php @@ -91,10 +91,10 @@ class AccountFormRequest extends Request /** @var Account $account */ $account = $this->route()->parameter('account'); - if (!is_null($account)) { + if (null !== $account) { // add rules: $rules['id'] = 'belongsToUser:accounts'; - $rules['name'] = 'required|min:1|uniqueAccountForUser:' . intval($this->get('id')); + $rules['name'] = 'required|min:1|uniqueAccountForUser:' . (int)$this->get('id'); $rules['iban'] = ['iban', 'nullable', new UniqueIban($account, $account->accountType->type)]; } diff --git a/app/Http/Requests/AttachmentFormRequest.php b/app/Http/Requests/AttachmentFormRequest.php index a05ac1ac87..58b70356a4 100644 --- a/app/Http/Requests/AttachmentFormRequest.php +++ b/app/Http/Requests/AttachmentFormRequest.php @@ -43,8 +43,8 @@ class AttachmentFormRequest extends Request public function getAttachmentData(): array { return [ - 'title' => $this->string('title'), - 'notes' => $this->string('notes'), + 'title' => $this->string('title'), + 'notes' => $this->string('notes'), ]; } @@ -55,8 +55,8 @@ class AttachmentFormRequest extends Request { // fixed return [ - 'title' => 'between:1,255|nullable', - 'notes' => 'between:1,65536|nullable', + 'title' => 'between:1,255|nullable', + 'notes' => 'between:1,65536|nullable', ]; } } diff --git a/app/Http/Requests/BudgetFormRequest.php b/app/Http/Requests/BudgetFormRequest.php index 9bce8af565..90cd932635 100644 --- a/app/Http/Requests/BudgetFormRequest.php +++ b/app/Http/Requests/BudgetFormRequest.php @@ -58,8 +58,8 @@ class BudgetFormRequest extends Request /** @var BudgetRepositoryInterface $repository */ $repository = app(BudgetRepositoryInterface::class); $nameRule = 'required|between:1,100|uniqueObjectForUser:budgets,name'; - if (null !== $repository->findNull(intval($this->get('id')))) { - $nameRule = 'required|between:1,100|uniqueObjectForUser:budgets,name,' . intval($this->get('id')); + if (null !== $repository->findNull((int)$this->get('id'))) { + $nameRule = 'required|between:1,100|uniqueObjectForUser:budgets,name,' . (int)$this->get('id'); } return [ diff --git a/app/Http/Requests/ExportFormRequest.php b/app/Http/Requests/ExportFormRequest.php index 7a3057987d..d57207f05c 100644 --- a/app/Http/Requests/ExportFormRequest.php +++ b/app/Http/Requests/ExportFormRequest.php @@ -40,7 +40,6 @@ class ExportFormRequest extends Request /** * @return array - * @throws \InvalidArgumentException */ public function rules() { diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index 4c2632a54e..ce59a59330 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -58,7 +58,7 @@ class ReportFormRequest extends Request $collection = new Collection; if (is_array($set)) { foreach ($set as $accountId) { - $account = $repository->findNull(intval($accountId)); + $account = $repository->findNull((int)$accountId); if (null !== $account) { $collection->push($account); } @@ -79,7 +79,7 @@ class ReportFormRequest extends Request $collection = new Collection; if (is_array($set)) { foreach ($set as $budgetId) { - $budget = $repository->findNull(intval($budgetId)); + $budget = $repository->findNull((int)$budgetId); if (null !== $budget) { $collection->push($budget); } @@ -100,7 +100,7 @@ class ReportFormRequest extends Request $collection = new Collection; if (is_array($set)) { foreach ($set as $categoryId) { - $category = $repository->findNull(intval($categoryId)); + $category = $repository->findNull((int)$categoryId); if (null !== $category) { $collection->push($category); } @@ -119,7 +119,7 @@ class ReportFormRequest extends Request { $date = new Carbon; $range = $this->get('daterange'); - $parts = explode(' - ', strval($range)); + $parts = explode(' - ', (string)$range); if (2 === count($parts)) { try { $date = new Carbon($parts[1]); @@ -147,7 +147,7 @@ class ReportFormRequest extends Request $collection = new Collection; if (is_array($set)) { foreach ($set as $accountId) { - $account = $repository->findNull(intval($accountId)); + $account = $repository->findNull((int)$accountId); if (null !== $account) { $collection->push($account); } @@ -166,7 +166,7 @@ class ReportFormRequest extends Request { $date = new Carbon; $range = $this->get('daterange'); - $parts = explode(' - ', strval($range)); + $parts = explode(' - ', (string)$range); if (2 === count($parts)) { try { $date = new Carbon($parts[0]); diff --git a/app/Http/Requests/Request.php b/app/Http/Requests/Request.php index 2b0406614c..fb9162f74d 100644 --- a/app/Http/Requests/Request.php +++ b/app/Http/Requests/Request.php @@ -37,7 +37,7 @@ class Request extends FormRequest */ public function boolean(string $field): bool { - return 1 === intval($this->input($field)); + return 1 === (int)$this->input($field); } /** @@ -47,7 +47,7 @@ class Request extends FormRequest */ public function integer(string $field): int { - return intval($this->get($field)); + return (int)$this->get($field); } /** diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.php index 0890a543e4..c466f3bc45 100644 --- a/app/Http/Requests/RuleFormRequest.php +++ b/app/Http/Requests/RuleFormRequest.php @@ -73,8 +73,8 @@ class RuleFormRequest extends Request $contextActions = implode(',', config('firefly.rule-actions-text')); $titleRule = 'required|between:1,100|uniqueObjectForUser:rules,title'; - if (null !== $repository->find(intval($this->get('id')))->id) { - $titleRule = 'required|between:1,100|uniqueObjectForUser:rules,title,' . intval($this->get('id')); + if (null !== $repository->find((int)$this->get('id'))->id) { + $titleRule = 'required|between:1,100|uniqueObjectForUser:rules,title,' . (int)$this->get('id'); } $rules = [ 'title' => $titleRule, diff --git a/app/Http/Requests/RuleGroupFormRequest.php b/app/Http/Requests/RuleGroupFormRequest.php index 25c7bb59da..dc2dc06ffd 100644 --- a/app/Http/Requests/RuleGroupFormRequest.php +++ b/app/Http/Requests/RuleGroupFormRequest.php @@ -58,8 +58,8 @@ class RuleGroupFormRequest extends Request /** @var RuleGroupRepositoryInterface $repository */ $repository = app(RuleGroupRepositoryInterface::class); $titleRule = 'required|between:1,100|uniqueObjectForUser:rule_groups,title'; - if (null !== $repository->find(intval($this->get('id')))->id) { - $titleRule = 'required|between:1,100|uniqueObjectForUser:rule_groups,title,' . intval($this->get('id')); + if (null !== $repository->find((int)$this->get('id'))->id) { + $titleRule = 'required|between:1,100|uniqueObjectForUser:rule_groups,title,' . (int)$this->get('id'); } return [ diff --git a/app/Http/Requests/SelectTransactionsRequest.php b/app/Http/Requests/SelectTransactionsRequest.php index 082e4dd746..249613892a 100644 --- a/app/Http/Requests/SelectTransactionsRequest.php +++ b/app/Http/Requests/SelectTransactionsRequest.php @@ -41,7 +41,6 @@ class SelectTransactionsRequest extends Request /** * @return array - * @throws \InvalidArgumentException */ public function rules() { diff --git a/app/Http/Requests/SplitJournalFormRequest.php b/app/Http/Requests/SplitJournalFormRequest.php index 14aa681378..7f7d0f7737 100644 --- a/app/Http/Requests/SplitJournalFormRequest.php +++ b/app/Http/Requests/SplitJournalFormRequest.php @@ -77,7 +77,7 @@ class SplitJournalFormRequest extends Request break; } $foreignAmount = $transaction['foreign_amount'] ?? null; - $foreignCurrencyId = intval($transaction['foreign_currency_id'] ?? 0); + $foreignCurrencyId = (int)($transaction['foreign_currency_id'] ?? 0.0); $set = [ 'source_id' => $sourceId, 'source_name' => $sourceName, @@ -92,7 +92,7 @@ class SplitJournalFormRequest extends Request 'currency_code' => null, 'description' => $transaction['transaction_description'], 'amount' => $transaction['amount'], - 'budget_id' => intval($transaction['budget_id'] ?? 0), + 'budget_id' => (int)($transaction['budget_id'] ?? 0.0), 'budget_name' => null, 'category_id' => null, 'category_name' => $transaction['category_name'], @@ -124,7 +124,7 @@ class SplitJournalFormRequest extends Request 'transactions.*.destination_name' => 'between:1,255|nullable', 'transactions.*.amount' => 'required|numeric', 'transactions.*.budget_id' => 'belongsToUser:budgets,id', - 'transactions.*.category_name' => 'between:1,255|nullable', + 'transactions.*.category_name' => 'between:1,255|nullable', 'transactions.*.piggy_bank_id' => 'between:1,255|nullable', ]; } diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.php index 563c920652..85a7acdb0c 100644 --- a/app/Http/Requests/TagFormRequest.php +++ b/app/Http/Requests/TagFormRequest.php @@ -74,7 +74,7 @@ class TagFormRequest extends Request $repository = app(TagRepositoryInterface::class); $idRule = ''; $tagRule = 'required|min:1|uniqueObjectForUser:tags,tag'; - if (null !== $repository->find(intval($this->get('id')))->id) { + if (null !== $repository->find((int)$this->get('id'))->id) { $idRule = 'belongsToUser:tags'; $tagRule = 'required|min:1|uniqueObjectForUser:tags,tag,' . $this->get('id'); } diff --git a/app/Import/Configuration/BunqConfigurator.php b/app/Import/Configuration/BunqConfigurator.php index 8dbf9255f2..f1bb96fe60 100644 --- a/app/Import/Configuration/BunqConfigurator.php +++ b/app/Import/Configuration/BunqConfigurator.php @@ -60,7 +60,7 @@ class BunqConfigurator implements ConfiguratorInterface */ public function configureJob(array $data): bool { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call configureJob() without a job.'); } $stage = $this->getConfig()['stage'] ?? 'initial'; @@ -94,7 +94,7 @@ class BunqConfigurator implements ConfiguratorInterface */ public function getNextData(): array { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call configureJob() without a job.'); } $config = $this->getConfig(); @@ -107,9 +107,8 @@ class BunqConfigurator implements ConfiguratorInterface /** @var HaveAccounts $class */ $class = app(HaveAccounts::class); $class->setJob($this->job); - $data = $class->getData(); - return $data; + return $class->getData(); default: return []; } @@ -122,7 +121,7 @@ class BunqConfigurator implements ConfiguratorInterface */ public function getNextView(): string { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call configureJob() without a job.'); } $stage = $this->getConfig()['stage'] ?? 'initial'; @@ -153,7 +152,7 @@ class BunqConfigurator implements ConfiguratorInterface */ public function isJobConfigured(): bool { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call configureJob() without a job.'); } $stage = $this->getConfig()['stage'] ?? 'initial'; diff --git a/app/Import/Configuration/FileConfigurator.php b/app/Import/Configuration/FileConfigurator.php index 38e1113d01..0eae8d7d07 100644 --- a/app/Import/Configuration/FileConfigurator.php +++ b/app/Import/Configuration/FileConfigurator.php @@ -84,7 +84,7 @@ class FileConfigurator implements ConfiguratorInterface */ public function configureJob(array $data): bool { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call configureJob() without a job.'); } /** @var ConfigurationInterface $object */ @@ -105,7 +105,7 @@ class FileConfigurator implements ConfiguratorInterface */ public function getNextData(): array { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call getNextData() without a job.'); } /** @var ConfigurationInterface $object */ @@ -122,7 +122,7 @@ class FileConfigurator implements ConfiguratorInterface */ public function getNextView(): string { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call getNextView() without a job.'); } $config = $this->getConfig(); @@ -149,7 +149,7 @@ class FileConfigurator implements ConfiguratorInterface */ public function getWarningMessage(): string { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call getWarningMessage() without a job.'); } @@ -163,7 +163,7 @@ class FileConfigurator implements ConfiguratorInterface */ public function isJobConfigured(): bool { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call isJobConfigured() without a job.'); } $config = $this->getConfig(); diff --git a/app/Import/Configuration/SpectreConfigurator.php b/app/Import/Configuration/SpectreConfigurator.php index 0c03c5adb9..e09f7d17fb 100644 --- a/app/Import/Configuration/SpectreConfigurator.php +++ b/app/Import/Configuration/SpectreConfigurator.php @@ -60,7 +60,7 @@ class SpectreConfigurator implements ConfiguratorInterface */ public function configureJob(array $data): bool { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call configureJob() without a job.'); } $stage = $this->getConfig()['stage'] ?? 'initial'; @@ -93,7 +93,7 @@ class SpectreConfigurator implements ConfiguratorInterface */ public function getNextData(): array { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call configureJob() without a job.'); } $config = $this->getConfig(); @@ -116,9 +116,8 @@ class SpectreConfigurator implements ConfiguratorInterface /** @var HaveAccounts $class */ $class = app(HaveAccounts::class); $class->setJob($this->job); - $data = $class->getData(); - return $data; + return $class->getData(); default: return []; } @@ -131,7 +130,7 @@ class SpectreConfigurator implements ConfiguratorInterface */ public function getNextView(): string { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call configureJob() without a job.'); } $stage = $this->getConfig()['stage'] ?? 'initial'; @@ -166,7 +165,7 @@ class SpectreConfigurator implements ConfiguratorInterface */ public function isJobConfigured(): bool { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call configureJob() without a job.'); } $stage = $this->getConfig()['stage'] ?? 'initial'; diff --git a/app/Import/Converter/Amount.php b/app/Import/Converter/Amount.php index d75346d78b..3a9103780b 100644 --- a/app/Import/Converter/Amount.php +++ b/app/Import/Converter/Amount.php @@ -47,7 +47,7 @@ class Amount implements ConverterInterface } Log::debug(sprintf('Start with amount "%s"', $value)); $original = $value; - $value = strval($value); + $value = (string)$value; $value = $this->stripAmount($value); $len = strlen($value); $decimalPosition = $len - 3; @@ -69,7 +69,7 @@ class Amount implements ConverterInterface } // decimal character still null? Search from the left for '.',',' or ' '. - if (is_null($decimal)) { + if (null === $decimal) { Log::debug('Decimal is still NULL, probably number with >2 decimals. Search for a dot.'); $res = strrpos($value, '.'); if (!(false === $res)) { @@ -99,9 +99,7 @@ class Amount implements ConverterInterface Log::debug(sprintf('No decimal character found. Converted amount from "%s" to "%s".', $original, $value)); } - $number = strval(number_format(round(floatval($value), 12), 12, '.', '')); - - return $number; + return strval(number_format(round(floatval($value), 12), 12, '.', '')); } /** diff --git a/app/Import/FileProcessor/CsvProcessor.php b/app/Import/FileProcessor/CsvProcessor.php index b4b8b31858..84915aa160 100644 --- a/app/Import/FileProcessor/CsvProcessor.php +++ b/app/Import/FileProcessor/CsvProcessor.php @@ -46,9 +46,9 @@ class CsvProcessor implements FileProcessorInterface /** @var ImportJobRepositoryInterface */ private $repository; /** @var array */ - private $validConverters = []; + private $validConverters; /** @var array */ - private $validSpecifics = []; + private $validSpecifics; /** * FileProcessorInterface constructor. @@ -67,7 +67,7 @@ class CsvProcessor implements FileProcessorInterface */ public function getObjects(): Collection { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call getObjects() without a job.'); } @@ -84,7 +84,7 @@ class CsvProcessor implements FileProcessorInterface */ public function run(): bool { - if (is_null($this->job)) { + if (null === $this->job) { throw new FireflyException('Cannot call run() without a job.'); } Log::debug('Now in CsvProcessor run(). Job is now running...'); @@ -128,7 +128,7 @@ class CsvProcessor implements FileProcessorInterface * * @param array $array */ - public function setExtendedStatus(array $array) + public function setExtendedStatus(array $array): void { $this->repository->setExtendedStatus($this->job, $array); } @@ -213,7 +213,7 @@ class CsvProcessor implements FileProcessorInterface $config = $this->getConfig(); $reader = Reader::createFromString($content); $delimiter = $config['delimiter'] ?? ','; - $hasHeaders = isset($config['has-headers']) ? $config['has-headers'] : false; + $hasHeaders = $config['has-headers'] ?? false; $offset = 0; if ('tab' === $delimiter) { $delimiter = "\t"; // @codeCoverageIgnore @@ -312,7 +312,7 @@ class CsvProcessor implements FileProcessorInterface * @var string $value */ foreach ($row as $rowIndex => $value) { - $value = trim(strval($value)); + $value = trim((string)$value); if (strlen($value) > 0) { $annotated = $this->annotateValue($rowIndex, $value); Log::debug('Annotated value', $annotated); @@ -320,7 +320,7 @@ class CsvProcessor implements FileProcessorInterface } } // set some extra info: - $importAccount = intval($config['import-account'] ?? 0); + $importAccount = (int)($config['import-account'] ?? 0.0); $journal->asset->setDefaultAccountId($importAccount); return $journal; diff --git a/app/Import/Mapper/AssetAccountIbans.php b/app/Import/Mapper/AssetAccountIbans.php index 20f60ba9cf..c9ffcdbe01 100644 --- a/app/Import/Mapper/AssetAccountIbans.php +++ b/app/Import/Mapper/AssetAccountIbans.php @@ -45,7 +45,7 @@ class AssetAccountIbans implements MapperInterface /** @var Account $account */ foreach ($set as $account) { $iban = $account->iban ?? ''; - $accountId = intval($account->id); + $accountId = (int)$account->id; if (strlen($iban) > 0) { $topList[$accountId] = $account->iban . ' (' . $account->name . ')'; } diff --git a/app/Import/Mapper/AssetAccounts.php b/app/Import/Mapper/AssetAccounts.php index 9344cfb522..23536b13c5 100644 --- a/app/Import/Mapper/AssetAccounts.php +++ b/app/Import/Mapper/AssetAccounts.php @@ -43,7 +43,7 @@ class AssetAccounts implements MapperInterface /** @var Account $account */ foreach ($set as $account) { - $accountId = intval($account->id); + $accountId = (int)$account->id; $name = $account->name; $iban = $account->iban ?? ''; if (strlen($iban) > 0) { diff --git a/app/Import/Mapper/Bills.php b/app/Import/Mapper/Bills.php index bea7a2b3ff..6457affe4f 100644 --- a/app/Import/Mapper/Bills.php +++ b/app/Import/Mapper/Bills.php @@ -42,7 +42,7 @@ class Bills implements MapperInterface /** @var Bill $bill */ foreach ($result as $bill) { - $billId = intval($bill->id); + $billId = (int)$bill->id; $list[$billId] = $bill->name . ' [' . $bill->match . ']'; } asort($list); diff --git a/app/Import/Mapper/Budgets.php b/app/Import/Mapper/Budgets.php index 119e844be3..4c566611b4 100644 --- a/app/Import/Mapper/Budgets.php +++ b/app/Import/Mapper/Budgets.php @@ -42,7 +42,7 @@ class Budgets implements MapperInterface /** @var Budget $budget */ foreach ($result as $budget) { - $budgetId = intval($budget->id); + $budgetId = (int)$budget->id; $list[$budgetId] = $budget->name; } asort($list); diff --git a/app/Import/Mapper/Categories.php b/app/Import/Mapper/Categories.php index 21963f8eaf..e8cddc8c2c 100644 --- a/app/Import/Mapper/Categories.php +++ b/app/Import/Mapper/Categories.php @@ -42,7 +42,7 @@ class Categories implements MapperInterface /** @var Category $category */ foreach ($result as $category) { - $categoryId = intval($category->id); + $categoryId = (int)$category->id; $list[$categoryId] = $category->name; } asort($list); diff --git a/app/Import/Mapper/OpposingAccountIbans.php b/app/Import/Mapper/OpposingAccountIbans.php index efddc090b4..8ae1f146e3 100644 --- a/app/Import/Mapper/OpposingAccountIbans.php +++ b/app/Import/Mapper/OpposingAccountIbans.php @@ -51,7 +51,7 @@ class OpposingAccountIbans implements MapperInterface /** @var Account $account */ foreach ($set as $account) { $iban = $account->iban ?? ''; - $accountId = intval($account->id); + $accountId = (int)$account->id; if (strlen($iban) > 0) { $topList[$accountId] = $account->iban . ' (' . $account->name . ')'; } diff --git a/app/Import/Mapper/OpposingAccounts.php b/app/Import/Mapper/OpposingAccounts.php index e451ace5eb..63875ad338 100644 --- a/app/Import/Mapper/OpposingAccounts.php +++ b/app/Import/Mapper/OpposingAccounts.php @@ -49,7 +49,7 @@ class OpposingAccounts implements MapperInterface /** @var Account $account */ foreach ($set as $account) { - $accountId = intval($account->id); + $accountId = (int)$account->id; $name = $account->name; $iban = $account->iban ?? ''; if (strlen($iban) > 0) { diff --git a/app/Import/Mapper/Tags.php b/app/Import/Mapper/Tags.php index 68536a86b7..b2cfa3f630 100644 --- a/app/Import/Mapper/Tags.php +++ b/app/Import/Mapper/Tags.php @@ -42,7 +42,7 @@ class Tags implements MapperInterface /** @var Tag $tag */ foreach ($result as $tag) { - $tagId = intval($tag->id); + $tagId = (int)$tag->id; $list[$tagId] = $tag->tag; } asort($list); diff --git a/app/Import/Mapper/TransactionCurrencies.php b/app/Import/Mapper/TransactionCurrencies.php index 7e81f4a8c8..e9fa683bce 100644 --- a/app/Import/Mapper/TransactionCurrencies.php +++ b/app/Import/Mapper/TransactionCurrencies.php @@ -39,7 +39,7 @@ class TransactionCurrencies implements MapperInterface $currencies = $repository->get(); $list = []; foreach ($currencies as $currency) { - $currencyId = intval($currency->id); + $currencyId = (int)$currency->id; $list[$currencyId] = $currency->name . ' (' . $currency->code . ')'; } asort($list); diff --git a/app/Import/MapperPreProcess/TagsComma.php b/app/Import/MapperPreProcess/TagsComma.php index 43d628c577..0866cfc1d5 100644 --- a/app/Import/MapperPreProcess/TagsComma.php +++ b/app/Import/MapperPreProcess/TagsComma.php @@ -34,11 +34,10 @@ class TagsComma implements PreProcessorInterface */ public function run(string $value): array { - $set = explode(',', $value); - $set = array_map('trim', $set); - $set = array_filter($set, 'strlen'); - $return = array_values($set); + $set = explode(',', $value); + $set = array_map('trim', $set); + $set = array_filter($set, 'strlen'); - return $return; + return array_values($set); } } diff --git a/app/Import/MapperPreProcess/TagsSpace.php b/app/Import/MapperPreProcess/TagsSpace.php index d8967ee9fb..e87627b5be 100644 --- a/app/Import/MapperPreProcess/TagsSpace.php +++ b/app/Import/MapperPreProcess/TagsSpace.php @@ -34,11 +34,10 @@ class TagsSpace implements PreProcessorInterface */ public function run(string $value): array { - $set = explode(' ', $value); - $set = array_map('trim', $set); - $set = array_filter($set, 'strlen'); - $return = array_values($set); + $set = explode(' ', $value); + $set = array_map('trim', $set); + $set = array_filter($set, 'strlen'); - return $return; + return array_values($set); } } diff --git a/app/Import/Object/ImportAccount.php b/app/Import/Object/ImportAccount.php index 638cdfd83a..34da909602 100644 --- a/app/Import/Object/ImportAccount.php +++ b/app/Import/Object/ImportAccount.php @@ -49,7 +49,7 @@ class ImportAccount /** @var int */ private $defaultAccountId = 0; /** @var string */ - private $expectedType = ''; + private $expectedType; /** * This value is used to indicate the other account ID (the opposing transaction's account), * if it is know. If so, this particular import account may never return an Account with this ID. @@ -299,19 +299,19 @@ class ImportAccount /** @var AccountType $accountType */ $accountType = $this->repository->getAccountType($this->expectedType); $result = $this->findById($accountType); - if (!is_null($result)) { + if (null !== $result) { return $result; } $result = $this->findByIBAN($accountType); - if (!is_null($result)) { + if (null !== $result) { return $result; } $result = $this->findByName($accountType); - if (!is_null($result)) { + if (null !== $result) { return $result; } @@ -365,7 +365,7 @@ class ImportAccount Log::debug('Finding a mapped account based on', $array); - $search = intval($array['mapped'] ?? 0); + $search = (int)($array['mapped'] ?? 0.0); $account = $this->repository->findNull($search); if (null === $account) { @@ -401,10 +401,10 @@ class ImportAccount */ private function store(): bool { - if (is_null($this->user)) { + if (null === $this->user) { throw new FireflyException('ImportAccount cannot continue without user.'); } - if ((is_null($this->defaultAccountId) || 0 === intval($this->defaultAccountId)) && AccountType::ASSET === $this->expectedType) { + if ((null === $this->defaultAccountId || 0 === (int)$this->defaultAccountId) && AccountType::ASSET === $this->expectedType) { throw new FireflyException('ImportAccount cannot continue without a default account to fall back on.'); } // 1: find mapped object: diff --git a/app/Import/Object/ImportBill.php b/app/Import/Object/ImportBill.php index 32061504a2..19996e1058 100644 --- a/app/Import/Object/ImportBill.php +++ b/app/Import/Object/ImportBill.php @@ -108,7 +108,7 @@ class ImportBill if (3 === count($this->id)) { Log::debug(sprintf('Finding bill with ID #%d', $this->id['value'])); /** @var Bill $bill */ - $bill = $this->repository->find(intval($this->id['value'])); + $bill = $this->repository->find((int)$this->id['value']); if (null !== $bill) { Log::debug(sprintf('Found unmapped bill by ID (#%d): %s', $bill->id, $bill->name)); @@ -157,11 +157,11 @@ class ImportBill { Log::debug('In findExistingObject() for Bill'); $result = $this->findById(); - if (!is_null($result)) { + if (null !== $result) { return $result; } $result = $this->findByName(); - if (!is_null($result)) { + if (null !== $result) { return $result; } @@ -215,7 +215,7 @@ class ImportBill Log::debug('Finding a mapped bill based on', $array); - $search = intval($array['mapped']); + $search = (int)$array['mapped']; $bill = $this->repository->find($search); if (null === $bill) { diff --git a/app/Import/Object/ImportBudget.php b/app/Import/Object/ImportBudget.php index 5327855d89..2a34c18906 100644 --- a/app/Import/Object/ImportBudget.php +++ b/app/Import/Object/ImportBudget.php @@ -97,7 +97,7 @@ class ImportBudget if (3 === count($this->id)) { Log::debug(sprintf('Finding budget with ID #%d', $this->id['value'])); /** @var Budget $budget */ - $budget = $this->repository->findNull(intval($this->id['value'])); + $budget = $this->repository->findNull((int)$this->id['value']); if (null !== $budget) { Log::debug(sprintf('Found unmapped budget by ID (#%d): %s', $budget->id, $budget->name)); @@ -146,11 +146,11 @@ class ImportBudget { Log::debug('In findExistingObject() for Budget'); $result = $this->findById(); - if (!is_null($result)) { + if (null !== $result) { return $result; } $result = $this->findByName(); - if (!is_null($result)) { + if (null !== $result) { return $result; } @@ -204,7 +204,7 @@ class ImportBudget Log::debug('Finding a mapped budget based on', $array); - $search = intval($array['mapped']); + $search = (int)$array['mapped']; $budget = $this->repository->find($search); if (null === $budget->id) { diff --git a/app/Import/Object/ImportCategory.php b/app/Import/Object/ImportCategory.php index 176ce6fc0c..dde6cfa24e 100644 --- a/app/Import/Object/ImportCategory.php +++ b/app/Import/Object/ImportCategory.php @@ -99,7 +99,7 @@ class ImportCategory if (3 === count($this->id)) { Log::debug(sprintf('Finding category with ID #%d', $this->id['value'])); /** @var Category $category */ - $category = $this->repository->findNull(intval($this->id['value'])); + $category = $this->repository->findNull((int)$this->id['value']); if (null !== $category) { Log::debug(sprintf('Found unmapped category by ID (#%d): %s', $category->id, $category->name)); @@ -150,12 +150,12 @@ class ImportCategory { Log::debug('In findExistingObject() for Category'); $result = $this->findById(); - if (!is_null($result)) { + if (null !== $result) { return $result; } $result = $this->findByName(); - if (!is_null($result)) { + if (null !== $result) { return $result; } @@ -209,7 +209,7 @@ class ImportCategory Log::debug('Finding a mapped category based on', $array); - $search = intval($array['mapped']); + $search = (int)$array['mapped']; $category = $this->repository->findNull($search); if (null === $category) { diff --git a/app/Import/Object/ImportCurrency.php b/app/Import/Object/ImportCurrency.php index d375048024..47b7a0fa95 100644 --- a/app/Import/Object/ImportCurrency.php +++ b/app/Import/Object/ImportCurrency.php @@ -114,7 +114,7 @@ class ImportCurrency */ public function setId(array $id) { - $id['value'] = intval($id['value']); + $id['value'] = (int)$id['value']; $this->id = $id; } @@ -215,7 +215,7 @@ class ImportCurrency Log::debug('Finding a mapped object based on', $array); - $search = intval($array['mapped']); + $search = (int)$array['mapped']; $currency = $this->repository->findNull($search); if (null === $currency) { diff --git a/app/Import/Object/ImportJournal.php b/app/Import/Object/ImportJournal.php index 1b8d04bfd9..fa5d7ad66f 100644 --- a/app/Import/Object/ImportJournal.php +++ b/app/Import/Object/ImportJournal.php @@ -71,7 +71,7 @@ class ImportJournal /** @var array */ private $amountDebit; /** @var string */ - private $convertedAmount = null; + private $convertedAmount; /** @var string */ private $date = ''; /** @var string */ @@ -225,7 +225,7 @@ class ImportJournal public function getMetaString(string $field): ?string { if (isset($this->metaFields[$field]) && strlen($this->metaFields[$field]) > 0) { - return strval($this->metaFields[$field]); + return (string)$this->metaFields[$field]; } return null; @@ -277,7 +277,7 @@ class ImportJournal case 'sepa-country': case 'sepa-ep': case 'sepa-ci': - $value = trim(strval($array['value'])); + $value = trim((string)$array['value']); if (strlen($value) > 0) { $this->metaFields[$array['role']] = $value; } @@ -448,17 +448,17 @@ class ImportJournal { $info = []; $converterClass = ''; - if (!is_null($this->amount)) { + if (null !== $this->amount) { Log::debug('Amount value is not NULL, assume this is the correct value.'); $converterClass = sprintf('FireflyIII\Import\Converter\%s', config(sprintf('csv.import_roles.%s.converter', $this->amount['role']))); $info = $this->amount; } - if (!is_null($this->amountDebit)) { + if (null !== $this->amountDebit) { Log::debug('Amount DEBIT value is not NULL, assume this is the correct value (overrules Amount).'); $converterClass = sprintf('FireflyIII\Import\Converter\%s', config(sprintf('csv.import_roles.%s.converter', $this->amountDebit['role']))); $info = $this->amountDebit; } - if (!is_null($this->amountCredit)) { + if (null !== $this->amountCredit) { Log::debug('Amount CREDIT value is not NULL, assume this is the correct value (overrules Amount and AmountDebit).'); $converterClass = sprintf('FireflyIII\Import\Converter\%s', config(sprintf('csv.import_roles.%s.converter', $this->amountCredit['role']))); $info = $this->amountCredit; diff --git a/app/Import/Prerequisites/BunqPrerequisites.php b/app/Import/Prerequisites/BunqPrerequisites.php index 7c982c9bec..05246d701d 100644 --- a/app/Import/Prerequisites/BunqPrerequisites.php +++ b/app/Import/Prerequisites/BunqPrerequisites.php @@ -58,7 +58,7 @@ class BunqPrerequisites implements PrerequisitesInterface Log::debug('Now in BunqPrerequisites::getViewParameters()'); $apiKey = Preferences::getForUser($this->user, 'bunq_api_key', null); $string = ''; - if (!is_null($apiKey)) { + if (null !== $apiKey) { $string = $apiKey->data; } diff --git a/app/Import/Prerequisites/SpectrePrerequisites.php b/app/Import/Prerequisites/SpectrePrerequisites.php index e59e102ecc..a662ed3de9 100644 --- a/app/Import/Prerequisites/SpectrePrerequisites.php +++ b/app/Import/Prerequisites/SpectrePrerequisites.php @@ -55,7 +55,7 @@ class SpectrePrerequisites implements PrerequisitesInterface public function getViewParameters(): array { $publicKey = $this->getPublicKey(); - $subTitle = strval(trans('import.spectre_title')); + $subTitle = (string)trans('import.spectre_title'); $subTitleIcon = 'fa-archive'; return compact('publicKey', 'subTitle', 'subTitleIcon'); diff --git a/app/Import/Routine/BunqRoutine.php b/app/Import/Routine/BunqRoutine.php index e4feb97f1d..bff5cbfb6e 100644 --- a/app/Import/Routine/BunqRoutine.php +++ b/app/Import/Routine/BunqRoutine.php @@ -325,7 +325,7 @@ class BunqRoutine implements RoutineInterface Log::debug('in convertToAccount()'); // find opposing party by IBAN first. $result = $this->accountRepository->findByIbanNull($party->getIban(), [$expectedType]); - if (!is_null($result)) { + if (null !== $result) { Log::debug(sprintf('Search for %s resulted in account %s (#%d)', $party->getIban(), $result->name, $result->id)); return $result; @@ -334,7 +334,7 @@ class BunqRoutine implements RoutineInterface // try to find asset account just in case: if ($expectedType !== AccountType::ASSET) { $result = $this->accountRepository->findByIbanNull($party->getIban(), [AccountType::ASSET]); - if (!is_null($result)) { + if (nul !== $result) { Log::debug(sprintf('Search for Asset "%s" resulted in account %s (#%d)', $party->getIban(), $result->name, $result->id)); return $result; @@ -400,8 +400,6 @@ class BunqRoutine implements RoutineInterface Preferences::setForUser($this->job->user, 'bunq_private_key', $privKey); Preferences::setForUser($this->job->user, 'bunq_public_key', $pubKey['key']); Log::debug('Created and stored key pair'); - - return; } /** @@ -570,7 +568,7 @@ class BunqRoutine implements RoutineInterface private function getServerPublicKey(): ServerPublicKey { $pref = Preferences::getForUser($this->job->user, 'bunq_server_public_key', null)->data; - if (is_null($pref)) { + if (null === $pref) { throw new FireflyException('Cannot determine bunq server public key, but should have it at this point.'); } @@ -721,8 +719,6 @@ class BunqRoutine implements RoutineInterface // set status to "finished"? // update job: $this->setStatus('finished'); - - return; } /** @@ -778,7 +774,7 @@ class BunqRoutine implements RoutineInterface // we really have to quit at this point :( throw new FireflyException($e->getMessage()); } - if (is_null($deviceServerId)) { + if (null === $deviceServerId) { throw new FireflyException('Was not able to register server with bunq. Please see the log files.'); } @@ -881,8 +877,6 @@ class BunqRoutine implements RoutineInterface // update job, set status to "configuring". $this->setStatus('configuring'); $this->addStep(); - - return; } /** @@ -893,8 +887,6 @@ class BunqRoutine implements RoutineInterface private function setConfig(array $config): void { $this->repository->setConfiguration($this->job, $config); - - return; } /** @@ -905,8 +897,6 @@ class BunqRoutine implements RoutineInterface private function setExtendedStatus(array $extended): void { $this->repository->setExtendedStatus($this->job, $extended); - - return; } /** diff --git a/app/Import/Routine/SpectreRoutine.php b/app/Import/Routine/SpectreRoutine.php index 9f035fc4ea..55aee3e111 100644 --- a/app/Import/Routine/SpectreRoutine.php +++ b/app/Import/Routine/SpectreRoutine.php @@ -24,13 +24,13 @@ namespace FireflyIII\Import\Routine; use Carbon\Carbon; use DB; +use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Import\Object\ImportJournal; use FireflyIII\Import\Storage\ImportStorage; use FireflyIII\Models\ImportJob; use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface; use FireflyIII\Repositories\Tag\TagRepositoryInterface; -use FireflyIII\Services\Spectre\Exception\DuplicatedCustomerException; use FireflyIII\Services\Spectre\Exception\SpectreException; use FireflyIII\Services\Spectre\Object\Account; use FireflyIII\Services\Spectre\Object\Customer; @@ -179,11 +179,11 @@ class SpectreRoutine implements RoutineInterface try { $newCustomerRequest->call(); $customer = $newCustomerRequest->getCustomer(); - } catch (DuplicatedCustomerException $e) { + } catch (Exception $e) { // already exists, must fetch customer instead. - Log::warning('Customer exists already for user, fetch it.'); + Log::warning(sprintf('Customer exists already for user, fetch it: %s', $e->getMessage())); } - if (is_null($customer)) { + if (null === $customer) { $getCustomerRequest = new ListCustomersRequest($this->job->user); $getCustomerRequest->call(); $customers = $getCustomerRequest->getCustomers(); @@ -211,7 +211,7 @@ class SpectreRoutine implements RoutineInterface protected function getCustomer(): Customer { $config = $this->getConfig(); - if (!is_null($config['customer'])) { + if (null !== $config['customer']) { $customer = new Customer($config['customer']); return $customer; @@ -306,13 +306,13 @@ class SpectreRoutine implements RoutineInterface /** @var Login $login */ foreach ($logins as $login) { $attempt = $login->getLastAttempt(); - $attemptTime = intval($attempt->getCreatedAt()->format('U')); - if ($attemptTime > $time && is_null($attempt->getFailErrorClass())) { + $attemptTime = (int)$attempt->getCreatedAt()->format('U'); + if ($attemptTime > $time && null === $attempt->getFailErrorClass()) { $time = $attemptTime; $final = $login; } } - if (is_null($final)) { + if (null === $final) { Log::error('Could not find a valid login for this user.'); $this->repository->addError($this->job, 0, 'Spectre connection failed. Did you use invalid credentials, press Cancel or failed the 2FA challenge?'); $this->repository->setStatus($this->job, 'error'); @@ -420,8 +420,8 @@ class SpectreRoutine implements RoutineInterface } $extra = $transaction->getExtra()->toArray(); $notes = ''; - $notes .= strval(trans('import.imported_from_account', ['account' => $account->getName()])) . ' ' - . "\n"; // double space for newline in Markdown. + // double space for newline in Markdown. + $notes .= (string)trans('import.imported_from_account', ['account' => $account->getName()]) . ' ' . "\n"; foreach ($extra as $key => $value) { switch ($key) { @@ -535,8 +535,8 @@ class SpectreRoutine implements RoutineInterface /** @var array $accountArray */ foreach ($accounts as $accountArray) { $account = new Account($accountArray); - $importId = intval($config['accounts-mapped'][$account->getId()] ?? 0); - $doImport = 0 !== $importId ? true : false; + $importId = (int)($config['accounts-mapped'][$account->getId()] ?? 0.0); + $doImport = 0 !== $importId; if (!$doImport) { Log::debug(sprintf('Will NOT import from Spectre account #%d ("%s")', $account->getId(), $account->getName())); continue; diff --git a/app/Import/Storage/ImportStorage.php b/app/Import/Storage/ImportStorage.php index 619e77d768..9c3f941505 100644 --- a/app/Import/Storage/ImportStorage.php +++ b/app/Import/Storage/ImportStorage.php @@ -22,7 +22,6 @@ declare(strict_types=1); namespace FireflyIII\Import\Storage; -use ErrorException; use Exception; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Factory\TransactionJournalFactory; @@ -160,7 +159,7 @@ class ImportStorage try { $this->storeImportJournal($index, $importJournal); $this->addStep(); - } catch (FireflyException | ErrorException | Exception $e) { + } catch (Exception $e) { $this->errors->push($e->getMessage()); Log::error(sprintf('Cannot import row #%d because: %s', $index, $e->getMessage())); Log::error($e->getTraceAsString()); @@ -239,7 +238,7 @@ class ImportStorage 'description' => $importJournal->getDescription(), 'piggy_bank_id' => null, 'piggy_bank_name' => null, - 'bill_id' => is_null($bill) ? null : $bill->id, + 'bill_id' => null === $bill ? null : $bill->id, 'bill_name' => null, 'tags' => $importJournal->tags, 'interest_date' => $importJournal->getMetaDate('interest_date'), @@ -262,14 +261,14 @@ class ImportStorage [ 'description' => null, 'amount' => $amount, - 'currency_id' => intval($currencyId), + 'currency_id' => (int)$currencyId, 'currency_code' => null, 'foreign_amount' => $foreignAmount, 'foreign_currency_id' => $foreignCurrencyId, 'foreign_currency_code' => null, - 'budget_id' => is_null($budget) ? null : $budget->id, + 'budget_id' => null === $budget ? null : $budget->id, 'budget_name' => null, - 'category_id' => is_null($category) ? null : $category->id, + 'category_id' => null === $category ? null : $category->id, 'category_name' => null, 'source_id' => $source->id, 'source_name' => null, diff --git a/app/Import/Storage/ImportSupport.php b/app/Import/Storage/ImportSupport.php index a1bf25557b..ddcb5fa1f6 100644 --- a/app/Import/Storage/ImportSupport.php +++ b/app/Import/Storage/ImportSupport.php @@ -91,7 +91,7 @@ trait ImportSupport */ protected function matchBills(TransactionJournal $journal): bool { - if (!is_null($journal->bill_id)) { + if (null !== $journal->bill_id) { Log::debug('Journal is already linked to a bill, will not scan.'); return true; @@ -134,7 +134,7 @@ trait ImportSupport { // start with currency pref of account, if any: $account = $importJournal->asset->getAccount(); - $currencyId = intval($account->getMeta('currency_id')); + $currencyId = (int)$account->getMeta('currency_id'); if ($currencyId > 0) { return $currencyId; } @@ -166,7 +166,7 @@ trait ImportSupport { // use given currency by import journal. $currency = $importJournal->foreignCurrency->getTransactionCurrency(); - if (null !== $currency && intval($currency->id) !== intval($currencyId)) { + if (null !== $currency && (int)$currency->id !== (int)$currencyId) { return $currency->id; } @@ -206,9 +206,7 @@ trait ImportSupport // amount is positive, it's a deposit, opposing is an revenue: $account->setExpectedType(AccountType::REVENUE); - $databaseAccount = $account->getAccount(); - - return $databaseAccount; + return $account->getAccount(); } /** @@ -280,7 +278,6 @@ trait ImportSupport * is not already present. * * @return array - * @throws \InvalidArgumentException */ private function getTransfers(): array { diff --git a/app/Models/Account.php b/app/Models/Account.php index cf1e6131ba..d799551c0e 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -32,14 +32,13 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Query\JoinClause; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Watson\Validating\ValidatingTrait; /** * Class Account. */ class Account extends Model { - use SoftDeletes, ValidatingTrait; + use SoftDeletes; /** * The attributes that should be casted to native types. @@ -58,17 +57,6 @@ class Account extends Model protected $fillable = ['user_id', 'account_type_id', 'name', 'active', 'virtual_balance', 'iban']; /** @var array */ protected $hidden = ['encrypted']; - /** - * @var array - */ - protected $rules - = [ - 'user_id' => 'required|exists:users,id', - 'account_type_id' => 'required|exists:account_types,id', - 'name' => 'required|between:1,200', - 'active' => 'required|boolean', - 'iban' => 'between:1,50|iban', - ]; /** @var bool */ private $joinedAccountTypes; @@ -77,6 +65,8 @@ class Account extends Model * * @return Account * + * @deprecated + * * @throws FireflyException */ public static function firstOrCreateEncrypted(array $fields) @@ -121,9 +111,9 @@ class Account extends Model public static function routeBinder(string $value): Account { if (auth()->check()) { - $accountId = intval($value); + $accountId = (int)$value; $account = auth()->user()->accounts()->find($accountId); - if (!is_null($account)) { + if (null !== $account) { return $account; } } @@ -172,7 +162,7 @@ class Account extends Model */ public function getIbanAttribute($value): string { - if (null === $value || 0 === strlen(strval($value))) { + if (null === $value || 0 === strlen((string)$value)) { return ''; } try { @@ -191,6 +181,7 @@ class Account extends Model * @codeCoverageIgnore * * @param string $fieldName + * * @deprecated * @return string */ @@ -198,7 +189,7 @@ class Account extends Model { foreach ($this->accountMeta as $meta) { if ($meta->name === $fieldName) { - return strval($meta->data); + return (string)$meta->data; } } @@ -281,7 +272,6 @@ class Account extends Model * @param string $name * @param string $value * - * @throws \InvalidArgumentException */ public function scopeHasMetaValue(EloquentBuilder $query, $name, $value) { @@ -312,6 +302,7 @@ class Account extends Model * @codeCoverageIgnore * * @param $value + * * @throws \Illuminate\Contracts\Encryption\EncryptException */ public function setNameAttribute($value) @@ -330,7 +321,7 @@ class Account extends Model */ public function setVirtualBalanceAttribute($value) { - $this->attributes['virtual_balance'] = strval($value); + $this->attributes['virtual_balance'] = (string)$value; } /** diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index 9ef2343d09..3e6c3e81be 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -60,9 +60,9 @@ class Attachment extends Model public static function routeBinder(string $value): Attachment { if (auth()->check()) { - $attachmentId = intval($value); + $attachmentId = (int)$value; $attachment = auth()->user()->attachments()->find($attachmentId); - if (!is_null($attachment)) { + if (null !== $attachment) { return $attachment; } } @@ -89,7 +89,7 @@ class Attachment extends Model */ public function fileName(): string { - return sprintf('at-%s.data', strval($this->id)); + return sprintf('at-%s.data', (string)$this->id); } /** @@ -181,6 +181,7 @@ class Attachment extends Model * @codeCoverageIgnore * * @param string $value + * * @throws \Illuminate\Contracts\Encryption\EncryptException */ public function setFilenameAttribute(string $value) @@ -192,6 +193,7 @@ class Attachment extends Model * @codeCoverageIgnore * * @param string $value + * * @throws \Illuminate\Contracts\Encryption\EncryptException */ public function setMimeAttribute(string $value) @@ -203,6 +205,7 @@ class Attachment extends Model * @codeCoverageIgnore * * @param string $value + * * @throws \Illuminate\Contracts\Encryption\EncryptException */ public function setTitleAttribute(string $value) diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 823f39b426..10b240f9c8 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -28,14 +28,13 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Watson\Validating\ValidatingTrait; /** * Class Bill. */ class Bill extends Model { - use SoftDeletes, ValidatingTrait; + use SoftDeletes; /** * The attributes that should be casted to native types. * @@ -63,10 +62,6 @@ class Bill extends Model * @var array */ protected $hidden = ['amount_min_encrypted', 'amount_max_encrypted', 'name_encrypted', 'match_encrypted']; - /** - * @var array - */ - protected $rules = ['name' => 'required|between:1,200']; /** * @param string $value @@ -77,9 +72,9 @@ class Bill extends Model public static function routeBinder(string $value): Bill { if (auth()->check()) { - $billId = intval($value); + $billId = (int)$value; $bill = auth()->user()->bills()->find($billId); - if (!is_null($bill)) { + if (null !== $bill) { return $bill; } } @@ -105,7 +100,7 @@ class Bill extends Model */ public function getMatchAttribute($value) { - if (1 === intval($this->match_encrypted)) { + if (1 === (int)$this->match_encrypted) { return Crypt::decrypt($value); } @@ -122,7 +117,7 @@ class Bill extends Model */ public function getNameAttribute($value) { - if (1 === intval($this->name_encrypted)) { + if (1 === (int)$this->name_encrypted) { return Crypt::decrypt($value); } @@ -145,7 +140,7 @@ class Bill extends Model */ public function setAmountMaxAttribute($value) { - $this->attributes['amount_max'] = strval($value); + $this->attributes['amount_max'] = (string)$value; } /** @@ -155,7 +150,7 @@ class Bill extends Model */ public function setAmountMinAttribute($value) { - $this->attributes['amount_min'] = strval($value); + $this->attributes['amount_min'] = (string)$value; } /** diff --git a/app/Models/Budget.php b/app/Models/Budget.php index 7d4a833322..2ef3a9ded5 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -27,14 +27,13 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Watson\Validating\ValidatingTrait; /** * Class Budget. */ class Budget extends Model { - use SoftDeletes, ValidatingTrait; + use SoftDeletes; /** * The attributes that should be casted to native types. @@ -53,12 +52,11 @@ class Budget extends Model protected $fillable = ['user_id', 'name', 'active']; /** @var array */ protected $hidden = ['encrypted']; - /** @var array */ - protected $rules = ['name' => 'required|between:1,200']; /** * @param array $fields * + * @deprecated * @return Budget */ public static function firstOrCreateEncrypted(array $fields) @@ -92,9 +90,9 @@ class Budget extends Model public static function routeBinder(string $value): Budget { if (auth()->check()) { - $budgetId = intval($value); + $budgetId = (int)$value; $budget = auth()->user()->budgets()->find($budgetId); - if (!is_null($budget)) { + if (null !== $budget) { return $budget; } } diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index 8063df7936..4a1070f876 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -53,12 +53,12 @@ class BudgetLimit extends Model public static function routeBinder(string $value): BudgetLimit { if (auth()->check()) { - $budgetLimitId = intval($value); + $budgetLimitId = (int)$value; $budgetLimit = self::where('budget_limits.id', $budgetLimitId) ->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id') ->where('budgets.user_id', auth()->user()->id) ->first(['budget_limits.*']); - if (!is_null($budgetLimit)) { + if (null !== $budgetLimit) { return $budgetLimit; } } @@ -81,6 +81,6 @@ class BudgetLimit extends Model */ public function setAmountAttribute($value) { - $this->attributes['amount'] = strval(round($value, 12)); + $this->attributes['amount'] = (string)round($value, 12); } } diff --git a/app/Models/Category.php b/app/Models/Category.php index f946d8bcdb..85a68a5cdd 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -27,14 +27,13 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Watson\Validating\ValidatingTrait; /** * Class Category. */ class Category extends Model { - use SoftDeletes, ValidatingTrait; + use SoftDeletes; /** * The attributes that should be casted to native types. @@ -52,12 +51,11 @@ class Category extends Model protected $fillable = ['user_id', 'name']; /** @var array */ protected $hidden = ['encrypted']; - /** @var array */ - protected $rules = ['name' => 'required|between:1,200']; /** * @param array $fields * + * @deprecated * @return Category */ public static function firstOrCreateEncrypted(array $fields) @@ -91,9 +89,9 @@ class Category extends Model public static function routeBinder(string $value): Category { if (auth()->check()) { - $categoryId = intval($value); + $categoryId = (int)$value; $category = auth()->user()->categories()->find($categoryId); - if (!is_null($category)) { + if (null !== $category) { return $category; } } diff --git a/app/Models/ImportJob.php b/app/Models/ImportJob.php index 70315a5c6b..84364547e1 100644 --- a/app/Models/ImportJob.php +++ b/app/Models/ImportJob.php @@ -139,7 +139,7 @@ class ImportJob extends Model */ public function getExtendedStatusAttribute($value) { - if (0 === strlen(strval($value))) { + if (0 === strlen((string)$value)) { return []; } diff --git a/app/Models/LinkType.php b/app/Models/LinkType.php index 143e30f4e6..04dd71f3aa 100644 --- a/app/Models/LinkType.php +++ b/app/Models/LinkType.php @@ -57,7 +57,7 @@ class LinkType extends Model public static function routeBinder(string $value): LinkType { if (auth()->check()) { - $linkTypeId = intval($value); + $linkTypeId = (int)$value; $linkType = self::find($linkTypeId); if (null !== $linkType) { return $linkType; diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php index af6461ca30..ce24a63b30 100644 --- a/app/Models/PiggyBank.php +++ b/app/Models/PiggyBank.php @@ -69,11 +69,11 @@ class PiggyBank extends Model public static function routeBinder(string $value): PiggyBank { if (auth()->check()) { - $piggyBankId = intval($value); + $piggyBankId = (int)$value; $piggyBank = self::where('piggy_banks.id', $piggyBankId) ->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id') ->where('accounts.user_id', auth()->user()->id)->first(['piggy_banks.*']); - if (!is_null($piggyBank)) { + if (null !== $piggyBank) { return $piggyBank; } } @@ -142,7 +142,7 @@ class PiggyBank extends Model // more than 1 month to go and still need money to save: if ($diffInMonths > 0 && 1 === bccomp($remainingAmount, '0')) { - $savePerMonth = bcdiv($remainingAmount, strval($diffInMonths)); + $savePerMonth = bcdiv($remainingAmount, (string)$diffInMonths); } // less than 1 month to go but still need money to save: @@ -221,6 +221,6 @@ class PiggyBank extends Model */ public function setTargetamountAttribute($value) { - $this->attributes['targetamount'] = strval($value); + $this->attributes['targetamount'] = (string)$value; } } diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php index 4da33d1726..3dec5e720c 100644 --- a/app/Models/PiggyBankEvent.php +++ b/app/Models/PiggyBankEvent.php @@ -69,7 +69,7 @@ class PiggyBankEvent extends Model */ public function setAmountAttribute($value) { - $this->attributes['amount'] = strval($value); + $this->attributes['amount'] = (string)$value; } /** diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php index af65867865..4b3d98a3b6 100644 --- a/app/Models/PiggyBankRepetition.php +++ b/app/Models/PiggyBankRepetition.php @@ -103,6 +103,6 @@ class PiggyBankRepetition extends Model */ public function setCurrentamountAttribute($value) { - $this->attributes['currentamount'] = strval($value); + $this->attributes['currentamount'] = (string)$value; } } diff --git a/app/Models/Preference.php b/app/Models/Preference.php index 757e25ae42..7c3cae0da9 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -59,6 +59,7 @@ class Preference extends Model */ public function getDataAttribute($value) { + $result = null; try { $data = Crypt::decrypt($value); } catch (DecryptException $e) { @@ -67,17 +68,21 @@ class Preference extends Model sprintf('Could not decrypt preference #%d. If this error persists, please run "php artisan cache:clear" on the command line.', $this->id) ); } - $unserialized = false; + $serialized = true; try { - $unserialized = unserialize($data); + unserialize($data, ['allowed_classes' => false]); } catch (Exception $e) { - // don't care, assume is false. + $serialized = false; + Log::debug(sprintf('Could not unserialise preference #%d. This is good. %s', $this->id, $e->getMessage())); } - if (!(false === $unserialized)) { - return $unserialized; + if (!$serialized) { + $result = json_decode($data, true); + } + if ($serialized) { + Log::error(sprintf('Preference #%d ("%s") was stored as serialised object. It will be deleted and recreated.', $this->id, $this->name)); } - return json_decode($data, true); + return $result; } /** @@ -89,7 +94,7 @@ class Preference extends Model */ public function setDataAttribute($value) { - $this->attributes['data'] = Crypt::encrypt(serialize($value)); + $this->attributes['data'] = Crypt::encrypt(json_encode($value)); } /** diff --git a/app/Models/Rule.php b/app/Models/Rule.php index a7be9798ac..3d4eec456a 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -57,9 +57,9 @@ class Rule extends Model public static function routeBinder(string $value): Rule { if (auth()->check()) { - $ruleId = intval($value); + $ruleId = (int)$value; $rule = auth()->user()->rules()->find($ruleId); - if (!is_null($rule)) { + if (null !== $rule) { return $rule; } } diff --git a/app/Models/RuleGroup.php b/app/Models/RuleGroup.php index 0345afb535..d9355a24a6 100644 --- a/app/Models/RuleGroup.php +++ b/app/Models/RuleGroup.php @@ -60,9 +60,9 @@ class RuleGroup extends Model public static function routeBinder(string $value): RuleGroup { if (auth()->check()) { - $ruleGroupId = intval($value); + $ruleGroupId = (int)$value; $ruleGroup = auth()->user()->ruleGroups()->find($ruleGroupId); - if (!is_null($ruleGroup)) { + if (null !== $ruleGroup) { return $ruleGroup; } } diff --git a/app/Models/Tag.php b/app/Models/Tag.php index 8ff2aefe35..8c4b93d36e 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -26,14 +26,13 @@ use Crypt; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Watson\Validating\ValidatingTrait; /** * Class Tag. */ class Tag extends Model { - use ValidatingTrait, SoftDeletes; + use SoftDeletes; /** * The attributes that should be casted to native types. @@ -52,12 +51,11 @@ class Tag extends Model protected $dates = ['date']; /** @var array */ protected $fillable = ['user_id', 'tag', 'date', 'description', 'longitude', 'latitude', 'zoomLevel', 'tagMode']; - /** @var array */ - protected $rules = ['tag' => 'required|between:1,200']; /** * @param array $fields * + * @deprecated * @return Tag|null */ public static function firstOrCreateEncrypted(array $fields) @@ -95,9 +93,9 @@ class Tag extends Model public static function routeBinder(string $value): Tag { if (auth()->check()) { - $tagId = intval($value); + $tagId = (int)$value; $tag = auth()->user()->tags()->find($tagId); - if (!is_null($tag)) { + if (null !== $tag) { return $tag; } } @@ -154,6 +152,7 @@ class Tag extends Model * @codeCoverageIgnore * * @param $value + * * @throws \Illuminate\Contracts\Encryption\EncryptException */ public function setTagAttribute($value) diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 6e4a004b6b..77ba6c8b1d 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -27,7 +27,6 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Watson\Validating\ValidatingTrait; /** * Class Transaction. @@ -98,17 +97,6 @@ class Transaction extends Model * @var array */ protected $hidden = ['encrypted']; - /** - * @var array - */ - protected $rules - = [ - 'account_id' => 'required|exists:accounts,id', - 'transaction_journal_id' => 'required|exists:transaction_journals,id', - 'transaction_currency_id' => 'required|exists:transaction_currencies,id', - 'description' => 'between:0,1024', - 'amount' => 'required|numeric', - ]; /** * @codeCoverageIgnore @@ -142,10 +130,10 @@ class Transaction extends Model public static function routeBinder(string $value): Transaction { if (auth()->check()) { - $transactionId = intval($value); + $transactionId = (int)$value; $transaction = auth()->user()->transactions()->where('transactions.id', $transactionId) ->first(['transactions.*']); - if (!is_null($transaction)) { + if (null !== $transaction) { return $transaction; } } @@ -153,7 +141,7 @@ class Transaction extends Model throw new NotFoundHttpException; } - use SoftDeletes, ValidatingTrait; + use SoftDeletes; /** * @codeCoverageIgnore @@ -256,7 +244,7 @@ class Transaction extends Model */ public function setAmountAttribute($value) { - $this->attributes['amount'] = strval($value); + $this->attributes['amount'] = (string)$value; } /** diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php index ec3dc40db4..afbddc2012 100644 --- a/app/Models/TransactionCurrency.php +++ b/app/Models/TransactionCurrency.php @@ -62,9 +62,9 @@ class TransactionCurrency extends Model public static function routeBinder(string $value): TransactionCurrency { if (auth()->check()) { - $currencyId = intval($value); + $currencyId = (int)$value; $currency = self::find($currencyId); - if (!is_null($currency)) { + if (null !== $currency) { return $currency; } } diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 5842d765c4..acfbb2ef75 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -35,7 +35,6 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Log; use Preferences; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Watson\Validating\ValidatingTrait; /** * Class TransactionJournal. @@ -44,7 +43,7 @@ use Watson\Validating\ValidatingTrait; */ class TransactionJournal extends Model { - use SoftDeletes, ValidatingTrait, TransactionJournalTrait; + use SoftDeletes, TransactionJournalTrait; /** * The attributes that should be casted to native types. @@ -73,16 +72,6 @@ class TransactionJournal extends Model 'date', 'rent_date', 'encrypted', 'tag_count',]; /** @var array */ protected $hidden = ['encrypted']; - /** @var array */ - protected $rules - = [ - 'user_id' => 'required|exists:users,id', - 'transaction_type_id' => 'required|exists:transaction_types,id', - 'description' => 'required|between:1,1024', - 'completed' => 'required|boolean', - 'date' => 'required|date', - 'encrypted' => 'required|boolean', - ]; /** * @param string $value @@ -93,10 +82,10 @@ class TransactionJournal extends Model public static function routeBinder(string $value): TransactionJournal { if (auth()->check()) { - $journalId = intval($value); + $journalId = (int)$value; $journal = auth()->user()->transactionJournals()->where('transaction_journals.id', $journalId) ->first(['transaction_journals.*']); - if (!is_null($journal)) { + if (null !== $journal) { return $journal; } } @@ -143,6 +132,7 @@ class TransactionJournal extends Model /** * @codeCoverageIgnore * @deprecated + * * @param string $name * * @return bool @@ -222,6 +212,7 @@ class TransactionJournal extends Model * @codeCoverageIgnore * * @param string $name + * * @deprecated * @return bool */ diff --git a/app/Models/TransactionJournalLink.php b/app/Models/TransactionJournalLink.php index 0675b5ce07..6b9d1afd46 100644 --- a/app/Models/TransactionJournalLink.php +++ b/app/Models/TransactionJournalLink.php @@ -47,14 +47,14 @@ class TransactionJournalLink extends Model public static function routeBinder(string $value): TransactionJournalLink { if (auth()->check()) { - $linkId = intval($value); + $linkId = (int)$value; $link = self::where('journal_links.id', $linkId) ->leftJoin('transaction_journals as t_a', 't_a.id', '=', 'source_id') ->leftJoin('transaction_journals as t_b', 't_b.id', '=', 'destination_id') ->where('t_a.user_id', auth()->user()->id) ->where('t_b.user_id', auth()->user()->id) ->first(['journal_links.*']); - if (!is_null($link)) { + if (null !== $link) { return $link; } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 7fafc5d844..14a2965912 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -22,8 +22,13 @@ declare(strict_types=1); namespace FireflyIII\Providers; +use FireflyIII\Events\AdminRequestedTestMessage; use FireflyIII\Events\RegisteredUser; +use FireflyIII\Events\RequestedNewPassword; use FireflyIII\Events\RequestedVersionCheckStatus; +use FireflyIII\Events\StoredTransactionJournal; +use FireflyIII\Events\UpdatedTransactionJournal; +use FireflyIII\Events\UserChangedEmail; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBankRepetition; use Illuminate\Auth\Events\Login; @@ -43,39 +48,39 @@ class EventServiceProvider extends ServiceProvider protected $listen = [ // is a User related event. - RegisteredUser::class => [ + RegisteredUser::class => [ 'FireflyIII\Handlers\Events\UserEventHandler@sendRegistrationMail', 'FireflyIII\Handlers\Events\UserEventHandler@attachUserRole', ], // is a User related event. - Login::class => [ + Login::class => [ 'FireflyIII\Handlers\Events\UserEventHandler@checkSingleUserIsAdmin', ], - RequestedVersionCheckStatus::class => [ + RequestedVersionCheckStatus::class => [ 'FireflyIII\Handlers\Events\VersionCheckEventHandler@checkForUpdates', ], // is a User related event. - 'FireflyIII\Events\RequestedNewPassword' => [ + RequestedNewPassword::class => [ 'FireflyIII\Handlers\Events\UserEventHandler@sendNewPassword', ], // is a User related event. - 'FireflyIII\Events\UserChangedEmail' => [ + UserChangedEmail::class => [ 'FireflyIII\Handlers\Events\UserEventHandler@sendEmailChangeConfirmMail', 'FireflyIII\Handlers\Events\UserEventHandler@sendEmailChangeUndoMail', ], // admin related - 'FireflyIII\Events\AdminRequestedTestMessage' => [ + AdminRequestedTestMessage::class => [ 'FireflyIII\Handlers\Events\AdminEventHandler@sendTestMessage', ], // is a Transaction Journal related event. - 'FireflyIII\Events\StoredTransactionJournal' => [ + StoredTransactionJournal::class => [ 'FireflyIII\Handlers\Events\StoredJournalEventHandler@scanBills', 'FireflyIII\Handlers\Events\StoredJournalEventHandler@processRules', ], // is a Transaction Journal related event. - 'FireflyIII\Events\UpdatedTransactionJournal' => [ + UpdatedTransactionJournal::class => [ 'FireflyIII\Handlers\Events\UpdatedJournalEventHandler@scanBills', 'FireflyIII\Handlers\Events\UpdatedJournalEventHandler@processRules', ], diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index f15114ac3c..3a633a4789 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -40,14 +40,6 @@ class RouteServiceProvider extends ServiceProvider */ protected $namespace = ''; - /** - * Define your route model bindings, pattern filters, etc. - */ - public function boot() - { - parent::boot(); - } - /** * Define the routes for the application. */ diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index ca37c54489..6b8551bc91 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -50,9 +50,7 @@ class AccountRepository implements AccountRepositoryInterface */ public function count(array $types): int { - $count = $this->user->accounts()->accountTypeIn($types)->count(); - - return $count; + return $this->user->accounts()->accountTypeIn($types)->count(); } /** @@ -63,7 +61,7 @@ class AccountRepository implements AccountRepositoryInterface * * @return bool * - * @throws \Exception + */ public function destroy(Account $account, ?Account $moveTo): bool { @@ -108,7 +106,7 @@ class AccountRepository implements AccountRepositoryInterface { foreach ($account->accountMeta as $meta) { if ($meta->name === $field) { - return strval($meta->data); + return (string)$meta->data; } } @@ -135,7 +133,7 @@ class AccountRepository implements AccountRepositoryInterface public function getNoteText(Account $account): ?string { $note = $account->notes()->first(); - if (is_null($note)) { + if (null === $note) { return null; } @@ -164,7 +162,7 @@ class AccountRepository implements AccountRepositoryInterface return null; } - return strval($transaction->amount); + return (string)$transaction->amount; } /** @@ -227,7 +225,7 @@ class AccountRepository implements AccountRepositoryInterface ->orderBy('transaction_journals.id', 'ASC') ->first(['transaction_journals.id']); if (null !== $first) { - return TransactionJournal::find(intval($first->id)); + return TransactionJournal::find((int)$first->id); } return new TransactionJournal(); @@ -272,9 +270,8 @@ class AccountRepository implements AccountRepositoryInterface /** @var AccountFactory $factory */ $factory = app(AccountFactory::class); $factory->setUser($this->user); - $account = $factory->create($data); - return $account; + return $factory->create($data); } /** diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php index c032724f32..2c7b14259e 100644 --- a/app/Repositories/Account/AccountTasker.php +++ b/app/Repositories/Account/AccountTasker.php @@ -130,7 +130,7 @@ class AccountTasker implements AccountTaskerInterface // Obtain a list of columns $sum = []; foreach ($expenses as $accountId => $row) { - $sum[$accountId] = floatval($row['sum']); + $sum[$accountId] = (float)$row['sum']; } array_multisort($sum, SORT_ASC, $expenses); @@ -172,7 +172,7 @@ class AccountTasker implements AccountTaskerInterface // Obtain a list of columns $sum = []; foreach ($income as $accountId => $row) { - $sum[$accountId] = floatval($row['sum']); + $sum[$accountId] = (float)$row['sum']; } array_multisort($sum, SORT_DESC, $income); @@ -216,7 +216,7 @@ class AccountTasker implements AccountTaskerInterface $keys = array_keys($expenses); foreach ($keys as $key) { if ($expenses[$key]['count'] > 1) { - $expenses[$key]['average'] = bcdiv($expenses[$key]['sum'], strval($expenses[$key]['count'])); + $expenses[$key]['average'] = bcdiv($expenses[$key]['sum'], (string)$expenses[$key]['count']); } } diff --git a/app/Repositories/Account/FindAccountsTrait.php b/app/Repositories/Account/FindAccountsTrait.php index a8e393631a..cf36898a51 100644 --- a/app/Repositories/Account/FindAccountsTrait.php +++ b/app/Repositories/Account/FindAccountsTrait.php @@ -251,9 +251,8 @@ trait FindAccountsTrait /** @var AccountFactory $factory */ $factory = app(AccountFactory::class); $factory->setUser($this->user); - $account = $factory->findOrCreate('Cash account', $type->type); - return $account; + return $factory->findOrCreate('Cash account', $type->type); } /** @@ -262,7 +261,6 @@ trait FindAccountsTrait * @return Account|null * * @throws FireflyException - * @throws \Exception */ public function getReconciliation(Account $account): ?Account { @@ -272,10 +270,10 @@ trait FindAccountsTrait $name = $account->name . ' reconciliation'; $type = AccountType::where('type', AccountType::RECONCILIATION)->first(); $accounts = $this->user->accounts()->where('account_type_id', $type->id)->get(); - /** @var Account $account */ - foreach ($accounts as $account) { - if ($account->name === $name) { - return $account; + /** @var Account $current */ + foreach ($accounts as $current) { + if ($current->name === $name) { + return $current; } } /** @var AccountFactory $factory */ diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php index 48da0f6ee9..5e4c913822 100644 --- a/app/Repositories/Attachment/AttachmentRepository.php +++ b/app/Repositories/Attachment/AttachmentRepository.php @@ -45,7 +45,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface * * @return bool * - * @throws \Exception + */ public function destroy(Attachment $attachment): bool { @@ -165,8 +165,8 @@ class AttachmentRepository implements AttachmentRepositoryInterface public function getNoteText(Attachment $attachment): ?string { $note = $attachment->notes()->first(); - if (!is_null($note)) { - return strval($note->text); + if (null !== $note) { + return (string)$note->text; } return null; diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 11055dcafe..e8d64aea43 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -52,7 +52,7 @@ class BillRepository implements BillRepositoryInterface * * @return bool * - * @throws \Exception + */ public function destroy(Bill $bill): bool { @@ -72,10 +72,7 @@ class BillRepository implements BillRepositoryInterface */ public function find(int $billId): ?Bill { - /** @var Bill $res */ - $res = $this->user->bills()->find($billId); - - return $res; + return $this->user->bills()->find($billId); } /** @@ -136,7 +133,6 @@ class BillRepository implements BillRepositoryInterface * @param Collection $accounts * * @return Collection - * @throws \InvalidArgumentException */ public function getBillsForAccounts(Collection $accounts): Collection { @@ -206,7 +202,7 @@ class BillRepository implements BillRepositoryInterface $set = $bill->transactionJournals()->after($start)->before($end)->get(['transaction_journals.*']); if ($set->count() > 0) { $journalIds = $set->pluck('id')->toArray(); - $amount = strval(Transaction::whereIn('transaction_journal_id', $journalIds)->where('amount', '<', 0)->sum('amount')); + $amount = (string)Transaction::whereIn('transaction_journal_id', $journalIds)->where('amount', '<', 0)->sum('amount'); $sum = bcadd($sum, $amount); Log::debug(sprintf('Total > 0, so add to sum %f, which becomes %f', $amount, $sum)); } @@ -238,7 +234,7 @@ class BillRepository implements BillRepositoryInterface if ($total > 0) { $average = bcdiv(bcadd($bill->amount_max, $bill->amount_min), '2'); - $multi = bcmul($average, strval($total)); + $multi = bcmul($average, (string)$total); $sum = bcadd($sum, $multi); Log::debug(sprintf('Total > 0, so add to sum %f, which becomes %f', $multi, $sum)); } @@ -259,7 +255,7 @@ class BillRepository implements BillRepositoryInterface $repos->setUser($this->user); $journals = $bill->transactionJournals()->get(); $sum = '0'; - $count = strval($journals->count()); + $count = (string)$journals->count(); /** @var TransactionJournal $journal */ foreach ($journals as $journal) { $sum = bcadd($sum, $repos->getJournalTotal($journal)); @@ -276,7 +272,6 @@ class BillRepository implements BillRepositoryInterface * @param int $size * * @return LengthAwarePaginator - * @throws \InvalidArgumentException */ public function getPaginator(int $size): LengthAwarePaginator { @@ -389,7 +384,7 @@ class BillRepository implements BillRepositoryInterface ->where('date', '<=', $date->year . '-12-31 23:59:59') ->get(); $sum = '0'; - $count = strval($journals->count()); + $count = (string)$journals->count(); /** @var TransactionJournal $journal */ foreach ($journals as $journal) { $sum = bcadd($sum, $repos->getJournalTotal($journal)); @@ -508,8 +503,8 @@ class BillRepository implements BillRepositoryInterface $sourceAccounts = $repos->getJournalDestinationAccounts($journal); $matches = explode(',', $bill->match); $description = strtolower($journal->description) . ' '; - $description .= strtolower(join(' ', $destinationAccounts->pluck('name')->toArray())); - $description .= strtolower(join(' ', $sourceAccounts->pluck('name')->toArray())); + $description .= strtolower(implode(' ', $destinationAccounts->pluck('name')->toArray())); + $description .= strtolower(implode(' ', $sourceAccounts->pluck('name')->toArray())); $wordMatch = $this->doWordMatch($matches, $description); $amountMatch = $this->doAmountMatch($repos->getJournalTotal($journal), $bill->amount_min, $bill->amount_max); @@ -550,10 +545,8 @@ class BillRepository implements BillRepositoryInterface /** @var BillFactory $factory */ $factory = app(BillFactory::class); $factory->setUser($this->user); - $bill = $factory->create($data); - - return $bill; + return $factory->create($data); } /** @@ -579,11 +572,7 @@ class BillRepository implements BillRepositoryInterface */ protected function doAmountMatch($amount, $min, $max): bool { - if ($amount >= $min && $amount <= $max) { - return true; - } - - return false; + return $amount >= $min && $amount <= $max; } /** diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 7df0701e48..41bef35866 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -61,15 +61,15 @@ class BudgetRepository implements BudgetRepositoryInterface $total = '0'; $count = 0; foreach ($budget->budgetlimits as $limit) { - $diff = strval($limit->start_date->diffInDays($limit->end_date)); - $amount = strval($limit->amount); + $diff = (string)$limit->start_date->diffInDays($limit->end_date); + $amount = (string)$limit->amount; $perDay = bcdiv($amount, $diff); $total = bcadd($total, $perDay); $count++; } $avg = $total; if ($count > 0) { - $avg = bcdiv($total, strval($count)); + $avg = bcdiv($total, (string)$count); } return $avg; @@ -78,8 +78,8 @@ class BudgetRepository implements BudgetRepositoryInterface /** * @return bool * - * @throws \Exception - * @throws \Exception + + */ public function cleanupBudgets(): bool { @@ -154,7 +154,7 @@ class BudgetRepository implements BudgetRepositoryInterface * * @return bool * - * @throws \Exception + */ public function destroy(Budget $budget): bool { @@ -180,7 +180,7 @@ class BudgetRepository implements BudgetRepositoryInterface /** @var stdClass $object */ $result = $set->filter( function (TransactionJournal $object) use ($budgetId, $period) { - $result = strval($object->period_marker) === strval($period) && $budgetId === intval($object->budget_id); + $result = (string)$object->period_marker === (string)$period && $budgetId === (int)$object->budget_id; return $result; } @@ -252,7 +252,6 @@ class BudgetRepository implements BudgetRepositoryInterface * @param Budget $budget * * @return Carbon - * @throws \InvalidArgumentException */ public function firstUseDate(Budget $budget): Carbon { @@ -348,7 +347,7 @@ class BudgetRepository implements BudgetRepositoryInterface ->where('start_date', $start->format('Y-m-d 00:00:00')) ->where('end_date', $end->format('Y-m-d 00:00:00'))->first(); if (null !== $availableBudget) { - $amount = strval($availableBudget->amount); + $amount = (string)$availableBudget->amount; } return $amount; @@ -432,7 +431,7 @@ class BudgetRepository implements BudgetRepositoryInterface // loop transactions: /** @var Transaction $transaction */ foreach ($transactions as $transaction) { - $budgetId = max(intval($transaction->transaction_journal_budget_id), intval($transaction->transaction_budget_id)); + $budgetId = max((int)$transaction->transaction_journal_budget_id, (int)$transaction->transaction_budget_id); $date = $transaction->date->format($carbonFormat); $data[$budgetId]['entries'][$date] = bcadd($data[$budgetId]['entries'][$date] ?? '0', $transaction->transaction_amount); } @@ -492,7 +491,7 @@ class BudgetRepository implements BudgetRepositoryInterface $transactions = $collector->getJournals(); $result = [ 'entries' => [], - 'name' => strval(trans('firefly.no_budget')), + 'name' => (string)trans('firefly.no_budget'), 'sum' => '0', ]; @@ -566,9 +565,8 @@ class BudgetRepository implements BudgetRepositoryInterface } $set = $collector->getJournals(); - $sum = strval($set->sum('transaction_amount')); - return $sum; + return strval($set->sum('transaction_amount')); } /** @@ -603,9 +601,7 @@ class BudgetRepository implements BudgetRepositoryInterface } ); - $sum = strval($set->sum('transaction_amount')); - - return $sum; + return strval($set->sum('transaction_amount')); } /** @@ -650,7 +646,7 @@ class BudgetRepository implements BudgetRepositoryInterface * * @return BudgetLimit * - * @throws \Exception + */ public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): BudgetLimit { diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index 04d3e7911a..36879ca327 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -34,11 +34,6 @@ use Illuminate\Support\Collection; */ interface BudgetRepositoryInterface { - /** - * @return bool - */ - public function cleanupBudgets(): bool; - /** * A method that returns the amount of money budgeted per day for this budget, * on average. @@ -49,6 +44,11 @@ interface BudgetRepositoryInterface */ public function budgetedPerDay(Budget $budget): string; + /** + * @return bool + */ + public function cleanupBudgets(): bool; + /** * This method collects various info on budgets, used on the budget page and on the index. * diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 72f8f5c33a..94646bc84e 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -48,7 +48,7 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return bool * - * @throws \Exception + */ public function destroy(Category $category): bool { @@ -74,9 +74,8 @@ class CategoryRepository implements CategoryRepositoryInterface $collector->setUser($this->user); $collector->setRange($start, $end)->setTypes([TransactionType::DEPOSIT])->setAccounts($accounts)->setCategories($categories); $set = $collector->getJournals(); - $sum = strval($set->sum('transaction_amount')); - return $sum; + return strval($set->sum('transaction_amount')); } /** @@ -237,7 +236,7 @@ class CategoryRepository implements CategoryRepositoryInterface if (1 === bccomp($transaction->transaction_amount, '0')) { continue; } - $categoryId = max(intval($transaction->transaction_journal_category_id), intval($transaction->transaction_category_id)); + $categoryId = max((int)$transaction->transaction_journal_category_id, (int)$transaction->transaction_category_id); $date = $transaction->date->format($carbonFormat); $data[$categoryId]['entries'][$date] = bcadd($data[$categoryId]['entries'][$date] ?? '0', $transaction->transaction_amount); } @@ -263,7 +262,7 @@ class CategoryRepository implements CategoryRepositoryInterface $transactions = $collector->getJournals(); $result = [ 'entries' => [], - 'name' => strval(trans('firefly.no_category')), + 'name' => (string)trans('firefly.no_category'), 'sum' => '0', ]; @@ -320,7 +319,7 @@ class CategoryRepository implements CategoryRepositoryInterface if (bccomp($transaction->transaction_amount, '0') === -1) { continue; } - $categoryId = max(intval($transaction->transaction_journal_category_id), intval($transaction->transaction_category_id)); + $categoryId = max((int)$transaction->transaction_journal_category_id, (int)$transaction->transaction_category_id); $date = $transaction->date->format($carbonFormat); $data[$categoryId]['entries'][$date] = bcadd($data[$categoryId]['entries'][$date] ?? '0', $transaction->transaction_amount); } @@ -347,7 +346,7 @@ class CategoryRepository implements CategoryRepositoryInterface $transactions = $collector->getJournals(); $result = [ 'entries' => [], - 'name' => strval(trans('firefly.no_category')), + 'name' => (string)trans('firefly.no_category'), 'sum' => '0', ]; Log::debug('Looping transactions..'); @@ -400,9 +399,8 @@ class CategoryRepository implements CategoryRepositoryInterface } $set = $collector->getJournals(); - $sum = strval($set->sum('transaction_amount')); - return $sum; + return strval($set->sum('transaction_amount')); } /** @@ -437,9 +435,7 @@ class CategoryRepository implements CategoryRepositoryInterface } ); - $sum = strval($set->sum('transaction_amount')); - - return $sum; + return strval($set->sum('transaction_amount')); } /** @@ -452,9 +448,8 @@ class CategoryRepository implements CategoryRepositoryInterface /** @var CategoryFactory $factory */ $factory = app(CategoryFactory::class); $factory->setUser($this->user); - $category = $factory->findOrCreate(null, $data['name']); - return $category; + return $factory->findOrCreate(null, $data['name']); } /** diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index f0da06ba51..c79aedf8ab 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -73,12 +73,8 @@ class CurrencyRepository implements CurrencyRepositoryInterface // is the default currency for the system $defaultSystemCode = config('firefly.default_currency', 'EUR'); - if ($currency->code === $defaultSystemCode) { - return false; - } - // can be deleted - return true; + return !($currency->code === $defaultSystemCode); } /** @@ -232,10 +228,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface */ public function findNull(int $currencyId): ?TransactionCurrency { - /** @var TransactionCurrency $res */ - $res = TransactionCurrency::find($currencyId); - - return $res; + return TransactionCurrency::find($currencyId); } /** diff --git a/app/Repositories/Currency/CurrencyRepositoryInterface.php b/app/Repositories/Currency/CurrencyRepositoryInterface.php index 39d3f78a47..2462ae8af5 100644 --- a/app/Repositories/Currency/CurrencyRepositoryInterface.php +++ b/app/Repositories/Currency/CurrencyRepositoryInterface.php @@ -87,7 +87,9 @@ interface CurrencyRepositoryInterface /** * Find by currency name. + * * @deprecated + * * @param string $currencyName * * @return TransactionCurrency @@ -105,7 +107,9 @@ interface CurrencyRepositoryInterface /** * Find by currency symbol. + * * @deprecated + * * @param string $currencySymbol * * @return TransactionCurrency diff --git a/app/Repositories/ExportJob/ExportJobRepository.php b/app/Repositories/ExportJob/ExportJobRepository.php index 9117d85c69..20a01c9cf4 100644 --- a/app/Repositories/ExportJob/ExportJobRepository.php +++ b/app/Repositories/ExportJob/ExportJobRepository.php @@ -54,7 +54,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface /** * @return bool * - * @throws \Exception + */ public function cleanup(): bool { @@ -68,7 +68,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface foreach ($set as $entry) { $key = $entry->key; $len = strlen($key); - $files = scandir(storage_path('export')); + $files = scandir(storage_path('export'), SCANDIR_SORT_NONE); /** @var string $file */ foreach ($files as $file) { if (substr($file, 0, $len) === $key) { @@ -144,11 +144,10 @@ class ExportJobRepository implements ExportJobRepositoryInterface */ public function getContent(ExportJob $job): string { - $disk = Storage::disk('export'); - $file = $job->key . '.zip'; - $content = $disk->get($file); + $disk = Storage::disk('export'); + $file = $job->key . '.zip'; - return $content; + return $disk->get($file); } /** diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.php index a034fc64bf..821a511b54 100644 --- a/app/Repositories/ImportJob/ImportJobRepository.php +++ b/app/Repositories/ImportJob/ImportJobRepository.php @@ -81,7 +81,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface public function addTotalSteps(ImportJob $job, int $steps = 1): ImportJob { $extended = $this->getExtendedStatus($job); - $total = $extended['steps'] ?? 0; + $total = (int)($extended['steps'] ?? 0); $total += $steps; $extended['steps'] = $total; @@ -104,7 +104,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface ->where('name', 'importHash') ->count(); - return intval($count); + return (int)$count; } /** @@ -210,8 +210,6 @@ class ImportJobRepository implements ImportJobRepositoryInterface * @param UploadedFile $file * * @return bool - * @throws \RuntimeException - * @throws \LogicException */ public function processConfiguration(ImportJob $job, UploadedFile $file): bool { @@ -249,21 +247,33 @@ class ImportJobRepository implements ImportJobRepositoryInterface * * @return bool * - * @throws \RuntimeException - * @throws \LogicException * @throws \Illuminate\Contracts\Encryption\EncryptException * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ public function processFile(ImportJob $job, ?UploadedFile $file): bool { - if (is_null($file)) { + if (null === $file) { return false; } /** @var UserRepositoryInterface $repository */ - $repository = app(UserRepositoryInterface::class); - $newName = sprintf('%s.upload', $job->key); - $uploaded = new SplFileObject($file->getRealPath()); - $content = trim($uploaded->fread($uploaded->getSize())); + $repository = app(UserRepositoryInterface::class); + $newName = sprintf('%s.upload', $job->key); + $uploaded = new SplFileObject($file->getRealPath()); + $content = trim($uploaded->fread($uploaded->getSize())); + + // verify content: + $result = mb_detect_encoding($content, 'UTF-8', true); + if ($result === false) { + Log::error(sprintf('Cannot detect encoding for uploaded import file "%s".', $file->getClientOriginalName())); + + return false; + } + if ($result !== 'ASCII' && $result !== 'UTF-8') { + Log::error(sprintf('Uploaded import file is %s instead of UTF8!', var_export($result, true))); + + return false; + } + $contentEncrypted = Crypt::encrypt($content); $disk = Storage::disk('upload'); diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index ed47af2193..4847148cff 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -105,7 +105,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return bool * - * @throws \Exception + */ public function destroy(TransactionJournal $journal): bool { @@ -167,6 +167,7 @@ class JournalRepository implements JournalRepositoryInterface /** * Get users first transaction journal. * + * @deprecated * @return TransactionJournal */ public function first(): TransactionJournal @@ -181,6 +182,23 @@ class JournalRepository implements JournalRepositoryInterface return $entry; } + /** + * Get users first transaction journal or NULL. + * + * @return TransactionJournal|null + */ + public function firstNull(): ?TransactionJournal + { + /** @var TransactionJournal $entry */ + $entry = $this->user->transactionJournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']); + $result = null; + if (null !== $entry) { + $result = $entry; + } + + return $result; + } + /** * @param TransactionJournal $journal * @@ -207,10 +225,7 @@ class JournalRepository implements JournalRepositoryInterface */ public function getFirstPosTransaction(TransactionJournal $journal): Transaction { - /** @var Transaction $transaction */ - $transaction = $journal->transactions()->where('amount', '>', 0)->first(); - - return $transaction; + return $journal->transactions()->where('amount', '>', 0)->first(); } /** @@ -266,7 +281,7 @@ class JournalRepository implements JournalRepositoryInterface */ public function getJournalDate(TransactionJournal $journal, ?string $field): string { - if (is_null($field)) { + if (null === $field) { return $journal->date->format('Y-m-d'); } if (null !== $journal->$field && $journal->$field instanceof Carbon) { @@ -363,7 +378,7 @@ class JournalRepository implements JournalRepositoryInterface // saves on queries: $amount = $journal->transactions()->where('amount', '>', 0)->get()->sum('amount'); - $amount = strval($amount); + $amount = (string)$amount; $cache->store($amount); return $amount; @@ -389,7 +404,7 @@ class JournalRepository implements JournalRepositoryInterface } $entry = $journal->transactionJournalMeta()->where('name', $field)->first(); - if (is_null($entry)) { + if (null === $entry) { return null; } $value = new Carbon($entry->data); @@ -418,7 +433,7 @@ class JournalRepository implements JournalRepositoryInterface } $entry = $journal->transactionJournalMeta()->where('name', $field)->first(); - if (is_null($entry)) { + if (null === $entry) { return null; } @@ -426,7 +441,7 @@ class JournalRepository implements JournalRepositoryInterface // return when array: if (is_array($value)) { - $return = join(',', $value); + $return = implode(',', $value); $cache->store($return); return $return; @@ -434,7 +449,7 @@ class JournalRepository implements JournalRepositoryInterface // return when something else: try { - $return = strval($value); + $return = (string)$value; $cache->store($return); } catch (Exception $e) { Log::error($e->getMessage()); @@ -465,7 +480,7 @@ class JournalRepository implements JournalRepositoryInterface public function getNoteText(TransactionJournal $journal): ?string { $note = $this->getNote($journal); - if (is_null($note)) { + if (null === $note) { return null; } @@ -591,7 +606,7 @@ class JournalRepository implements JournalRepositoryInterface { /** @var Transaction $transaction */ $transaction = $this->user->transactions()->find($transactionId); - if (!is_null($transaction)) { + if (null !== $transaction) { return $this->reconcile($transaction); } diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php index b0ddcfd54f..a3738e4c69 100644 --- a/app/Repositories/Journal/JournalRepositoryInterface.php +++ b/app/Repositories/Journal/JournalRepositoryInterface.php @@ -90,10 +90,18 @@ interface JournalRepositoryInterface /** * Get users very first transaction journal. * + * @deprecated * @return TransactionJournal */ public function first(): TransactionJournal; + /** + * Get users very first transaction journal. + * + * @return TransactionJournal|null + */ + public function firstNull(): ?TransactionJournal; + /** * @param TransactionJournal $journal * diff --git a/app/Repositories/LinkType/LinkTypeRepository.php b/app/Repositories/LinkType/LinkTypeRepository.php index 94490e91a7..6303e97baf 100644 --- a/app/Repositories/LinkType/LinkTypeRepository.php +++ b/app/Repositories/LinkType/LinkTypeRepository.php @@ -55,7 +55,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface * * @return bool * - * @throws \Exception + */ public function destroy(LinkType $linkType, LinkType $moveTo): bool { @@ -72,7 +72,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface * * @return bool * - * @throws \Exception + */ public function destroyLink(TransactionJournalLink $link): bool { @@ -135,7 +135,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface $filtered = $merged->filter( function (TransactionJournalLink $link) { - return (!is_null($link->source) && !is_null($link->destination)); + return (null !== $link->source && null !== $link->destination); } ); @@ -179,9 +179,9 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface */ public function storeLink(array $information, TransactionJournal $left, TransactionJournal $right): TransactionJournalLink { - $linkType = $this->find(intval($information['link_type_id']) ?? 0); - if (is_null($linkType->id)) { - throw new FireflyException(sprintf('Link type #%d cannot be resolved to an actual link type', intval($information['link_type_id']) ?? 0)); + $linkType = $this->find((int)($information['link_type_id'] ?? 0)); + if (null === $linkType->id) { + throw new FireflyException(sprintf('Link type #%d cannot be resolved to an actual link type', $information['link_type_id'] ?? 0)); } $link = new TransactionJournalLink; $link->linkType()->associate($linkType); diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index 2ad4a71bb3..aaca349ba8 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -84,9 +84,9 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface public function canAddAmount(PiggyBank $piggyBank, string $amount): bool { $leftOnAccount = $piggyBank->leftOnAccount(new Carbon); - $savedSoFar = strval($piggyBank->currentRelevantRep()->currentamount); + $savedSoFar = (string)$piggyBank->currentRelevantRep()->currentamount; $leftToSave = bcsub($piggyBank->targetamount, $savedSoFar); - $maxAmount = strval(min(round($leftOnAccount, 12), round($leftToSave, 12))); + $maxAmount = (string)min(round($leftOnAccount, 12), round($leftToSave, 12)); return bccomp($amount, $maxAmount) <= 0; } @@ -144,7 +144,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * * @return bool * - * @throws \Exception + */ public function destroy(PiggyBank $piggyBank): bool { @@ -203,7 +203,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface return '0'; } - return strval($rep->currentamount); + return (string)$rep->currentamount; } /** @@ -233,7 +233,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface $amount = $repos->getJournalTotal($journal); $sources = $repos->getJournalSourceAccounts($journal)->pluck('id')->toArray(); - $room = bcsub(strval($piggyBank->targetamount), strval($repetition->currentamount)); + $room = bcsub((string)$piggyBank->targetamount, (string)$repetition->currentamount); $compare = bcmul($repetition->currentamount, '-1'); Log::debug(sprintf('Will add/remove %f to piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name)); @@ -271,7 +271,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface */ public function getMaxOrder(): int { - return intval($this->user->piggyBanks()->max('order')); + return (int)$this->user->piggyBanks()->max('order'); } /** @@ -279,10 +279,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface */ public function getPiggyBanks(): Collection { - /** @var Collection $set */ - $set = $this->user->piggyBanks()->orderBy('order', 'ASC')->get(); - - return $set; + return $this->user->piggyBanks()->orderBy('order', 'ASC')->get(); } /** @@ -408,7 +405,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface public function update(PiggyBank $piggyBank, array $data): PiggyBank { $piggyBank->name = $data['name']; - $piggyBank->account_id = intval($data['account_id']); + $piggyBank->account_id = (int)$data['account_id']; $piggyBank->targetamount = round($data['targetamount'], 2); $piggyBank->targetdate = $data['targetdate']; $piggyBank->startdate = $data['startdate']; diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index 50fa719748..d5eb41f507 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -50,9 +50,6 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool * - * @throws \Exception - * @throws \Exception - * @throws \Exception */ public function destroy(Rule $rule): bool { @@ -99,7 +96,7 @@ class RuleRepository implements RuleRepositoryInterface */ public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup): int { - return intval($ruleGroup->rules()->max('order')); + return (int)$ruleGroup->rules()->max('order'); } /** @@ -261,7 +258,7 @@ class RuleRepository implements RuleRepositoryInterface $rule->rule_group_id = $data['rule_group_id']; $rule->order = ($order + 1); $rule->active = 1; - $rule->stop_processing = 1 === intval($data['stop_processing']); + $rule->stop_processing = 1 === (int)$data['stop_processing']; $rule->title = $data['title']; $rule->description = strlen($data['description']) > 0 ? $data['description'] : null; @@ -290,7 +287,7 @@ class RuleRepository implements RuleRepositoryInterface $ruleAction->active = 1; $ruleAction->stop_processing = $values['stopProcessing']; $ruleAction->action_type = $values['action']; - $ruleAction->action_value = null === $values['value'] ? '' : $values['value']; + $ruleAction->action_value = $values['value'] ?? ''; $ruleAction->save(); return $ruleAction; @@ -310,7 +307,7 @@ class RuleRepository implements RuleRepositoryInterface $ruleTrigger->active = 1; $ruleTrigger->stop_processing = $values['stopProcessing']; $ruleTrigger->trigger_type = $values['action']; - $ruleTrigger->trigger_value = null === $values['value'] ? '' : $values['value']; + $ruleTrigger->trigger_value = $values['value'] ?? ''; $ruleTrigger->save(); return $ruleTrigger; diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php index 9d1268d19f..dd90b86cc9 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepository.php +++ b/app/Repositories/RuleGroup/RuleGroupRepository.php @@ -50,8 +50,8 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * * @return bool * - * @throws \Exception - * @throws \Exception + + */ public function destroy(RuleGroup $ruleGroup, ?RuleGroup $moveTo): bool { @@ -146,7 +146,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface { $entry = $this->user->ruleGroups()->max('order'); - return intval($entry); + return (int)$entry; } /** diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index af5391c1fd..49b6da7e3f 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -75,7 +75,7 @@ class TagRepository implements TagRepositoryInterface * * @return bool * - * @throws \Exception + */ public function destroy(Tag $tag): bool { @@ -98,9 +98,8 @@ class TagRepository implements TagRepositoryInterface $collector->setUser($this->user); $collector->setRange($start, $end)->setTypes([TransactionType::DEPOSIT])->setAllAssetAccounts()->setTag($tag); $set = $collector->getJournals(); - $sum = strval($set->sum('transaction_amount')); - return $sum; + return strval($set->sum('transaction_amount')); } /** @@ -222,9 +221,8 @@ class TagRepository implements TagRepositoryInterface $collector->setUser($this->user); $collector->setRange($start, $end)->setTypes([TransactionType::WITHDRAWAL])->setAllAssetAccounts()->setTag($tag); $set = $collector->getJournals(); - $sum = strval($set->sum('transaction_amount')); - return $sum; + return strval($set->sum('transaction_amount')); } /** @@ -268,10 +266,10 @@ class TagRepository implements TagRepositoryInterface $journals = $collector->getJournals(); $sum = '0'; foreach ($journals as $journal) { - $sum = bcadd($sum, app('steam')->positive(strval($journal->transaction_amount))); + $sum = bcadd($sum, app('steam')->positive((string)$journal->transaction_amount)); } - return strval($sum); + return (string)$sum; } /** @@ -301,7 +299,7 @@ class TagRepository implements TagRepositoryInterface ]; foreach ($journals as $journal) { - $amount = app('steam')->positive(strval($journal->transaction_amount)); + $amount = app('steam')->positive((string)$journal->transaction_amount); $type = $journal->transaction_type_type; if (TransactionType::WITHDRAWAL === $type) { $amount = bcmul($amount, '-1'); @@ -350,7 +348,7 @@ class TagRepository implements TagRepositoryInterface $tagsWithAmounts = []; /** @var Tag $tag */ foreach ($set as $tag) { - $tagsWithAmounts[$tag->id] = strval($tag->amount_sum); + $tagsWithAmounts[$tag->id] = (string)$tag->amount_sum; } $tags = $allTags->orderBy('tags.id', 'desc')->get(['tags.id', 'tags.tag']); @@ -431,8 +429,8 @@ class TagRepository implements TagRepositoryInterface $step = 1; } - $extra = $step / $amount; - $result = (int)($range[0] + $extra); - return $result; + $extra = $step / $amount; + + return (int)($range[0] + $extra); } } diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php index 4a3d865606..a18e4617ae 100644 --- a/app/Repositories/User/UserRepository.php +++ b/app/Repositories/User/UserRepository.php @@ -77,8 +77,8 @@ class UserRepository implements UserRepositoryInterface Preferences::setForUser($user, 'previous_email_' . date('Y-m-d-H-i-s'), $oldEmail); // set undo and confirm token: - Preferences::setForUser($user, 'email_change_undo_token', strval(bin2hex(random_bytes(16)))); - Preferences::setForUser($user, 'email_change_confirm_token', strval(bin2hex(random_bytes(16)))); + Preferences::setForUser($user, 'email_change_undo_token', (string)bin2hex(random_bytes(16))); + Preferences::setForUser($user, 'email_change_confirm_token', (string)bin2hex(random_bytes(16))); // update user $user->email = $newEmail; @@ -145,7 +145,7 @@ class UserRepository implements UserRepositoryInterface * * @return bool * - * @throws \Exception + */ public function destroy(User $user): bool { @@ -231,7 +231,7 @@ class UserRepository implements UserRepositoryInterface } $return['is_admin'] = $user->hasRole('owner'); - $return['blocked'] = 1 === intval($user->blocked); + $return['blocked'] = 1 === (int)$user->blocked; $return['blocked_code'] = $user->blocked_code; $return['accounts'] = $user->accounts()->count(); $return['journals'] = $user->transactionJournals()->count(); diff --git a/app/Repositories/User/UserRepositoryInterface.php b/app/Repositories/User/UserRepositoryInterface.php index 3582dc509e..8839c738d2 100644 --- a/app/Repositories/User/UserRepositoryInterface.php +++ b/app/Repositories/User/UserRepositoryInterface.php @@ -103,17 +103,12 @@ interface UserRepositoryInterface /** * @param int $userId + * * @deprecated * @return User */ public function find(int $userId): User; - /** - * @param int $userId - * @return User|null - */ - public function findNull(int $userId): ?User; - /** * @param string $email * @@ -121,6 +116,13 @@ interface UserRepositoryInterface */ public function findByEmail(string $email): ?User; + /** + * @param int $userId + * + * @return User|null + */ + public function findNull(int $userId): ?User; + /** * Returns the first user in the DB. Generally only works when there is just one. * diff --git a/app/Rules/BelongsUser.php b/app/Rules/BelongsUser.php index 1607a29bf0..facf3c0b98 100644 --- a/app/Rules/BelongsUser.php +++ b/app/Rules/BelongsUser.php @@ -72,11 +72,11 @@ class BelongsUser implements Rule if (!auth()->check()) { return true; // @codeCoverageIgnore } - $attribute = strval($attribute); + $attribute = (string)$attribute; switch ($attribute) { case 'piggy_bank_id': $count = PiggyBank::leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id') - ->where('piggy_banks.id', '=', intval($value)) + ->where('piggy_banks.id', '=', (int)$value) ->where('accounts.user_id', '=', auth()->user()->id)->count(); return $count === 1; @@ -87,7 +87,7 @@ class BelongsUser implements Rule return $count === 1; break; case 'bill_id': - $count = Bill::where('id', '=', intval($value))->where('user_id', '=', auth()->user()->id)->count(); + $count = Bill::where('id', '=', (int)$value)->where('user_id', '=', auth()->user()->id)->count(); return $count === 1; case 'bill_name': @@ -96,12 +96,12 @@ class BelongsUser implements Rule return $count === 1; break; case 'budget_id': - $count = Budget::where('id', '=', intval($value))->where('user_id', '=', auth()->user()->id)->count(); + $count = Budget::where('id', '=', (int)$value)->where('user_id', '=', auth()->user()->id)->count(); return $count === 1; break; case 'category_id': - $count = Category::where('id', '=', intval($value))->where('user_id', '=', auth()->user()->id)->count(); + $count = Category::where('id', '=', (int)$value)->where('user_id', '=', auth()->user()->id)->count(); return $count === 1; break; @@ -112,7 +112,7 @@ class BelongsUser implements Rule break; case 'source_id': case 'destination_id': - $count = Account::where('id', '=', intval($value))->where('user_id', '=', auth()->user()->id)->count(); + $count = Account::where('id', '=', (int)$value)->where('user_id', '=', auth()->user()->id)->count(); return $count === 1; break; @@ -143,7 +143,7 @@ class BelongsUser implements Rule } $count = 0; foreach ($objects as $object) { - if (trim(strval($object->$field)) === trim($value)) { + if (trim((string)$object->$field) === trim($value)) { $count++; } } diff --git a/app/Rules/UniqueIban.php b/app/Rules/UniqueIban.php index 8cd5312b80..5af463b6b4 100644 --- a/app/Rules/UniqueIban.php +++ b/app/Rules/UniqueIban.php @@ -76,7 +76,7 @@ class UniqueIban implements Rule if (!auth()->check()) { return true; // @codeCoverageIgnore } - if (is_null($this->expectedType)) { + if (null === $this->expectedType) { return true; } $maxCounts = [ @@ -114,7 +114,7 @@ class UniqueIban implements Rule ->accounts() ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') ->where('account_types.type', $type); - if (!is_null($this->account)) { + if (null !== $this->account) { $query->where('accounts.id', '!=', $this->account->id); } $result = $query->get(['accounts.*']); diff --git a/app/Services/Bunq/Id/BunqId.php b/app/Services/Bunq/Id/BunqId.php index 02c263cf23..8c62a3d29a 100644 --- a/app/Services/Bunq/Id/BunqId.php +++ b/app/Services/Bunq/Id/BunqId.php @@ -38,7 +38,7 @@ class BunqId */ public function __construct($data = null) { - if (!is_null($data)) { + if (null !== $data) { $this->id = $data['id']; } } diff --git a/app/Services/Bunq/Id/DeviceSessionId.php b/app/Services/Bunq/Id/DeviceSessionId.php index 7ac7d73ed1..91c5233870 100644 --- a/app/Services/Bunq/Id/DeviceSessionId.php +++ b/app/Services/Bunq/Id/DeviceSessionId.php @@ -27,13 +27,4 @@ namespace FireflyIII\Services\Bunq\Id; */ class DeviceSessionId extends BunqId { - /** - * DeviceSessionId constructor. - * - * @param null $data - */ - public function __construct($data = null) - { - parent::__construct($data); - } } diff --git a/app/Services/Bunq/Object/Alias.php b/app/Services/Bunq/Object/Alias.php index a0d3877f06..bb3f971a5a 100644 --- a/app/Services/Bunq/Object/Alias.php +++ b/app/Services/Bunq/Object/Alias.php @@ -28,11 +28,11 @@ namespace FireflyIII\Services\Bunq\Object; class Alias extends BunqObject { /** @var string */ - private $name = ''; + private $name; /** @var string */ - private $type = ''; + private $type; /** @var string */ - private $value = ''; + private $value; /** * Alias constructor. diff --git a/app/Services/Bunq/Object/Amount.php b/app/Services/Bunq/Object/Amount.php index f142424d8f..64da7a7416 100644 --- a/app/Services/Bunq/Object/Amount.php +++ b/app/Services/Bunq/Object/Amount.php @@ -28,9 +28,9 @@ namespace FireflyIII\Services\Bunq\Object; class Amount extends BunqObject { /** @var string */ - private $currency = ''; + private $currency; /** @var string */ - private $value = ''; + private $value; /** * Amount constructor. diff --git a/app/Services/Bunq/Object/DeviceServer.php b/app/Services/Bunq/Object/DeviceServer.php index 64bf9dced0..77dd6a02ef 100644 --- a/app/Services/Bunq/Object/DeviceServer.php +++ b/app/Services/Bunq/Object/DeviceServer.php @@ -48,7 +48,6 @@ class DeviceServer extends BunqObject * * @param array $data * - * @throws \InvalidArgumentException */ public function __construct(array $data) { diff --git a/app/Services/Bunq/Object/LabelMonetaryAccount.php b/app/Services/Bunq/Object/LabelMonetaryAccount.php index a8023dbd7c..c652f959df 100644 --- a/app/Services/Bunq/Object/LabelMonetaryAccount.php +++ b/app/Services/Bunq/Object/LabelMonetaryAccount.php @@ -40,15 +40,6 @@ class LabelMonetaryAccount extends BunqObject /** @var LabelUser */ private $labelUser; - /** - * @return LabelUser - */ - public function getLabelUser(): LabelUser - { - return $this->labelUser; - } - - /** * LabelMonetaryAccount constructor. * @@ -71,6 +62,14 @@ class LabelMonetaryAccount extends BunqObject return $this->iban; } + /** + * @return LabelUser + */ + public function getLabelUser(): LabelUser + { + return $this->labelUser; + } + /** * @return array */ diff --git a/app/Services/Bunq/Object/LabelUser.php b/app/Services/Bunq/Object/LabelUser.php index c3eaacc5d9..2d940851c7 100644 --- a/app/Services/Bunq/Object/LabelUser.php +++ b/app/Services/Bunq/Object/LabelUser.php @@ -40,6 +40,20 @@ class LabelUser extends BunqObject /** @var string */ private $uuid; + /** + * LabelUser constructor. + * + * @param array $data + */ + public function __construct(array $data) + { + $this->uuid = $data['uuid']; + $this->displayName = $data['display_name']; + $this->country = $data['country']; + $this->publicNickName = $data['public_nick_name']; + $this->avatar = new Avatar($data['avatar']); + } + /** * @return Avatar */ @@ -64,22 +78,6 @@ class LabelUser extends BunqObject return $this->publicNickName; } - - - /** - * LabelUser constructor. - * - * @param array $data - */ - public function __construct(array $data) - { - $this->uuid = $data['uuid']; - $this->displayName = $data['display_name']; - $this->country = $data['country']; - $this->publicNickName = $data['public_nick_name']; - $this->avatar = new Avatar($data['avatar']); - } - /** * @return array */ diff --git a/app/Services/Bunq/Object/MonetaryAccountBank.php b/app/Services/Bunq/Object/MonetaryAccountBank.php index 2d0fddef6b..f38e88a53f 100644 --- a/app/Services/Bunq/Object/MonetaryAccountBank.php +++ b/app/Services/Bunq/Object/MonetaryAccountBank.php @@ -38,15 +38,15 @@ class MonetaryAccountBank extends BunqObject /** @var Carbon */ private $created; /** @var string */ - private $currency = ''; + private $currency; /** @var Amount */ private $dailyLimit; /** @var Amount */ private $dailySpent; /** @var string */ - private $description = ''; + private $description; /** @var int */ - private $id = 0; + private $id; /** @var MonetaryAccountProfile */ private $monetaryAccountProfile; /** @var array */ @@ -54,28 +54,27 @@ class MonetaryAccountBank extends BunqObject /** @var Amount */ private $overdraftLimit; /** @var string */ - private $publicUuid = ''; + private $publicUuid; /** @var string */ - private $reason = ''; + private $reason; /** @var string */ - private $reasonDescription = ''; + private $reasonDescription; /** @var MonetaryAccountSetting */ private $setting; /** @var string */ - private $status = ''; + private $status; /** @var string */ - private $subStatus = ''; + private $subStatus; /** @var Carbon */ private $updated; /** @var int */ - private $userId = 0; + private $userId; /** * MonetaryAccountBank constructor. * * @param array $data * - * @throws \InvalidArgumentException */ public function __construct(array $data) { @@ -106,8 +105,6 @@ class MonetaryAccountBank extends BunqObject foreach ($data['notification_filters'] as $filter) { $this->notificationFilters[] = new NotificationFilter($filter); } - - return; } /** diff --git a/app/Services/Bunq/Object/MonetaryAccountProfile.php b/app/Services/Bunq/Object/MonetaryAccountProfile.php index c51223671b..93d3dd5c2f 100644 --- a/app/Services/Bunq/Object/MonetaryAccountProfile.php +++ b/app/Services/Bunq/Object/MonetaryAccountProfile.php @@ -28,7 +28,7 @@ namespace FireflyIII\Services\Bunq\Object; class MonetaryAccountProfile extends BunqObject { /** @var string */ - private $profileActionRequired = ''; + private $profileActionRequired; /** @var Amount */ private $profileAmountRequired; /** diff --git a/app/Services/Bunq/Object/MonetaryAccountSetting.php b/app/Services/Bunq/Object/MonetaryAccountSetting.php index 2fb81df801..449113b80c 100644 --- a/app/Services/Bunq/Object/MonetaryAccountSetting.php +++ b/app/Services/Bunq/Object/MonetaryAccountSetting.php @@ -28,11 +28,11 @@ namespace FireflyIII\Services\Bunq\Object; class MonetaryAccountSetting extends BunqObject { /** @var string */ - private $color = ''; + private $color; /** @var string */ - private $defaultAvatarStatus = ''; + private $defaultAvatarStatus; /** @var string */ - private $restrictionChat = ''; + private $restrictionChat; /** * MonetaryAccountSetting constructor. diff --git a/app/Services/Bunq/Object/NotificationFilter.php b/app/Services/Bunq/Object/NotificationFilter.php index b61dbf0664..f6fe9bd3a1 100644 --- a/app/Services/Bunq/Object/NotificationFilter.php +++ b/app/Services/Bunq/Object/NotificationFilter.php @@ -34,7 +34,7 @@ class NotificationFilter extends BunqObject */ public function __construct(array $data) { - unset($data); + } /** diff --git a/app/Services/Bunq/Object/Payment.php b/app/Services/Bunq/Object/Payment.php index a5e1763ed2..2e063897d0 100644 --- a/app/Services/Bunq/Object/Payment.php +++ b/app/Services/Bunq/Object/Payment.php @@ -61,7 +61,6 @@ class Payment extends BunqObject * * @param array $data * - * @throws \InvalidArgumentException */ public function __construct(array $data) { diff --git a/app/Services/Bunq/Object/ServerPublicKey.php b/app/Services/Bunq/Object/ServerPublicKey.php index 0a89187145..a5fa808392 100644 --- a/app/Services/Bunq/Object/ServerPublicKey.php +++ b/app/Services/Bunq/Object/ServerPublicKey.php @@ -28,7 +28,7 @@ namespace FireflyIII\Services\Bunq\Object; class ServerPublicKey extends BunqObject { /** @var string */ - private $publicKey = ''; + private $publicKey; /** * ServerPublicKey constructor. diff --git a/app/Services/Bunq/Object/UserCompany.php b/app/Services/Bunq/Object/UserCompany.php index fee6c445be..1ed89f6faa 100644 --- a/app/Services/Bunq/Object/UserCompany.php +++ b/app/Services/Bunq/Object/UserCompany.php @@ -44,9 +44,9 @@ class UserCompany extends BunqObject */ private $avatar; /** @var string */ - private $cocNumber = ''; + private $cocNumber; /** @var string */ - private $counterBankIban = ''; + private $counterBankIban; /** @var Carbon */ private $created; /** @@ -58,48 +58,47 @@ class UserCompany extends BunqObject */ private $directorAlias; /** @var string */ - private $displayName = ''; + private $displayName; /** @var int */ - private $id = 0; + private $id; /** @var string */ - private $language = ''; + private $language; /** @var string */ - private $name = ''; + private $name; /** @var array */ private $notificationFilters = []; /** @var string */ - private $publicNickName = ''; + private $publicNickName; /** @var string */ - private $publicUuid = ''; + private $publicUuid; /** @var string */ - private $region = ''; + private $region; /** @var string */ - private $sectorOfIndustry = ''; + private $sectorOfIndustry; /** @var int */ - private $sessionTimeout = 0; + private $sessionTimeout; /** @var string */ - private $status = ''; + private $status; /** @var string */ - private $subStatus = ''; + private $subStatus; /** @var string */ - private $typeOfBusinessEntity = ''; + private $typeOfBusinessEntity; /** @var array */ private $ubos = []; /** @var Carbon */ private $updated; /** @var int */ - private $versionTos = 0; + private $versionTos; /** * UserCompany constructor. * * @param array $data * - * @throws \InvalidArgumentException */ public function __construct(array $data) { - $this->id = intval($data['id']); + $this->id = (int)$data['id']; $this->created = Carbon::createFromFormat('Y-m-d H:i:s.u', $data['created']); $this->updated = Carbon::createFromFormat('Y-m-d H:i:s.u', $data['updated']); $this->status = $data['status']; @@ -109,8 +108,8 @@ class UserCompany extends BunqObject $this->publicNickName = $data['public_nick_name']; $this->language = $data['language']; $this->region = $data['region']; - $this->sessionTimeout = intval($data['session_timeout']); - $this->versionTos = intval($data['version_terms_of_service']); + $this->sessionTimeout = (int)$data['session_timeout']; + $this->versionTos = (int)$data['version_terms_of_service']; $this->cocNumber = $data['chamber_of_commerce_number']; $this->typeOfBusinessEntity = $data['type_of_business_entity'] ?? ''; $this->sectorOfIndustry = $data['sector_of_industry'] ?? ''; diff --git a/app/Services/Bunq/Object/UserLight.php b/app/Services/Bunq/Object/UserLight.php index e6ff84b504..3576c94d31 100644 --- a/app/Services/Bunq/Object/UserLight.php +++ b/app/Services/Bunq/Object/UserLight.php @@ -34,21 +34,21 @@ class UserLight extends BunqObject /** @var Carbon */ private $created; /** @var string */ - private $displayName = ''; + private $displayName; /** @var string */ - private $firstName = ''; + private $firstName; /** @var int */ - private $id = 0; + private $id; /** @var string */ - private $lastName = ''; + private $lastName; /** @var string */ - private $legalName = ''; + private $legalName; /** @var string */ - private $middleName = ''; + private $middleName; /** @var string */ - private $publicNickName = ''; + private $publicNickName; /** @var string */ - private $publicUuid = ''; + private $publicUuid; /** @var Carbon */ private $updated; @@ -57,14 +57,13 @@ class UserLight extends BunqObject * * @param array $data * - * @throws \InvalidArgumentException */ public function __construct(array $data) { if (0 === count($data)) { return; } - $this->id = intval($data['id']); + $this->id = (int)$data['id']; $this->created = Carbon::createFromFormat('Y-m-d H:i:s.u', $data['created']); $this->updated = Carbon::createFromFormat('Y-m-d H:i:s.u', $data['updated']); $this->publicUuid = $data['public_uuid']; diff --git a/app/Services/Bunq/Object/UserPerson.php b/app/Services/Bunq/Object/UserPerson.php index 265c31429e..bcec433ebb 100644 --- a/app/Services/Bunq/Object/UserPerson.php +++ b/app/Services/Bunq/Object/UserPerson.php @@ -46,7 +46,7 @@ class UserPerson extends BunqObject /** @var array */ private $billingContracts = []; /** @var string */ - private $countryOfBirth = ''; + private $countryOfBirth; /** @var Carbon */ private $created; /** @@ -64,60 +64,59 @@ class UserPerson extends BunqObject /** @var Carbon */ private $dateOfBirth; /** @var string */ - private $displayName = ''; + private $displayName; /** @var string */ - private $documentCountry = ''; + private $documentCountry; /** @var string */ - private $documentNumber = ''; + private $documentNumber; /** @var string */ - private $documentType = ''; + private $documentType; /** @var string */ - private $firstName = ''; + private $firstName; /** @var string */ - private $gender = ''; + private $gender; /** @var int */ - private $id = 0; + private $id; /** @var string */ - private $language = ''; + private $language; /** @var string */ - private $lastName = ''; + private $lastName; /** @var string */ - private $legalName = ''; + private $legalName; /** @var string */ - private $middleName = ''; + private $middleName; /** @var string */ - private $nationality = ''; + private $nationality; /** @var array */ private $notificationFilters = []; /** @var string */ - private $placeOfBirth = ''; + private $placeOfBirth; /** @var string */ - private $publicNickName = ''; + private $publicNickName; /** @var string */ - private $publicUuid = ''; + private $publicUuid; /** * @var mixed */ private $region; /** @var int */ - private $sessionTimeout = 0; + private $sessionTimeout; /** @var string */ - private $status = ''; + private $status; /** @var string */ - private $subStatus = ''; + private $subStatus; /** @var string */ - private $taxResident = ''; + private $taxResident; /** @var Carbon */ private $updated; /** @var int */ - private $versionTos = 0; + private $versionTos; /** * UserPerson constructor. * * @param array $data * - * @throws \InvalidArgumentException */ public function __construct(array $data) { @@ -129,7 +128,7 @@ class UserPerson extends BunqObject return; } - $this->id = intval($data['id']); + $this->id = (int)$data['id']; $this->created = Carbon::createFromFormat('Y-m-d H:i:s.u', $data['created']); $this->updated = Carbon::createFromFormat('Y-m-d H:i:s.u', $data['updated']); $this->status = $data['status']; @@ -139,7 +138,7 @@ class UserPerson extends BunqObject $this->publicNickName = $data['public_nick_name']; $this->language = $data['language']; $this->region = $data['region']; - $this->sessionTimeout = intval($data['session_timeout']); + $this->sessionTimeout = (int)$data['session_timeout']; $this->firstName = $data['first_name']; $this->middleName = $data['middle_name']; $this->lastName = $data['last_name']; @@ -150,7 +149,7 @@ class UserPerson extends BunqObject $this->countryOfBirth = $data['country_of_birth']; $this->nationality = $data['nationality']; $this->gender = $data['gender']; - $this->versionTos = intval($data['version_terms_of_service']); + $this->versionTos = (int)$data['version_terms_of_service']; $this->documentNumber = $data['document_number']; $this->documentType = $data['document_type']; $this->documentCountry = $data['document_country_of_issuance']; diff --git a/app/Services/Bunq/Request/BunqRequest.php b/app/Services/Bunq/Request/BunqRequest.php index ca132487de..a9ba838fba 100644 --- a/app/Services/Bunq/Request/BunqRequest.php +++ b/app/Services/Bunq/Request/BunqRequest.php @@ -27,7 +27,6 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Services\Bunq\Object\ServerPublicKey; use Log; use Requests; -use Requests_Exception; /** * Class BunqRequest. @@ -41,7 +40,7 @@ abstract class BunqRequest /** @var string */ private $privateKey = ''; /** @var string */ - private $server = ''; + private $server; /** * @var array */ @@ -58,8 +57,8 @@ abstract class BunqRequest */ public function __construct() { - $this->server = strval(config('import.options.bunq.server')); - $this->version = strval(config('import.options.bunq.version')); + $this->server = (string)config('import.options.bunq.server'); + $this->version = (string)config('import.options.bunq.version'); Log::debug(sprintf('Created new BunqRequest with server "%s" and version "%s"', $this->server, $this->version)); } @@ -230,14 +229,14 @@ abstract class BunqRequest try { $response = Requests::delete($fullUri, $headers); - } catch (Requests_Exception $e) { + } catch (Exception $e) { return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()]]]; } $body = $response->body; $array = json_decode($body, true); $responseHeaders = $response->headers->getAll(); - $statusCode = intval($response->status_code); + $statusCode = (int)$response->status_code; $array['ResponseHeaders'] = $responseHeaders; $array['ResponseStatusCode'] = $statusCode; @@ -277,14 +276,14 @@ abstract class BunqRequest try { $response = Requests::get($fullUri, $headers); - } catch (Requests_Exception $e) { + } catch (Exception $e) { return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()]]]; } $body = $response->body; $array = json_decode($body, true); $responseHeaders = $response->headers->getAll(); - $statusCode = intval($response->status_code); + $statusCode = (int)$response->status_code; $array['ResponseHeaders'] = $responseHeaders; $array['ResponseStatusCode'] = $statusCode; @@ -318,14 +317,14 @@ abstract class BunqRequest try { $response = Requests::post($fullUri, $headers, $body); - } catch (Requests_Exception|Exception $e) { + } catch (Exception $e) { return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()]]]; } Log::debug('Seems to have NO exceptions in Response'); $body = $response->body; $array = json_decode($body, true); $responseHeaders = $response->headers->getAll(); - $statusCode = intval($response->status_code); + $statusCode = (int)$response->status_code; $array['ResponseHeaders'] = $responseHeaders; $array['ResponseStatusCode'] = $statusCode; @@ -355,7 +354,7 @@ abstract class BunqRequest try { $response = Requests::delete($fullUri, $headers); - } catch (Requests_Exception|Exception $e) { + } catch (Exception $e) { return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()]]]; } $body = $response->body; @@ -389,7 +388,7 @@ abstract class BunqRequest try { $response = Requests::post($fullUri, $headers, $body); - } catch (Requests_Exception|Exception $e) { + } catch (Exception $e) { return ['Error' => [0 => ['error_description' => $e->getMessage(), 'error_description_translated' => $e->getMessage()]]]; } $body = $response->body; @@ -465,7 +464,7 @@ abstract class BunqRequest $message[] = $error['error_description']; } } - throw new FireflyException('Bunq ERROR ' . $response['ResponseStatusCode'] . ': ' . join(', ', $message)); + throw new FireflyException('Bunq ERROR ' . $response['ResponseStatusCode'] . ': ' . implode(', ', $message)); } /** diff --git a/app/Services/Bunq/Request/DeleteDeviceSessionRequest.php b/app/Services/Bunq/Request/DeleteDeviceSessionRequest.php index 545b9e7814..31567043cb 100644 --- a/app/Services/Bunq/Request/DeleteDeviceSessionRequest.php +++ b/app/Services/Bunq/Request/DeleteDeviceSessionRequest.php @@ -34,7 +34,6 @@ class DeleteDeviceSessionRequest extends BunqRequest private $sessionToken; /** - * @throws \Exception */ public function call(): void { diff --git a/app/Services/Bunq/Request/DeviceServerRequest.php b/app/Services/Bunq/Request/DeviceServerRequest.php index 7e8600d7c9..236d0b3b94 100644 --- a/app/Services/Bunq/Request/DeviceServerRequest.php +++ b/app/Services/Bunq/Request/DeviceServerRequest.php @@ -46,14 +46,14 @@ class DeviceServerRequest extends BunqRequest public function call(): void { Log::debug('Now in DeviceServerRequest::call()'); - $uri = 'device-server'; - $data = ['description' => $this->description, 'secret' => $this->secret, 'permitted_ips' => $this->permittedIps]; + $uri = 'device-server'; + $data = ['description' => $this->description, 'secret' => $this->secret, 'permitted_ips' => $this->permittedIps]; $headers = $this->getDefaultHeaders(); $headers['X-Bunq-Client-Authentication'] = $this->installationToken->getToken(); $response = $this->sendSignedBunqPost($uri, $data, $headers); $deviceServerId = new DeviceServerId; - $deviceServerId->setId(intval($response['Response'][0]['Id']['id'])); + $deviceServerId->setId((int)$response['Response'][0]['Id']['id']); $this->deviceServerId = $deviceServerId; return; diff --git a/app/Services/Bunq/Request/DeviceSessionRequest.php b/app/Services/Bunq/Request/DeviceSessionRequest.php index d67c14c8d1..5e559485d3 100644 --- a/app/Services/Bunq/Request/DeviceSessionRequest.php +++ b/app/Services/Bunq/Request/DeviceSessionRequest.php @@ -113,7 +113,7 @@ class DeviceSessionRequest extends BunqRequest { $data = $this->getKeyFromResponse('Id', $response); $deviceSessionId = new DeviceSessionId; - $deviceSessionId->setId(intval($data['id'])); + $deviceSessionId->setId((int)$data['id']); return $deviceSessionId; } @@ -125,10 +125,9 @@ class DeviceSessionRequest extends BunqRequest */ private function extractSessionToken(array $response): SessionToken { - $data = $this->getKeyFromResponse('Token', $response); - $sessionToken = new SessionToken($data); + $data = $this->getKeyFromResponse('Token', $response); - return $sessionToken; + return new SessionToken($data); } /** @@ -138,10 +137,9 @@ class DeviceSessionRequest extends BunqRequest */ private function extractUserCompany($response): UserCompany { - $data = $this->getKeyFromResponse('UserCompany', $response); - $userCompany = new UserCompany($data); + $data = $this->getKeyFromResponse('UserCompany', $response); - return $userCompany; + return new UserCompany($data); } /** @@ -151,9 +149,8 @@ class DeviceSessionRequest extends BunqRequest */ private function extractUserPerson($response): UserPerson { - $data = $this->getKeyFromResponse('UserPerson', $response); - $userPerson = new UserPerson($data); + $data = $this->getKeyFromResponse('UserPerson', $response); - return $userPerson; + return new UserPerson($data); } } diff --git a/app/Services/Bunq/Request/InstallationTokenRequest.php b/app/Services/Bunq/Request/InstallationTokenRequest.php index 8eb54531ff..0558738218 100644 --- a/app/Services/Bunq/Request/InstallationTokenRequest.php +++ b/app/Services/Bunq/Request/InstallationTokenRequest.php @@ -103,7 +103,7 @@ class InstallationTokenRequest extends BunqRequest { $installationId = new InstallationId; $data = $this->getKeyFromResponse('Id', $response); - $installationId->setId(intval($data['id'])); + $installationId->setId((int)$data['id']); return $installationId; } @@ -115,10 +115,9 @@ class InstallationTokenRequest extends BunqRequest */ private function extractInstallationToken(array $response): InstallationToken { - $data = $this->getKeyFromResponse('Token', $response); - $installationToken = new InstallationToken($data); + $data = $this->getKeyFromResponse('Token', $response); - return $installationToken; + return new InstallationToken($data); } /** @@ -128,9 +127,8 @@ class InstallationTokenRequest extends BunqRequest */ private function extractServerPublicKey(array $response): ServerPublicKey { - $data = $this->getKeyFromResponse('ServerPublicKey', $response); - $serverPublicKey = new ServerPublicKey($data); + $data = $this->getKeyFromResponse('ServerPublicKey', $response); - return $serverPublicKey; + return new ServerPublicKey($data); } } diff --git a/app/Services/Bunq/Request/ListUserRequest.php b/app/Services/Bunq/Request/ListUserRequest.php index 241a819129..9c5549df92 100644 --- a/app/Services/Bunq/Request/ListUserRequest.php +++ b/app/Services/Bunq/Request/ListUserRequest.php @@ -42,7 +42,6 @@ class ListUserRequest extends BunqRequest private $userPerson; /** - * @throws \Exception */ public function call(): void { diff --git a/app/Services/Bunq/Token/BunqToken.php b/app/Services/Bunq/Token/BunqToken.php index 7b4ee2efe9..161448a364 100644 --- a/app/Services/Bunq/Token/BunqToken.php +++ b/app/Services/Bunq/Token/BunqToken.php @@ -96,7 +96,6 @@ class BunqToken /** * @param array $response * - * @throws \InvalidArgumentException */ protected function makeTokenFromResponse(array $response): void { diff --git a/app/Services/Currency/FixerIO.php b/app/Services/Currency/FixerIO.php index ec0f4cb10b..561cac7315 100644 --- a/app/Services/Currency/FixerIO.php +++ b/app/Services/Currency/FixerIO.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Services\Currency; use Carbon\Carbon; +use Exception; use FireflyIII\Models\CurrencyExchangeRate; use FireflyIII\Models\TransactionCurrency; use FireflyIII\User; use Log; use Requests; -use Requests_Exception; /** * Class FixerIO. @@ -53,7 +53,7 @@ class FixerIO implements ExchangeRateInterface $result = Requests::get($uri); $statusCode = $result->status_code; $body = $result->body; - } catch (Requests_Exception $e) { + } catch (Exception $e) { // don't care about error $body = sprintf('Requests_Exception: %s', $e->getMessage()); } @@ -69,7 +69,7 @@ class FixerIO implements ExchangeRateInterface } if (null !== $content) { $code = $toCurrency->code; - $rate = isset($content['rates'][$code]) ? $content['rates'][$code] : '1'; + $rate = $content['rates'][$code] ?? '1'; } // create new currency exchange rate object: diff --git a/app/Services/Currency/FixerIOv2.php b/app/Services/Currency/FixerIOv2.php index 12b9b76dbd..e037206fb4 100644 --- a/app/Services/Currency/FixerIOv2.php +++ b/app/Services/Currency/FixerIOv2.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace FireflyIII\Services\Currency; use Carbon\Carbon; +use Exception; use FireflyIII\Models\CurrencyExchangeRate; use FireflyIII\Models\TransactionCurrency; use FireflyIII\User; use Log; use Requests; -use Requests_Exception; /** * Class FixerIOv2. @@ -76,7 +76,7 @@ class FixerIOv2 implements ExchangeRateInterface $statusCode = $result->status_code; $body = $result->body; Log::debug(sprintf('Result status code is %d', $statusCode)); - } catch (Requests_Exception $e) { + } catch (Exception $e) { // don't care about error $body = sprintf('Requests_Exception: %s', $e->getMessage()); } @@ -92,11 +92,11 @@ class FixerIOv2 implements ExchangeRateInterface } if (null !== $content) { $code = $toCurrency->code; - $rate = $content['rates'][$code] ?? 0; + $rate = (float)($content['rates'][$code] ?? 0); } Log::debug('Got the following rates from Fixer: ', $content['rates'] ?? []); $exchangeRate->rate = $rate; - if ($rate !== 0) { + if ($rate !== 0.0) { $exchangeRate->save(); } diff --git a/app/Services/Github/Request/UpdateRequest.php b/app/Services/Github/Request/UpdateRequest.php index 6311adaae5..9fb0f212dd 100644 --- a/app/Services/Github/Request/UpdateRequest.php +++ b/app/Services/Github/Request/UpdateRequest.php @@ -60,10 +60,10 @@ class UpdateRequest implements GithubRequest if (isset($releaseXml->entry)) { foreach ($releaseXml->entry as $entry) { $array = [ - 'id' => strval($entry->id), - 'updated' => strval($entry->updated), - 'title' => strval($entry->title), - 'content' => strval($entry->content), + 'id' => (string)$entry->id, + 'updated' => (string)$entry->updated, + 'title' => (string)$entry->title, + 'content' => (string)$entry->content, ]; $this->releases[] = new Release($array); } diff --git a/app/Services/Internal/Support/AccountServiceTrait.php b/app/Services/Internal/Support/AccountServiceTrait.php index 3f06ad1f14..f126d66605 100644 --- a/app/Services/Internal/Support/AccountServiceTrait.php +++ b/app/Services/Internal/Support/AccountServiceTrait.php @@ -127,11 +127,10 @@ trait AccountServiceTrait * @param array $data * * @return TransactionJournal|null - * @throws \FireflyIII\Exceptions\FireflyException */ public function storeIBJournal(Account $account, array $data): ?TransactionJournal { - $amount = strval($data['openingBalance']); + $amount = (string)$data['openingBalance']; Log::debug(sprintf('Submitted amount is %s', $amount)); if (0 === bccomp($amount, '0')) { @@ -145,7 +144,7 @@ trait AccountServiceTrait 'type' => TransactionType::OPENING_BALANCE, 'user' => $account->user->id, 'transaction_currency_id' => $currencyId, - 'description' => strval(trans('firefly.initial_balance_description', ['account' => $account->name])), + 'description' => (string)trans('firefly.initial_balance_description', ['account' => $account->name]), 'completed' => true, 'date' => $data['openingBalanceDate'], 'bill_id' => null, @@ -232,7 +231,6 @@ trait AccountServiceTrait * @param array $data * * @return bool - * @throws \FireflyIII\Exceptions\FireflyException */ public function updateIB(Account $account, array $data): bool { @@ -268,9 +266,9 @@ trait AccountServiceTrait public function updateIBJournal(Account $account, TransactionJournal $journal, array $data): bool { $date = $data['openingBalanceDate']; - $amount = strval($data['openingBalance']); + $amount = (string)$data['openingBalance']; $negativeAmount = bcmul($amount, '-1'); - $currencyId = intval($data['currency_id']); + $currencyId = (int)$data['currency_id']; Log::debug(sprintf('Submitted amount for opening balance to update is "%s"', $amount)); if (0 === bccomp($amount, '0')) { @@ -291,13 +289,13 @@ trait AccountServiceTrait // update transactions: /** @var Transaction $transaction */ foreach ($journal->transactions()->get() as $transaction) { - if (intval($account->id) === intval($transaction->account_id)) { + if ((int)$account->id === (int)$transaction->account_id) { Log::debug(sprintf('Will (eq) change transaction #%d amount from "%s" to "%s"', $transaction->id, $transaction->amount, $amount)); $transaction->amount = $amount; $transaction->transaction_currency_id = $currencyId; $transaction->save(); } - if (!(intval($account->id) === intval($transaction->account_id))) { + if (!((int)$account->id === (int)$transaction->account_id)) { Log::debug(sprintf('Will (neq) change transaction #%d amount from "%s" to "%s"', $transaction->id, $transaction->amount, $negativeAmount)); $transaction->amount = $negativeAmount; $transaction->transaction_currency_id = $currencyId; @@ -383,9 +381,8 @@ trait AccountServiceTrait */ public function validIBData(array $data): bool { - $data['openingBalance'] = strval($data['openingBalance'] ?? ''); - if (isset($data['openingBalance']) && null !== $data['openingBalance'] && strlen($data['openingBalance']) > 0 - && isset($data['openingBalanceDate'])) { + $data['openingBalance'] = (string)($data['openingBalance'] ?? ''); + if (isset($data['openingBalance'], $data['openingBalanceDate']) && \strlen($data['openingBalance']) > 0) { Log::debug('Array has valid opening balance data.'); return true; diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php index 229eee646c..4ce551ecde 100644 --- a/app/Services/Internal/Support/JournalServiceTrait.php +++ b/app/Services/Internal/Support/JournalServiceTrait.php @@ -72,7 +72,7 @@ trait JournalServiceTrait $factory->setUser($journal->user); $bill = $factory->find($data['bill_id'], $data['bill_name']); - if (!is_null($bill)) { + if (null !== $bill) { $journal->bill_id = $bill->id; $journal->save(); @@ -110,10 +110,10 @@ trait JournalServiceTrait */ protected function storeNote(TransactionJournal $journal, ?string $notes): void { - $notes = strval($notes); + $notes = (string)$notes; if (strlen($notes) > 0) { $note = $journal->notes()->first(); - if (is_null($note)) { + if (null === $note) { $note = new Note; $note->noteable()->associate($journal); } @@ -123,7 +123,7 @@ trait JournalServiceTrait return; } $note = $journal->notes()->first(); - if (!is_null($note)) { + if (null !== $note) { $note->delete(); } diff --git a/app/Services/Internal/Support/TransactionServiceTrait.php b/app/Services/Internal/Support/TransactionServiceTrait.php index f14da605c0..7346c5cd98 100644 --- a/app/Services/Internal/Support/TransactionServiceTrait.php +++ b/app/Services/Internal/Support/TransactionServiceTrait.php @@ -104,12 +104,12 @@ trait TransactionServiceTrait */ public function findAccount(?string $expectedType, ?int $accountId, ?string $accountName): Account { - $accountId = intval($accountId); - $accountName = strval($accountName); + $accountId = (int)$accountId; + $accountName = (string)$accountName; $repository = app(AccountRepositoryInterface::class); $repository->setUser($this->user); - if (is_null($expectedType)) { + if (null === $expectedType) { return $repository->findNull($accountId); } @@ -215,7 +215,7 @@ trait TransactionServiceTrait */ protected function setBudget(Transaction $transaction, ?Budget $budget): void { - if (is_null($budget)) { + if (null === $budget) { $transaction->budgets()->sync([]); return; @@ -232,7 +232,7 @@ trait TransactionServiceTrait */ protected function setCategory(Transaction $transaction, ?Category $category): void { - if (is_null($category)) { + if (null === $category) { $transaction->categories()->sync([]); return; @@ -259,7 +259,7 @@ trait TransactionServiceTrait */ protected function setForeignCurrency(Transaction $transaction, ?TransactionCurrency $currency): void { - if (is_null($currency)) { + if (null === $currency) { $transaction->foreign_currency_id = null; $transaction->save(); diff --git a/app/Services/Internal/Update/AccountUpdateService.php b/app/Services/Internal/Update/AccountUpdateService.php index 1c57223155..c9711c0b46 100644 --- a/app/Services/Internal/Update/AccountUpdateService.php +++ b/app/Services/Internal/Update/AccountUpdateService.php @@ -41,7 +41,6 @@ class AccountUpdateService * @param array $data * * @return Account - * @throws \FireflyIII\Exceptions\FireflyException */ public function update(Account $account, array $data): Account { @@ -68,7 +67,7 @@ class AccountUpdateService // update note: if (isset($data['notes']) && null !== $data['notes']) { - $this->updateNote($account, strval($data['notes'])); + $this->updateNote($account, (string)$data['notes']); } return $account; diff --git a/app/Services/Internal/Update/BillUpdateService.php b/app/Services/Internal/Update/BillUpdateService.php index b17501bd55..69cf09f38d 100644 --- a/app/Services/Internal/Update/BillUpdateService.php +++ b/app/Services/Internal/Update/BillUpdateService.php @@ -45,7 +45,7 @@ class BillUpdateService $matchArray = explode(',', $data['match']); $matchArray = array_unique($matchArray); - $match = join(',', $matchArray); + $match = implode(',', $matchArray); $bill->name = $data['name']; $bill->match = $match; @@ -60,7 +60,7 @@ class BillUpdateService // update note: if (isset($data['notes']) && null !== $data['notes']) { - $this->updateNote($bill, strval($data['notes'])); + $this->updateNote($bill, (string)$data['notes']); } return $bill; diff --git a/app/Services/Internal/Update/TransactionUpdateService.php b/app/Services/Internal/Update/TransactionUpdateService.php index 6a31e71d06..c2f94d08e3 100644 --- a/app/Services/Internal/Update/TransactionUpdateService.php +++ b/app/Services/Internal/Update/TransactionUpdateService.php @@ -45,7 +45,7 @@ class TransactionUpdateService public function reconcile(int $transactionId): ?Transaction { $transaction = Transaction::find($transactionId); - if (!is_null($transaction)) { + if (null !== $transaction) { $transaction->reconciled = true; $transaction->save(); @@ -79,20 +79,20 @@ class TransactionUpdateService // update description: $transaction->description = $description; $foreignAmount = null; - if (floatval($transaction->amount) < 0) { + if ((float)$transaction->amount < 0) { // this is the source transaction. $type = $this->accountType($journal, 'source'); $account = $this->findAccount($type, $data['source_id'], $data['source_name']); - $amount = app('steam')->negative(strval($data['amount'])); - $foreignAmount = app('steam')->negative(strval($data['foreign_amount'])); + $amount = app('steam')->negative((string)$data['amount']); + $foreignAmount = app('steam')->negative((string)$data['foreign_amount']); } - if (floatval($transaction->amount) > 0) { + if ((float)$transaction->amount > 0) { // this is the destination transaction. $type = $this->accountType($journal, 'destination'); $account = $this->findAccount($type, $data['destination_id'], $data['destination_name']); - $amount = app('steam')->positive(strval($data['amount'])); - $foreignAmount = app('steam')->positive(strval($data['foreign_amount'])); + $amount = app('steam')->positive((string)$data['amount']); + $foreignAmount = app('steam')->positive((string)$data['foreign_amount']); } // update the actual transaction: @@ -107,11 +107,11 @@ class TransactionUpdateService // set foreign currency $foreign = $this->findCurrency($data['foreign_currency_id'], $data['foreign_currency_code']); // set foreign amount: - if (!is_null($data['foreign_amount']) && !is_null($foreign)) { + if (null !== $data['foreign_amount'] && null !== $foreign) { $this->setForeignCurrency($transaction, $foreign); $this->setForeignAmount($transaction, $foreignAmount); } - if (is_null($data['foreign_amount']) || is_null($foreign)) { + if (null === $data['foreign_amount'] || null === $foreign) { $this->setForeignCurrency($transaction, null); $this->setForeignAmount($transaction, null); } diff --git a/app/Services/Password/PwndVerifier.php b/app/Services/Password/PwndVerifier.php index b3ba550255..d5bc349253 100644 --- a/app/Services/Password/PwndVerifier.php +++ b/app/Services/Password/PwndVerifier.php @@ -22,9 +22,9 @@ declare(strict_types=1); namespace FireflyIII\Services\Password; +use Exception; use Log; use Requests; -use Requests_Exception; /** * Class PwndVerifier. @@ -46,7 +46,7 @@ class PwndVerifier implements Verifier try { $result = Requests::get($uri, ['originalPasswordIsAHash' => 'true'], $opt); - } catch (Requests_Exception $e) { + } catch (Exception $e) { return true; } Log::debug(sprintf('Status code returned is %d', $result->status_code)); diff --git a/app/Services/Password/PwndVerifierV2.php b/app/Services/Password/PwndVerifierV2.php index 09686d6a66..bf3cd330cf 100644 --- a/app/Services/Password/PwndVerifierV2.php +++ b/app/Services/Password/PwndVerifierV2.php @@ -22,9 +22,9 @@ declare(strict_types=1); namespace FireflyIII\Services\Password; +use Exception; use Log; use Requests; -use Requests_Exception; /** * Class PwndVerifierV2. @@ -51,7 +51,7 @@ class PwndVerifierV2 implements Verifier try { $result = Requests::get($uri, $opt); - } catch (Requests_Exception $e) { + } catch (Exception $e) { return true; } Log::debug(sprintf('Status code returned is %d', $result->status_code)); diff --git a/app/Services/Spectre/Object/Customer.php b/app/Services/Spectre/Object/Customer.php index 755dcfc38d..36a08a3ccf 100644 --- a/app/Services/Spectre/Object/Customer.php +++ b/app/Services/Spectre/Object/Customer.php @@ -41,7 +41,7 @@ class Customer extends SpectreObject */ public function __construct(array $data) { - $this->id = intval($data['id']); + $this->id = (int)$data['id']; $this->identifier = $data['identifier']; $this->secret = $data['secret']; } diff --git a/app/Services/Spectre/Object/Transaction.php b/app/Services/Spectre/Object/Transaction.php index ecb7bcc671..296631915f 100644 --- a/app/Services/Spectre/Object/Transaction.php +++ b/app/Services/Spectre/Object/Transaction.php @@ -84,7 +84,7 @@ class Transaction extends SpectreObject */ public function getAmount(): string { - return strval($this->amount); + return (string)$this->amount; } /** @@ -124,7 +124,7 @@ class Transaction extends SpectreObject */ public function getHash(): string { - $array = [ + $array = [ 'id' => $this->id, 'mode' => $this->mode, 'status' => $this->status, @@ -139,9 +139,8 @@ class Transaction extends SpectreObject 'created_at' => $this->createdAt->toIso8601String(), 'updated_at' => $this->updatedAt->toIso8601String(), ]; - $hashed = hash('sha256', json_encode($array)); - return $hashed; + return hash('sha256', json_encode($array)); } /** diff --git a/app/Services/Spectre/Object/TransactionExtra.php b/app/Services/Spectre/Object/TransactionExtra.php index ab0f0e9233..01538c1bd1 100644 --- a/app/Services/Spectre/Object/TransactionExtra.php +++ b/app/Services/Spectre/Object/TransactionExtra.php @@ -136,9 +136,9 @@ class TransactionExtra extends SpectreObject 'id' => $this->id, 'record_number' => $this->recordNumber, 'information' => $this->information, - 'time' => is_null($this->time) ? null : $this->time->toIso8601String(), - 'posting_date' => is_null($this->postingDate) ? null : $this->postingDate->toIso8601String(), - 'posting_time' => is_null($this->postingTime) ? null : $this->postingTime->toIso8601String(), + 'time' => null === $this->time ? null : $this->time->toIso8601String(), + 'posting_date' => null === $this->postingDate ? null : $this->postingDate->toIso8601String(), + 'posting_time' => null === $this->postingTime ? null : $this->postingTime->toIso8601String(), 'account_number' => $this->accountNumber, 'original_amount' => $this->originalAmount, 'original_currency_code' => $this->originalCurrencyCode, diff --git a/app/Services/Spectre/Request/ListAccountsRequest.php b/app/Services/Spectre/Request/ListAccountsRequest.php index 660fc0cf4c..86a3700400 100644 --- a/app/Services/Spectre/Request/ListAccountsRequest.php +++ b/app/Services/Spectre/Request/ListAccountsRequest.php @@ -58,7 +58,7 @@ class ListAccountsRequest extends SpectreRequest // extract next ID $hasNextPage = false; - if (isset($response['meta']['next_id']) && intval($response['meta']['next_id']) > $nextId) { + if (isset($response['meta']['next_id']) && (int)$response['meta']['next_id'] > $nextId) { $hasNextPage = true; $nextId = $response['meta']['next_id']; Log::debug(sprintf('Next ID is now %d.', $nextId)); diff --git a/app/Services/Spectre/Request/ListCustomersRequest.php b/app/Services/Spectre/Request/ListCustomersRequest.php index 62f3ca9c7d..5d06f0d862 100644 --- a/app/Services/Spectre/Request/ListCustomersRequest.php +++ b/app/Services/Spectre/Request/ListCustomersRequest.php @@ -55,7 +55,7 @@ class ListCustomersRequest extends SpectreRequest // extract next ID $hasNextPage = false; - if (isset($response['meta']['next_id']) && intval($response['meta']['next_id']) > $nextId) { + if (isset($response['meta']['next_id']) && (int)$response['meta']['next_id'] > $nextId) { $hasNextPage = true; $nextId = $response['meta']['next_id']; Log::debug(sprintf('Next ID is now %d.', $nextId)); diff --git a/app/Services/Spectre/Request/ListLoginsRequest.php b/app/Services/Spectre/Request/ListLoginsRequest.php index 14b9761a6b..d2e87c2a7d 100644 --- a/app/Services/Spectre/Request/ListLoginsRequest.php +++ b/app/Services/Spectre/Request/ListLoginsRequest.php @@ -58,7 +58,7 @@ class ListLoginsRequest extends SpectreRequest // extract next ID $hasNextPage = false; - if (isset($response['meta']['next_id']) && intval($response['meta']['next_id']) > $nextId) { + if (isset($response['meta']['next_id']) && (int)$response['meta']['next_id'] > $nextId) { $hasNextPage = true; $nextId = $response['meta']['next_id']; Log::debug(sprintf('Next ID is now %d.', $nextId)); diff --git a/app/Services/Spectre/Request/ListTransactionsRequest.php b/app/Services/Spectre/Request/ListTransactionsRequest.php index f162bf22b3..f662ed436c 100644 --- a/app/Services/Spectre/Request/ListTransactionsRequest.php +++ b/app/Services/Spectre/Request/ListTransactionsRequest.php @@ -58,7 +58,7 @@ class ListTransactionsRequest extends SpectreRequest // extract next ID $hasNextPage = false; - if (isset($response['meta']['next_id']) && intval($response['meta']['next_id']) > $nextId) { + if (isset($response['meta']['next_id']) && (int)$response['meta']['next_id'] > $nextId) { $hasNextPage = true; $nextId = $response['meta']['next_id']; Log::debug(sprintf('Next ID is now %d.', $nextId)); diff --git a/app/Services/Spectre/Request/SpectreRequest.php b/app/Services/Spectre/Request/SpectreRequest.php index 772bb52c39..93eb8a5ebd 100644 --- a/app/Services/Spectre/Request/SpectreRequest.php +++ b/app/Services/Spectre/Request/SpectreRequest.php @@ -22,12 +22,11 @@ declare(strict_types=1); namespace FireflyIII\Services\Spectre\Request; +use Exception; use FireflyIII\Exceptions\FireflyException; -use FireflyIII\Services\Spectre\Exception\SpectreException; use FireflyIII\User; use Log; use Requests; -use Requests_Exception; use Requests_Response; /** @@ -44,9 +43,9 @@ abstract class SpectreRequest /** @var string */ protected $serviceSecret = ''; /** @var string */ - private $privateKey = ''; + private $privateKey; /** @var string */ - private $server = ''; + private $server; /** @var User */ private $user; @@ -198,11 +197,11 @@ abstract class SpectreRequest Log::debug('Final headers for spectre signed get request:', $headers); try { $response = Requests::get($fullUri, $headers); - } catch (Requests_Exception $e) { + } catch (Exception $e) { throw new FireflyException(sprintf('Request Exception: %s', $e->getMessage())); } $this->detectError($response); - $statusCode = intval($response->status_code); + $statusCode = (int)$response->status_code; $body = $response->body; $array = json_decode($body, true); @@ -241,7 +240,7 @@ abstract class SpectreRequest Log::debug('Final headers for spectre signed POST request:', $headers); try { $response = Requests::post($fullUri, $headers, $body); - } catch (Requests_Exception $e) { + } catch (Exception $e) { throw new FireflyException(sprintf('Request Exception: %s', $e->getMessage())); } $this->detectError($response); @@ -274,7 +273,7 @@ abstract class SpectreRequest throw new FireflyException(sprintf('Error of class %s: %s', $errorClass, $message)); } - $statusCode = intval($response->status_code); + $statusCode = (int)$response->status_code; if (200 !== $statusCode) { throw new FireflyException(sprintf('Status code %d: %s', $statusCode, $response->body)); } diff --git a/app/Support/Amount.php b/app/Support/Amount.php index 5feec11237..5426d27ece 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -123,7 +123,7 @@ class Amount setlocale(LC_MONETARY, $locale); $float = round($amount, 12); $info = localeconv(); - $formatted = number_format($float, intval($format->decimal_places), $info['mon_decimal_point'], $info['mon_thousands_sep']); + $formatted = number_format($float, (int)$format->decimal_places, $info['mon_decimal_point'], $info['mon_thousands_sep']); // some complicated switches to format the amount correctly: $precedes = $amount < 0 ? $info['n_cs_precedes'] : $info['p_cs_precedes']; diff --git a/app/Support/Binder/AccountList.php b/app/Support/Binder/AccountList.php index 2cf2052cad..085a7a43de 100644 --- a/app/Support/Binder/AccountList.php +++ b/app/Support/Binder/AccountList.php @@ -47,7 +47,7 @@ class AccountList implements BinderInterface $list = []; $incoming = explode(',', $value); foreach ($incoming as $entry) { - $list[] = intval($entry); + $list[] = (int)$entry; } $list = array_unique($list); if (count($list) === 0) { diff --git a/app/Support/Binder/BudgetList.php b/app/Support/Binder/BudgetList.php index 26ba5a927f..2db96e1c51 100644 --- a/app/Support/Binder/BudgetList.php +++ b/app/Support/Binder/BudgetList.php @@ -45,7 +45,7 @@ class BudgetList implements BinderInterface $list = []; $incoming = explode(',', $value); foreach ($incoming as $entry) { - $list[] = intval($entry); + $list[] = (int)$entry; } $list = array_unique($list); if (count($list) === 0) { diff --git a/app/Support/Binder/CategoryList.php b/app/Support/Binder/CategoryList.php index 11a88681c2..c8aa6c2cae 100644 --- a/app/Support/Binder/CategoryList.php +++ b/app/Support/Binder/CategoryList.php @@ -45,7 +45,7 @@ class CategoryList implements BinderInterface $list = []; $incoming = explode(',', $value); foreach ($incoming as $entry) { - $list[] = intval($entry); + $list[] = (int)$entry; } $list = array_unique($list); if (count($list) === 0) { diff --git a/app/Support/Binder/JournalList.php b/app/Support/Binder/JournalList.php index df130fd200..b58133bc3f 100644 --- a/app/Support/Binder/JournalList.php +++ b/app/Support/Binder/JournalList.php @@ -44,7 +44,7 @@ class JournalList implements BinderInterface $list = []; $incoming = explode(',', $value); foreach ($incoming as $entry) { - $list[] = intval($entry); + $list[] = (int)$entry; } $list = array_unique($list); if (count($list) === 0) { diff --git a/app/Support/Binder/UnfinishedJournal.php b/app/Support/Binder/UnfinishedJournal.php index f14fdf526f..b255144d8a 100644 --- a/app/Support/Binder/UnfinishedJournal.php +++ b/app/Support/Binder/UnfinishedJournal.php @@ -45,7 +45,7 @@ class UnfinishedJournal implements BinderInterface ->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id') ->where('completed', 0) ->where('user_id', auth()->user()->id)->first(['transaction_journals.*']); - if (!is_null($journal)) { + if (null !== $journal) { return $journal; } } diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index 5f4210e65c..a1707ed1d0 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -46,7 +46,6 @@ class ExpandedForm * * @return string * @throws \FireflyIII\Exceptions\FireflyException - * @throws \Throwable */ public function amount(string $name, $value = null, array $options = []): string { @@ -60,7 +59,6 @@ class ExpandedForm * * @return string * @throws \FireflyIII\Exceptions\FireflyException - * @throws \Throwable */ public function amountSmall(string $name, $value = null, array $options = []): string { @@ -73,7 +71,6 @@ class ExpandedForm * @param array $options * * @return string - * @throws \Throwable */ public function assetAccountList(string $name, $value = null, array $options = []): string { @@ -100,17 +97,17 @@ class ExpandedForm /** @var Account $account */ foreach ($assetAccounts as $account) { $balance = app('steam')->balance($account, new Carbon); - $currencyId = intval($account->getMeta('currency_id')); + $currencyId = (int)$account->getMeta('currency_id'); $currency = $currencyRepos->findNull($currencyId); $role = $account->getMeta('accountRole'); if (0 === strlen($role)) { $role = 'no_account_type'; // @codeCoverageIgnore } - if (is_null($currency)) { + if (null === $currency) { $currency = $defaultCurrency; } - $key = strval(trans('firefly.opt_group_' . $role)); + $key = (string)trans('firefly.opt_group_' . $role); $grouped[$key][$account->id] = $account->name . ' (' . app('amount')->formatAnything($currency, $balance, false) . ')'; } $res = $this->select($name, $grouped, $value, $options); @@ -126,7 +123,6 @@ class ExpandedForm * * @return string * @throws \FireflyIII\Exceptions\FireflyException - * @throws \Throwable */ public function balance(string $name, $value = null, array $options = []): string { @@ -141,7 +137,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function checkbox(string $name, $value = 1, $checked = null, $options = []): string { @@ -165,7 +161,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function date(string $name, $value = null, array $options = []): string { @@ -185,7 +181,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function file(string $name, array $options = []): string { @@ -204,7 +200,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function integer(string $name, $value = null, array $options = []): string { @@ -225,7 +221,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function location(string $name, $value = null, array $options = []): string { @@ -251,7 +247,7 @@ class ExpandedForm $fields = ['title', 'name', 'description']; /** @var Eloquent $entry */ foreach ($set as $entry) { - $entryId = intval($entry->id); + $entryId = (int)$entry->id; $title = null; foreach ($fields as $field) { @@ -277,7 +273,7 @@ class ExpandedForm $fields = ['title', 'name', 'description']; /** @var Eloquent $entry */ foreach ($set as $entry) { - $entryId = intval($entry->id); + $entryId = (int)$entry->id; $title = null; foreach ($fields as $field) { @@ -299,7 +295,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function multiCheckbox(string $name, array $list = [], $selected = null, array $options = []): string { @@ -322,7 +318,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function multiRadio(string $name, array $list = [], $selected = null, array $options = []): string { @@ -344,7 +340,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function nonSelectableAmount(string $name, $value = null, array $options = []): string { @@ -353,7 +349,7 @@ class ExpandedForm $classes = $this->getHolderClasses($name); $value = $this->fillFieldValue($name, $value); $options['step'] = 'any'; - $selectedCurrency = isset($options['currency']) ? $options['currency'] : Amt::getDefaultCurrency(); + $selectedCurrency = $options['currency'] ?? Amt::getDefaultCurrency(); unset($options['currency'], $options['placeholder']); // make sure value is formatted nicely: @@ -373,7 +369,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function nonSelectableBalance(string $name, $value = null, array $options = []): string { @@ -382,7 +378,7 @@ class ExpandedForm $classes = $this->getHolderClasses($name); $value = $this->fillFieldValue($name, $value); $options['step'] = 'any'; - $selectedCurrency = isset($options['currency']) ? $options['currency'] : Amt::getDefaultCurrency(); + $selectedCurrency = $options['currency'] ?? Amt::getDefaultCurrency(); unset($options['currency'], $options['placeholder']); // make sure value is formatted nicely: @@ -403,7 +399,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function number(string $name, $value = null, array $options = []): string { @@ -425,7 +421,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function optionsList(string $type, string $name): string { @@ -437,7 +433,7 @@ class ExpandedForm // don't care } - $previousValue = null === $previousValue ? 'store' : $previousValue; + $previousValue = $previousValue ?? 'store'; $html = view('form.options', compact('type', 'name', 'previousValue'))->render(); return $html; @@ -449,14 +445,14 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function password(string $name, array $options = []): string { $label = $this->label($name, $options); $options = $this->expandOptionArray($name, $label, $options); $classes = $this->getHolderClasses($name); - $html = view('form.password', compact('classes', 'name', 'label', 'value', 'options'))->render(); + $html = view('form.password', compact('classes', 'name', 'label', 'options'))->render(); return $html; } @@ -469,7 +465,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function select(string $name, array $list = [], $selected = null, array $options = []): string { @@ -490,7 +486,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function staticText(string $name, $value, array $options = []): string { @@ -509,7 +505,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function tags(string $name, $value = null, array $options = []): string { @@ -530,7 +526,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function text(string $name, $value = null, array $options = []): string { @@ -550,7 +546,7 @@ class ExpandedForm * * @return string * - * @throws \Throwable + */ public function textarea(string $name, $value = null, array $options = []): string { @@ -640,7 +636,7 @@ class ExpandedForm } $name = str_replace('[]', '', $name); - return strval(trans('form.' . $name)); + return (string)trans('form.' . $name); } /** @@ -652,7 +648,6 @@ class ExpandedForm * @return string * * @throws \FireflyIII\Exceptions\FireflyException - * @throws \Throwable */ private function currencyField(string $name, string $view, $value = null, array $options = []): string { @@ -661,14 +656,14 @@ class ExpandedForm $classes = $this->getHolderClasses($name); $value = $this->fillFieldValue($name, $value); $options['step'] = 'any'; - $defaultCurrency = isset($options['currency']) ? $options['currency'] : Amt::getDefaultCurrency(); + $defaultCurrency = $options['currency'] ?? Amt::getDefaultCurrency(); $currencies = app('amount')->getAllCurrencies(); unset($options['currency'], $options['placeholder']); // perhaps the currency has been sent to us in the field $amount_currency_id_$name (amount_currency_id_amount) $preFilled = session('preFilled'); $key = 'amount_currency_id_' . $name; - $sentCurrencyId = isset($preFilled[$key]) ? intval($preFilled[$key]) : $defaultCurrency->id; + $sentCurrencyId = isset($preFilled[$key]) ? (int)$preFilled[$key] : $defaultCurrency->id; // find this currency in set of currencies: foreach ($currencies as $currency) { diff --git a/app/Support/FireflyConfig.php b/app/Support/FireflyConfig.php index c74febbc69..19b8feca8a 100644 --- a/app/Support/FireflyConfig.php +++ b/app/Support/FireflyConfig.php @@ -36,7 +36,7 @@ class FireflyConfig * * @return bool * - * @throws \Exception + */ public function delete($name): bool { diff --git a/app/Support/Import/Configuration/Bunq/HaveAccounts.php b/app/Support/Import/Configuration/Bunq/HaveAccounts.php index 8dc16ccf7e..7a0db86d2a 100644 --- a/app/Support/Import/Configuration/Bunq/HaveAccounts.php +++ b/app/Support/Import/Configuration/Bunq/HaveAccounts.php @@ -57,11 +57,11 @@ class HaveAccounts implements ConfigurationInterface /** @var Account $dbAccount */ foreach ($collection as $dbAccount) { $id = $dbAccount->id; - $currencyId = intval($accountRepository->getMetaValue($dbAccount, 'currency_id')); + $currencyId = (int)$accountRepository->getMetaValue($dbAccount, 'currency_id'); $currency = $currencyRepository->findNull($currencyId); $dbAccounts[$id] = [ 'account' => $dbAccount, - 'currency' => is_null($currency) ? $defaultCurrency : $currency, + 'currency' => null === $currency ? $defaultCurrency : $currency, ]; } @@ -78,11 +78,9 @@ class HaveAccounts implements ConfigurationInterface } - $data = [ + return [ 'config' => $config, ]; - - return $data; } /** @@ -119,9 +117,9 @@ class HaveAccounts implements ConfigurationInterface $accounts = $data['bunq_account_id'] ?? []; $mapping = []; foreach ($accounts as $bunqId) { - $bunqId = intval($bunqId); - $doImport = intval($data['do_import'][$bunqId] ?? 0) === 1; - $account = intval($data['import'][$bunqId] ?? 0); + $bunqId = (int)$bunqId; + $doImport = (int)($data['do_import'][$bunqId] ?? 0.0) === 1; + $account = (int)($data['import'][$bunqId] ?? 0.0); if ($doImport) { $mapping[$bunqId] = $account; } diff --git a/app/Support/Import/Configuration/File/Initial.php b/app/Support/Import/Configuration/File/Initial.php index 615a72e9f0..e9232c12a5 100644 --- a/app/Support/Import/Configuration/File/Initial.php +++ b/app/Support/Import/Configuration/File/Initial.php @@ -102,7 +102,7 @@ class Initial implements ConfigurationInterface Log::debug('Now in storeConfiguration for file Upload.'); $config = $this->getConfig(); $type = $data['import_file_type'] ?? 'csv'; // assume it's a CSV file. - $config['file-type'] = in_array($type, config('import.options.file.import_formats')) ? $type : 'csv'; + $config['file-type'] = \in_array($type, config('import.options.file.import_formats'), true) ? $type : 'csv'; // update config: $this->repository->setConfiguration($this->job, $config); @@ -118,7 +118,7 @@ class Initial implements ConfigurationInterface } if (false === $uploaded) { - $this->warning = 'No valid upload.'; + $this->warning = (string)trans('firefly.upload_error'); return true; } diff --git a/app/Support/Import/Configuration/File/Map.php b/app/Support/Import/Configuration/File/Map.php index 670f3c8dbf..2cf3ef4b39 100644 --- a/app/Support/Import/Configuration/File/Map.php +++ b/app/Support/Import/Configuration/File/Map.php @@ -159,12 +159,12 @@ class Map implements ConfigurationInterface $config = $this->getConfig(); if (isset($data['mapping'])) { - foreach ($data['mapping'] as $index => $data) { + foreach ($data['mapping'] as $index => $array) { $config['column-mapping-config'][$index] = []; - foreach ($data as $value => $mapId) { - $mapId = intval($mapId); + foreach ($array as $value => $mapId) { + $mapId = (int)$mapId; if (0 !== $mapId) { - $config['column-mapping-config'][$index][$value] = intval($mapId); + $config['column-mapping-config'][$index][$value] = $mapId; } } } @@ -186,10 +186,8 @@ class Map implements ConfigurationInterface { $mapperClass = config('csv.import_roles.' . $column . '.mapper'); $mapperName = sprintf('\\FireflyIII\\Import\Mapper\\%s', $mapperClass); - /** @var MapperInterface $mapper */ - $mapper = app($mapperName); - return $mapper; + return app($mapperName); } /** diff --git a/app/Support/Import/Configuration/File/Roles.php b/app/Support/Import/Configuration/File/Roles.php index 3b33805840..2877621c32 100644 --- a/app/Support/Import/Configuration/File/Roles.php +++ b/app/Support/Import/Configuration/File/Roles.php @@ -73,7 +73,7 @@ class Roles implements ConfigurationInterface } // example rows: - $stmt = (new Statement)->limit(intval(config('csv.example_rows', 5)))->offset($offset); + $stmt = (new Statement)->limit((int)config('csv.example_rows', 5))->offset($offset); // set data: $roles = $this->getRoles(); asort($roles); @@ -274,14 +274,14 @@ class Roles implements ConfigurationInterface } // warn if has foreign amount but no currency code: if ($hasForeignAmount && !$hasForeignCode) { - $this->warning = strval(trans('import.foreign_amount_warning')); + $this->warning = (string)trans('import.foreign_amount_warning'); Log::debug('isRolesComplete() returns FALSE because foreign amount present without foreign code.'); return false; } if (0 === $assigned || !$hasAmount) { - $this->warning = strval(trans('import.roles_warning')); + $this->warning = (string)trans('import.roles_warning'); Log::debug('isRolesComplete() returns FALSE because no amount present.'); return false; diff --git a/app/Support/Import/Configuration/File/UploadConfig.php b/app/Support/Import/Configuration/File/UploadConfig.php index 9dd8309554..8a0d6dbc07 100644 --- a/app/Support/Import/Configuration/File/UploadConfig.php +++ b/app/Support/Import/Configuration/File/UploadConfig.php @@ -114,16 +114,16 @@ class UploadConfig implements ConfigurationInterface { Log::debug('Now in Initial::storeConfiguration()'); $config = $this->getConfig(); - $importId = intval($data['csv_import_account'] ?? 0); + $importId = (int)($data['csv_import_account'] ?? 0.0); $account = $this->accountRepository->find($importId); - $delimiter = strval($data['csv_delimiter']); + $delimiter = (string)$data['csv_delimiter']; // set "headers": - $config['has-headers'] = intval($data['has_headers'] ?? 0) === 1; - $config['date-format'] = strval($data['date_format']); + $config['has-headers'] = (int)($data['has_headers'] ?? 0.0) === 1; + $config['date-format'] = (string)$data['date_format']; $config['delimiter'] = 'tab' === $delimiter ? "\t" : $delimiter; - $config['apply-rules'] = intval($data['apply_rules'] ?? 0) === 1; - $config['match-bills'] = intval($data['match_bills'] ?? 0) === 1; + $config['apply-rules'] = (int)($data['apply_rules'] ?? 0.0) === 1; + $config['match-bills'] = (int)($data['match_bills'] ?? 0.0) === 1; Log::debug('Entered import account.', ['id' => $importId]); diff --git a/app/Support/Import/Configuration/Spectre/HaveAccounts.php b/app/Support/Import/Configuration/Spectre/HaveAccounts.php index d4db42118e..2219748065 100644 --- a/app/Support/Import/Configuration/Spectre/HaveAccounts.php +++ b/app/Support/Import/Configuration/Spectre/HaveAccounts.php @@ -58,11 +58,11 @@ class HaveAccounts implements ConfigurationInterface /** @var Account $dbAccount */ foreach ($collection as $dbAccount) { $id = $dbAccount->id; - $currencyId = intval($dbAccount->getMeta('currency_id')); + $currencyId = (int)$dbAccount->getMeta('currency_id'); $currency = $currencyRepository->find($currencyId); $dbAccounts[$id] = [ 'account' => $dbAccount, - 'currency' => is_null($currency->id) ? $defaultCurrency : $currency, + 'currency' => null === $currency->id ? $defaultCurrency : $currency, ]; } @@ -79,12 +79,9 @@ class HaveAccounts implements ConfigurationInterface } - $data = [ + return [ 'config' => $config, ]; - - - return $data; } /** @@ -121,9 +118,9 @@ class HaveAccounts implements ConfigurationInterface $accounts = $data['spectre_account_id'] ?? []; $mapping = []; foreach ($accounts as $spectreId) { - $spectreId = intval($spectreId); - $doImport = intval($data['do_import'][$spectreId] ?? 0) === 1; - $account = intval($data['import'][$spectreId] ?? 0); + $spectreId = (int)$spectreId; + $doImport = (int)($data['do_import'][$spectreId] ?? 0.0) === 1; + $account = (int)($data['import'][$spectreId] ?? 0.0); if ($doImport) { $mapping[$spectreId] = $account; } diff --git a/app/Support/Import/Information/BunqInformation.php b/app/Support/Import/Information/BunqInformation.php index ab12faf500..76356bbef3 100644 --- a/app/Support/Import/Information/BunqInformation.php +++ b/app/Support/Import/Information/BunqInformation.php @@ -63,7 +63,6 @@ class BunqInformation implements InformationInterface * @return array * * @throws FireflyException - * @throws \Exception */ public function getAccounts(): array { @@ -117,7 +116,7 @@ class BunqInformation implements InformationInterface /** * @param SessionToken $sessionToken * - * @throws \Exception + */ private function closeSession(SessionToken $sessionToken): void { @@ -141,7 +140,7 @@ class BunqInformation implements InformationInterface * * @return Collection * - * @throws \Exception + */ private function getMonetaryAccounts(SessionToken $sessionToken, int $userId): Collection { @@ -166,7 +165,6 @@ class BunqInformation implements InformationInterface * @return int * * @throws FireflyException - * @throws \Exception */ private function getUserInformation(SessionToken $sessionToken): int { @@ -194,7 +192,7 @@ class BunqInformation implements InformationInterface /** * @return SessionToken * - * @throws \Exception + */ private function startSession(): SessionToken { diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 8390252ad5..9c1fe63c02 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -91,7 +91,7 @@ class Navigation public function blockPeriods(\Carbon\Carbon $start, \Carbon\Carbon $end, string $range): array { if ($end < $start) { - list($start, $end) = [$end, $start]; + [$start, $end] = [$end, $start]; } $periods = []; /* @@ -262,17 +262,17 @@ class Navigation // define period to increment $increment = 'addDay'; $format = $this->preferredCarbonFormat($start, $end); - $displayFormat = strval(trans('config.month_and_day')); + $displayFormat = (string)trans('config.month_and_day'); // increment by month (for year) if ($start->diffInMonths($end) > 1) { $increment = 'addMonth'; - $displayFormat = strval(trans('config.month')); + $displayFormat = (string)trans('config.month'); } // increment by year (for multi year) if ($start->diffInMonths($end) > 12) { $increment = 'addYear'; - $displayFormat = strval(trans('config.year')); + $displayFormat = (string)trans('config.year'); } $begin = clone $start; @@ -316,7 +316,7 @@ class Navigation ]; if (isset($formatMap[$repeatFrequency])) { - return $date->formatLocalized(strval($formatMap[$repeatFrequency])); + return $date->formatLocalized((string)$formatMap[$repeatFrequency]); } if ('3M' === $repeatFrequency || 'quarter' === $repeatFrequency) { $quarter = ceil($theDate->month / 3); @@ -362,13 +362,13 @@ class Navigation */ public function preferredCarbonLocalizedFormat(Carbon $start, Carbon $end): string { - $format = strval(trans('config.month_and_day')); + $format = (string)trans('config.month_and_day'); if ($start->diffInMonths($end) > 1) { - $format = strval(trans('config.month')); + $format = (string)trans('config.month'); } if ($start->diffInMonths($end) > 12) { - $format = strval(trans('config.year')); + $format = (string)trans('config.year'); } return $format; diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index 1f7048c922..9acd6163fc 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -27,6 +27,7 @@ use Exception; use FireflyIII\Models\Preference; use FireflyIII\User; use Illuminate\Support\Collection; +use Log; use Session; /** @@ -74,9 +75,7 @@ class Preferences */ public function findByName(string $name): Collection { - $set = Preference::where('name', $name)->get(); - - return $set; + return Preference::where('name', $name)->get(); } /** @@ -134,6 +133,14 @@ class Preferences } $preference = Preference::where('user_id', $user->id)->where('name', $name)->first(['id', 'name', 'data']); + if (null !== $preference && null === $preference->data) { + try { + $preference->delete(); + } catch (Exception $e) { + Log::debug(sprintf('Could not delete preference #%d', $preference->id)); + } + $preference = false; + } if ($preference) { Cache::forever($fullName, $preference); @@ -156,10 +163,10 @@ class Preferences { $lastActivity = microtime(); $preference = $this->get('lastActivity', microtime()); - if (null !== $preference) { + if (null !== $preference && null !== $preference->data) { $lastActivity = $preference->data; } - if (is_array($lastActivity)) { + if (\is_array($lastActivity)) { $lastActivity = implode(',', $lastActivity); } diff --git a/app/Support/Search/Modifier.php b/app/Support/Search/Modifier.php index afce3946c8..6ac782f818 100644 --- a/app/Support/Search/Modifier.php +++ b/app/Support/Search/Modifier.php @@ -166,11 +166,11 @@ class Modifier { $journalBudget = ''; if (null !== $transaction->transaction_journal_budget_name) { - $journalBudget = Steam::decrypt(intval($transaction->transaction_journal_budget_encrypted), $transaction->transaction_journal_budget_name); + $journalBudget = Steam::decrypt((int)$transaction->transaction_journal_budget_encrypted, $transaction->transaction_journal_budget_name); } $transactionBudget = ''; if (null !== $transaction->transaction_budget_name) { - $journalBudget = Steam::decrypt(intval($transaction->transaction_budget_encrypted), $transaction->transaction_budget_name); + $journalBudget = Steam::decrypt((int)$transaction->transaction_budget_encrypted, $transaction->transaction_budget_name); } return self::stringCompare($journalBudget, $search) || self::stringCompare($transactionBudget, $search); @@ -186,11 +186,11 @@ class Modifier { $journalCategory = ''; if (null !== $transaction->transaction_journal_category_name) { - $journalCategory = Steam::decrypt(intval($transaction->transaction_journal_category_encrypted), $transaction->transaction_journal_category_name); + $journalCategory = Steam::decrypt((int)$transaction->transaction_journal_category_encrypted, $transaction->transaction_journal_category_name); } $transactionCategory = ''; if (null !== $transaction->transaction_category_name) { - $journalCategory = Steam::decrypt(intval($transaction->transaction_category_encrypted), $transaction->transaction_category_name); + $journalCategory = Steam::decrypt((int)$transaction->transaction_category_encrypted, $transaction->transaction_category_name); } return self::stringCompare($journalCategory, $search) || self::stringCompare($transactionCategory, $search); diff --git a/app/Support/Search/Search.php b/app/Support/Search/Search.php index 30c259200d..2b21f7bfb9 100644 --- a/app/Support/Search/Search.php +++ b/app/Support/Search/Search.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace FireflyIII\Support\Search; use Carbon\Carbon; -use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Collector\JournalCollectorInterface; use FireflyIII\Helpers\Filter\InternalTransferFilter; use FireflyIII\Models\Transaction; @@ -45,7 +44,7 @@ class Search implements SearchInterface /** @var User */ private $user; /** @var array */ - private $validModifiers = []; + private $validModifiers; /** @var array */ private $words = []; @@ -63,7 +62,7 @@ class Search implements SearchInterface */ public function getWordsAsString(): string { - $string = join(' ', $this->words); + $string = implode(' ', $this->words); if (0 === strlen($string)) { return is_string($this->originalQuery) ? $this->originalQuery : ''; } @@ -196,19 +195,19 @@ class Search implements SearchInterface switch ($modifier['type']) { case 'amount_is': case 'amount': - $amount = app('steam')->positive(strval($modifier['value'])); + $amount = app('steam')->positive((string)$modifier['value']); Log::debug(sprintf('Set "%s" using collector with value "%s"', $modifier['type'], $amount)); $collector->amountIs($amount); break; case 'amount_max': case 'amount_less': - $amount = app('steam')->positive(strval($modifier['value'])); + $amount = app('steam')->positive((string)$modifier['value']); Log::debug(sprintf('Set "%s" using collector with value "%s"', $modifier['type'], $amount)); $collector->amountLess($amount); break; case 'amount_min': case 'amount_more': - $amount = app('steam')->positive(strval($modifier['value'])); + $amount = app('steam')->positive((string)$modifier['value']); Log::debug(sprintf('Set "%s" using collector with value "%s"', $modifier['type'], $amount)); $collector->amountMore($amount); break; @@ -246,9 +245,9 @@ class Search implements SearchInterface private function extractModifier(string $string) { $parts = explode(':', $string); - if (2 === count($parts) && strlen(trim(strval($parts[0]))) > 0 && strlen(trim(strval($parts[1])))) { - $type = trim(strval($parts[0])); - $value = trim(strval($parts[1])); + if (2 === count($parts) && strlen(trim((string)$parts[0])) > 0 && strlen(trim((string)$parts[1]))) { + $type = trim((string)$parts[0]); + $value = trim((string)$parts[1]); if (in_array($type, $this->validModifiers)) { // filter for valid type $this->modifiers->push(['type' => $type, 'value' => $value]); @@ -268,8 +267,8 @@ class Search implements SearchInterface // first "modifier" is always the text of the search: // check descr of journal: if (count($this->words) > 0 - && !$this->strposArray(strtolower(strval($transaction->description)), $this->words) - && !$this->strposArray(strtolower(strval($transaction->transaction_description)), $this->words) + && !$this->strposArray(strtolower((string)$transaction->description), $this->words) + && !$this->strposArray(strtolower((string)$transaction->transaction_description), $this->words) ) { Log::debug('Description does not match', $this->words); diff --git a/app/Support/Steam.php b/app/Support/Steam.php index ffdd0c6be4..d6d998b9ff 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -51,32 +51,28 @@ class Steam if ($cache->has()) { return $cache->get(); // @codeCoverageIgnore } - $currencyId = intval($account->getMeta('currency_id')); + $currencyId = (int)$account->getMeta('currency_id'); // use system default currency: if (0 === $currencyId) { $currency = app('amount')->getDefaultCurrencyByUser($account->user); $currencyId = $currency->id; } // first part: get all balances in own currency: - $nativeBalance = strval( - $account->transactions() - ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59')) - ->where('transactions.transaction_currency_id', $currencyId) - ->sum('transactions.amount') - ); + $nativeBalance = (string)$account->transactions() + ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59')) + ->where('transactions.transaction_currency_id', $currencyId) + ->sum('transactions.amount'); // get all balances in foreign currency: - $foreignBalance = strval( - $account->transactions() - ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->where('transaction_journals.date', '<=', $date->format('Y-m-d')) - ->where('transactions.foreign_currency_id', $currencyId) - ->where('transactions.transaction_currency_id', '!=', $currencyId) - ->sum('transactions.foreign_amount') - ); + $foreignBalance = (string)$account->transactions() + ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->where('transaction_journals.date', '<=', $date->format('Y-m-d')) + ->where('transactions.foreign_currency_id', $currencyId) + ->where('transactions.transaction_currency_id', '!=', $currencyId) + ->sum('transactions.foreign_amount'); $balance = bcadd($nativeBalance, $foreignBalance); - $virtual = null === $account->virtual_balance ? '0' : strval($account->virtual_balance); + $virtual = null === $account->virtual_balance ? '0' : (string)$account->virtual_balance; $balance = bcadd($balance, $virtual); $cache->store($balance); @@ -99,25 +95,21 @@ class Steam if ($cache->has()) { return $cache->get(); // @codeCoverageIgnore } - $currencyId = intval($account->getMeta('currency_id')); + $currencyId = (int)$account->getMeta('currency_id'); - $nativeBalance = strval( - $account->transactions() - ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->where('transaction_journals.date', '<=', $date->format('Y-m-d')) - ->where('transactions.transaction_currency_id', $currencyId) - ->sum('transactions.amount') - ); + $nativeBalance = (string)$account->transactions() + ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->where('transaction_journals.date', '<=', $date->format('Y-m-d')) + ->where('transactions.transaction_currency_id', $currencyId) + ->sum('transactions.amount'); // get all balances in foreign currency: - $foreignBalance = strval( - $account->transactions() - ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->where('transaction_journals.date', '<=', $date->format('Y-m-d')) - ->where('transactions.foreign_currency_id', $currencyId) - ->where('transactions.transaction_currency_id', '!=', $currencyId) - ->sum('transactions.foreign_amount') - ); + $foreignBalance = (string)$account->transactions() + ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->where('transaction_journals.date', '<=', $date->format('Y-m-d')) + ->where('transactions.foreign_currency_id', $currencyId) + ->where('transactions.transaction_currency_id', '!=', $currencyId) + ->sum('transactions.foreign_amount'); $balance = bcadd($nativeBalance, $foreignBalance); $cache->store($balance); @@ -155,7 +147,7 @@ class Steam $startBalance = $this->balance($account, $start); $balances[$formatted] = $startBalance; - $currencyId = intval($account->getMeta('currency_id')); + $currencyId = (int)$account->getMeta('currency_id'); $start->addDay(); // query! @@ -182,14 +174,14 @@ class Steam /** @var Transaction $entry */ foreach ($set as $entry) { // normal amount and foreign amount - $modified = null === $entry->modified ? '0' : strval($entry->modified); - $foreignModified = null === $entry->modified_foreign ? '0' : strval($entry->modified_foreign); + $modified = null === $entry->modified ? '0' : (string)$entry->modified; + $foreignModified = null === $entry->modified_foreign ? '0' : (string)$entry->modified_foreign; $amount = '0'; - if ($currencyId === intval($entry->transaction_currency_id) || 0 === $currencyId) { + if ($currencyId === (int)$entry->transaction_currency_id || 0 === $currencyId) { // use normal amount: $amount = $modified; } - if ($currencyId === intval($entry->foreign_currency_id)) { + if ($currencyId === (int)$entry->foreign_currency_id) { // use foreign amount: $amount = $foreignModified; } @@ -268,7 +260,7 @@ class Steam ->get(['transactions.account_id', DB::raw('MAX(transaction_journals.date) AS max_date')]); foreach ($set as $entry) { - $list[intval($entry->account_id)] = new Carbon($entry->max_date); + $list[(int)$entry->account_id] = new Carbon($entry->max_date); } return $list; @@ -295,7 +287,7 @@ class Steam */ public function opposite(string $amount = null): ?string { - if (is_null($amount)) { + if (null === $amount) { return null; } $amount = bcmul($amount, '-1'); @@ -316,24 +308,24 @@ class Steam // has a K in it, remove the K and multiply by 1024. $bytes = bcmul(rtrim($string, 'kK'), '1024'); - return intval($bytes); + return (int)$bytes; } if (!(false === stripos($string, 'm'))) { // has a M in it, remove the M and multiply by 1048576. $bytes = bcmul(rtrim($string, 'mM'), '1048576'); - return intval($bytes); + return (int)$bytes; } if (!(false === stripos($string, 'g'))) { // has a G in it, remove the G and multiply by (1024)^3. $bytes = bcmul(rtrim($string, 'gG'), '1073741824'); - return intval($bytes); + return (int)$bytes; } - return intval($string); + return (int)$string; } /** diff --git a/app/Support/Twig/Extension/Transaction.php b/app/Support/Twig/Extension/Transaction.php index 042f28fb39..c461925e78 100644 --- a/app/Support/Twig/Extension/Transaction.php +++ b/app/Support/Twig/Extension/Transaction.php @@ -45,12 +45,12 @@ class Transaction extends Twig_Extension */ public function amount(TransactionModel $transaction): string { - $amount = bcmul(app('steam')->positive(strval($transaction->transaction_amount)), '-1'); + $amount = bcmul(app('steam')->positive((string)$transaction->transaction_amount), '-1'); $format = '%s'; $coloured = true; // at this point amount is always negative. - if (TransactionType::RECONCILIATION === $transaction->transaction_type_type && 1 === bccomp(strval($transaction->transaction_amount), '0')) { + if (TransactionType::RECONCILIATION === $transaction->transaction_type_type && 1 === bccomp((string)$transaction->transaction_amount, '0')) { $amount = bcmul($amount, '-1'); } @@ -64,7 +64,7 @@ class Transaction extends Twig_Extension $format = '%s'; } if (TransactionType::OPENING_BALANCE === $transaction->transaction_type_type) { - $amount = strval($transaction->transaction_amount); + $amount = (string)$transaction->transaction_amount; } $currency = new TransactionCurrency; @@ -73,7 +73,7 @@ class Transaction extends Twig_Extension $str = sprintf($format, app('amount')->formatAnything($currency, $amount, $coloured)); if (null !== $transaction->transaction_foreign_amount) { - $amount = bcmul(app('steam')->positive(strval($transaction->transaction_foreign_amount)), '-1'); + $amount = bcmul(app('steam')->positive((string)$transaction->transaction_foreign_amount), '-1'); if (TransactionType::DEPOSIT === $transaction->transaction_type_type) { $amount = bcmul($amount, '-1'); } @@ -101,7 +101,7 @@ class Transaction extends Twig_Extension public function amountArray(array $transaction): string { // first display amount: - $amount = strval($transaction['amount']); + $amount = (string)$transaction['amount']; $fakeCurrency = new TransactionCurrency; $fakeCurrency->decimal_places = $transaction['currency_dp']; $fakeCurrency->symbol = $transaction['currency_symbol']; @@ -109,7 +109,7 @@ class Transaction extends Twig_Extension // then display (if present) the foreign amount: if (null !== $transaction['foreign_amount']) { - $amount = strval($transaction['foreign_amount']); + $amount = (string)$transaction['foreign_amount']; $fakeCurrency = new TransactionCurrency; $fakeCurrency->decimal_places = $transaction['foreign_currency_dp']; $fakeCurrency->symbol = $transaction['foreign_currency_symbol']; @@ -205,7 +205,7 @@ class Transaction extends Twig_Extension public function description(TransactionModel $transaction): string { $description = $transaction->description; - if (strlen(strval($transaction->transaction_description)) > 0) { + if (strlen((string)$transaction->transaction_description) > 0) { $description = $transaction->transaction_description . ' (' . $transaction->description . ')'; } @@ -226,13 +226,13 @@ class Transaction extends Twig_Extension } $name = app('steam')->tryDecrypt($transaction->account_name); - $transactionId = intval($transaction->account_id); + $transactionId = (int)$transaction->account_id; $type = $transaction->account_type; // name is present in object, use that one: if (bccomp($transaction->transaction_amount, '0') === -1 && null !== $transaction->opposing_account_id) { $name = $transaction->opposing_account_name; - $transactionId = intval($transaction->opposing_account_id); + $transactionId = (int)$transaction->opposing_account_id; $type = $transaction->opposing_account_type; } @@ -249,7 +249,7 @@ class Transaction extends Twig_Extension ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') ->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id') ->first(['transactions.account_id', 'accounts.encrypted', 'accounts.name', 'account_types.type']); - if (is_null($other)) { + if (null === $other) { Log::error(sprintf('Cannot find other transaction for journal #%d', $journalId)); return ''; @@ -384,13 +384,13 @@ class Transaction extends Twig_Extension // if the amount is negative, assume that the current account (the one in $transaction) is indeed the source account. $name = app('steam')->tryDecrypt($transaction->account_name); - $transactionId = intval($transaction->account_id); + $transactionId = (int)$transaction->account_id; $type = $transaction->account_type; // name is present in object, use that one: if (1 === bccomp($transaction->transaction_amount, '0') && null !== $transaction->opposing_account_id) { $name = $transaction->opposing_account_name; - $transactionId = intval($transaction->opposing_account_id); + $transactionId = (int)$transaction->opposing_account_id; $type = $transaction->opposing_account_type; } // Find the opposing account and use that one: diff --git a/app/Support/Twig/Extension/TransactionJournal.php b/app/Support/Twig/Extension/TransactionJournal.php index 6e8d9a9ede..cc06e02726 100644 --- a/app/Support/Twig/Extension/TransactionJournal.php +++ b/app/Support/Twig/Extension/TransactionJournal.php @@ -59,7 +59,7 @@ class TransactionJournal extends Twig_Extension /** @var JournalRepositoryInterface $repository */ $repository = app(JournalRepositoryInterface::class); $result = $repository->getMetaField($journal, $field); - if (is_null($result)) { + if (null === $result) { return ''; } @@ -80,10 +80,10 @@ class TransactionJournal extends Twig_Extension /** @var JournalRepositoryInterface $repository */ $repository = app(JournalRepositoryInterface::class); $result = $repository->getMetaField($journal, $field); - if (is_null($result)) { + if (null === $result) { return false; } - if (strlen(strval($result)) === 0) { + if (strlen((string)$result) === 0) { return false; } @@ -135,8 +135,7 @@ class TransactionJournal extends Twig_Extension } $array[] = app('amount')->formatAnything($total['currency'], $total['amount']); } - $txt = join(' / ', $array); - return $txt; + return join(' / ', $array); } } diff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.php index d37e071a45..ec15461939 100644 --- a/app/Support/Twig/Journal.php +++ b/app/Support/Twig/Journal.php @@ -64,7 +64,7 @@ class Journal extends Twig_Extension $array[] = sprintf('%1$s', e($entry->name), route('accounts.show', $entry->id)); } $array = array_unique($array); - $result = join(', ', $array); + $result = implode(', ', $array); $cache->store($result); return $result; @@ -129,7 +129,7 @@ class Journal extends Twig_Extension $array[] = sprintf('%1$s', e($entry->name), route('accounts.show', $entry->id)); } $array = array_unique($array); - $result = join(', ', $array); + $result = implode(', ', $array); $cache->store($result); return $result; @@ -164,7 +164,7 @@ class Journal extends Twig_Extension $budgets[] = sprintf('%1$s', e($budget->name), route('budgets.show', $budget->id)); } } - $string = join(', ', array_unique($budgets)); + $string = implode(', ', array_unique($budgets)); $cache->store($string); return $string; @@ -205,7 +205,7 @@ class Journal extends Twig_Extension } } - $string = join(', ', array_unique($categories)); + $string = implode(', ', array_unique($categories)); $cache->store($string); return $string; diff --git a/app/TransactionRules/Actions/ClearNotes.php b/app/TransactionRules/Actions/ClearNotes.php index 7dec7f12f7..a6bd490588 100644 --- a/app/TransactionRules/Actions/ClearNotes.php +++ b/app/TransactionRules/Actions/ClearNotes.php @@ -52,7 +52,7 @@ class ClearNotes implements ActionInterface * * @return bool * - * @throws \Exception + */ public function act(TransactionJournal $journal): bool { diff --git a/app/TransactionRules/Processor.php b/app/TransactionRules/Processor.php index 2c4d343765..2cf9f31759 100644 --- a/app/TransactionRules/Processor.php +++ b/app/TransactionRules/Processor.php @@ -128,7 +128,7 @@ final class Processor { $self = new self; foreach ($triggers as $entry) { - $entry['value'] = null === $entry['value'] ? '' : $entry['value']; + $entry['value'] = $entry['value'] ?? ''; $trigger = TriggerFactory::makeTriggerFromStrings($entry['type'], $entry['value'], $entry['stopProcessing']); $self->triggers->push($trigger); } diff --git a/app/TransactionRules/Triggers/AmountMore.php b/app/TransactionRules/Triggers/AmountMore.php index a56d9cede5..545542b279 100644 --- a/app/TransactionRules/Triggers/AmountMore.php +++ b/app/TransactionRules/Triggers/AmountMore.php @@ -50,7 +50,7 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface public static function willMatchEverything($value = null) { if (null !== $value) { - $res = 0 === bccomp('0', strval($value)); + $res = 0 === bccomp('0', (string)$value); if (true === $res) { Log::error(sprintf('Cannot use %s with a value equal to 0.', self::class)); } diff --git a/app/TransactionRules/Triggers/DescriptionContains.php b/app/TransactionRules/Triggers/DescriptionContains.php index d055699e2f..7a58121418 100644 --- a/app/TransactionRules/Triggers/DescriptionContains.php +++ b/app/TransactionRules/Triggers/DescriptionContains.php @@ -49,7 +49,7 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/DescriptionEnds.php b/app/TransactionRules/Triggers/DescriptionEnds.php index cb6c53c00f..e4bbf5b71d 100644 --- a/app/TransactionRules/Triggers/DescriptionEnds.php +++ b/app/TransactionRules/Triggers/DescriptionEnds.php @@ -49,7 +49,7 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/DescriptionStarts.php b/app/TransactionRules/Triggers/DescriptionStarts.php index 075a0d8441..d795004605 100644 --- a/app/TransactionRules/Triggers/DescriptionStarts.php +++ b/app/TransactionRules/Triggers/DescriptionStarts.php @@ -49,7 +49,7 @@ final class DescriptionStarts extends AbstractTrigger implements TriggerInterfac public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/FromAccountContains.php b/app/TransactionRules/Triggers/FromAccountContains.php index ecb4ef0eab..2434fdd217 100644 --- a/app/TransactionRules/Triggers/FromAccountContains.php +++ b/app/TransactionRules/Triggers/FromAccountContains.php @@ -50,7 +50,7 @@ final class FromAccountContains extends AbstractTrigger implements TriggerInterf public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/FromAccountEnds.php b/app/TransactionRules/Triggers/FromAccountEnds.php index c18fc72c1d..16f1393a23 100644 --- a/app/TransactionRules/Triggers/FromAccountEnds.php +++ b/app/TransactionRules/Triggers/FromAccountEnds.php @@ -50,7 +50,7 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/FromAccountIs.php b/app/TransactionRules/Triggers/FromAccountIs.php index 4e1810297b..100ba5970e 100644 --- a/app/TransactionRules/Triggers/FromAccountIs.php +++ b/app/TransactionRules/Triggers/FromAccountIs.php @@ -50,7 +50,7 @@ final class FromAccountIs extends AbstractTrigger implements TriggerInterface public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/FromAccountStarts.php b/app/TransactionRules/Triggers/FromAccountStarts.php index 0d15c40dae..cc12f8fcfb 100644 --- a/app/TransactionRules/Triggers/FromAccountStarts.php +++ b/app/TransactionRules/Triggers/FromAccountStarts.php @@ -50,7 +50,7 @@ final class FromAccountStarts extends AbstractTrigger implements TriggerInterfac public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/HasAttachment.php b/app/TransactionRules/Triggers/HasAttachment.php index f415e7ea22..0dba22509b 100644 --- a/app/TransactionRules/Triggers/HasAttachment.php +++ b/app/TransactionRules/Triggers/HasAttachment.php @@ -48,12 +48,9 @@ class HasAttachment extends AbstractTrigger implements TriggerInterface */ public static function willMatchEverything($value = null) { - $value = intval($value); - if ($value < 0) { - return true; - } + $value = (int)$value; - return false; + return $value < 0; } /** @@ -65,7 +62,7 @@ class HasAttachment extends AbstractTrigger implements TriggerInterface */ public function triggered(TransactionJournal $journal): bool { - $minimum = intval($this->triggerValue); + $minimum = (int)$this->triggerValue; $attachments = $journal->attachments()->count(); if ($attachments >= $minimum) { Log::debug( diff --git a/app/TransactionRules/Triggers/NotesContain.php b/app/TransactionRules/Triggers/NotesContain.php index e17babae41..68aa90ec86 100644 --- a/app/TransactionRules/Triggers/NotesContain.php +++ b/app/TransactionRules/Triggers/NotesContain.php @@ -50,7 +50,7 @@ final class NotesContain extends AbstractTrigger implements TriggerInterface public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/NotesEnd.php b/app/TransactionRules/Triggers/NotesEnd.php index 08cc86e290..4929b29ad2 100644 --- a/app/TransactionRules/Triggers/NotesEnd.php +++ b/app/TransactionRules/Triggers/NotesEnd.php @@ -50,7 +50,7 @@ final class NotesEnd extends AbstractTrigger implements TriggerInterface public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/NotesStart.php b/app/TransactionRules/Triggers/NotesStart.php index 3e0defa274..3631143312 100644 --- a/app/TransactionRules/Triggers/NotesStart.php +++ b/app/TransactionRules/Triggers/NotesStart.php @@ -50,7 +50,7 @@ final class NotesStart extends AbstractTrigger implements TriggerInterface public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/ToAccountContains.php b/app/TransactionRules/Triggers/ToAccountContains.php index 1120880094..b0c78f7322 100644 --- a/app/TransactionRules/Triggers/ToAccountContains.php +++ b/app/TransactionRules/Triggers/ToAccountContains.php @@ -50,7 +50,7 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/ToAccountEnds.php b/app/TransactionRules/Triggers/ToAccountEnds.php index 17345f1322..d7ecefdbea 100644 --- a/app/TransactionRules/Triggers/ToAccountEnds.php +++ b/app/TransactionRules/Triggers/ToAccountEnds.php @@ -50,7 +50,7 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/ToAccountIs.php b/app/TransactionRules/Triggers/ToAccountIs.php index 87b3831fea..5754527ef7 100644 --- a/app/TransactionRules/Triggers/ToAccountIs.php +++ b/app/TransactionRules/Triggers/ToAccountIs.php @@ -50,7 +50,7 @@ final class ToAccountIs extends AbstractTrigger implements TriggerInterface public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/ToAccountStarts.php b/app/TransactionRules/Triggers/ToAccountStarts.php index 4662760264..6867a95fa3 100644 --- a/app/TransactionRules/Triggers/ToAccountStarts.php +++ b/app/TransactionRules/Triggers/ToAccountStarts.php @@ -50,7 +50,7 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface public static function willMatchEverything($value = null) { if (null !== $value) { - $res = '' === strval($value); + $res = '' === (string)$value; if (true === $res) { Log::error(sprintf('Cannot use %s with "" as a value.', self::class)); } diff --git a/app/TransactionRules/Triggers/TransactionType.php b/app/TransactionRules/Triggers/TransactionType.php index a5a2c3d2c6..7d3d033197 100644 --- a/app/TransactionRules/Triggers/TransactionType.php +++ b/app/TransactionRules/Triggers/TransactionType.php @@ -65,7 +65,7 @@ final class TransactionType extends AbstractTrigger implements TriggerInterface */ public function triggered(TransactionJournal $journal): bool { - $type = null !== $journal->transaction_type_type ? $journal->transaction_type_type : strtolower($journal->transactionType->type); + $type = $journal->transaction_type_type ?? strtolower($journal->transactionType->type); $search = strtolower($this->triggerValue); if ($type === $search) { diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php index 6f64a76e39..28ccc35829 100644 --- a/app/Transformers/AccountTransformer.php +++ b/app/Transformers/AccountTransformer.php @@ -101,7 +101,7 @@ class AccountTransformer extends TransformerAbstract */ public function includeTransactions(Account $account): FractalCollection { - $pageSize = intval(app('preferences')->getForUser($account->user, 'listPageSize', 50)->data); + $pageSize = (int)app('preferences')->getForUser($account->user, 'listPageSize', 50)->data; // journals always use collector and limited using URL parameters. $collector = app(JournalCollectorInterface::class); @@ -112,7 +112,7 @@ class AccountTransformer extends TransformerAbstract } else { $collector->setOpposingAccounts(new Collection([$account])); } - if (!is_null($this->parameters->get('start')) && !is_null($this->parameters->get('end'))) { + if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) { $collector->setRange($this->parameters->get('start'), $this->parameters->get('end')); } $collector->setLimit($pageSize)->setPage($this->parameters->get('page')); @@ -151,7 +151,7 @@ class AccountTransformer extends TransformerAbstract if (strlen($role) === 0 || $type !== AccountType::ASSET) { $role = null; } - $currencyId = intval($this->repository->getMetaValue($account, 'currency_id')); + $currencyId = (int)$this->repository->getMetaValue($account, 'currency_id'); $currencyCode = null; $decimalPlaces = 2; if ($currencyId > 0) { @@ -161,7 +161,7 @@ class AccountTransformer extends TransformerAbstract } $date = new Carbon; - if (!is_null($this->parameters->get('date'))) { + if (null !== $this->parameters->get('date')) { $date = $this->parameters->get('date'); } @@ -183,7 +183,7 @@ class AccountTransformer extends TransformerAbstract $repository = app(AccountRepositoryInterface::class); $repository->setUser($account->user); $amount = $repository->getOpeningBalanceAmount($account); - $openingBalance = is_null($amount) ? null : round($amount, $decimalPlaces); + $openingBalance = null === $amount ? null : round($amount, $decimalPlaces); $openingBalanceDate = $repository->getOpeningBalanceDate($account); } @@ -192,7 +192,7 @@ class AccountTransformer extends TransformerAbstract 'updated_at' => $account->updated_at->toAtomString(), 'created_at' => $account->created_at->toAtomString(), 'name' => $account->name, - 'active' => intval($account->active) === 1, + 'active' => (int)$account->active === 1, 'type' => $type, 'currency_id' => $currencyId, 'currency_code' => $currencyCode, diff --git a/app/Transformers/BillTransformer.php b/app/Transformers/BillTransformer.php index 45b9a89182..80572eca0b 100644 --- a/app/Transformers/BillTransformer.php +++ b/app/Transformers/BillTransformer.php @@ -93,7 +93,7 @@ class BillTransformer extends TransformerAbstract */ public function includeTransactions(Bill $bill): FractalCollection { - $pageSize = intval(app('preferences')->getForUser($bill->user, 'listPageSize', 50)->data); + $pageSize = (int)app('preferences')->getForUser($bill->user, 'listPageSize', 50)->data; // journals always use collector and limited using URL parameters. $collector = app(JournalCollectorInterface::class); @@ -101,7 +101,7 @@ class BillTransformer extends TransformerAbstract $collector->withOpposingAccount()->withCategoryInformation()->withBudgetInformation(); $collector->setAllAssetAccounts(); $collector->setBills(new Collection([$bill])); - if (!is_null($this->parameters->get('start')) && !is_null($this->parameters->get('end'))) { + if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) { $collector->setRange($this->parameters->get('start'), $this->parameters->get('end')); } $collector->setLimit($pageSize)->setPage($this->parameters->get('page')); @@ -145,8 +145,8 @@ class BillTransformer extends TransformerAbstract 'date' => $bill->date->format('Y-m-d'), 'repeat_freq' => $bill->repeat_freq, 'skip' => (int)$bill->skip, - 'automatch' => intval($bill->automatch) === 1, - 'active' => intval($bill->active) === 1, + 'automatch' => (int)$bill->automatch === 1, + 'active' => (int)$bill->active === 1, 'attachments_count' => $bill->attachments()->count(), 'pay_dates' => $payDates, 'paid_dates' => $paidData['paid_dates'], @@ -161,7 +161,7 @@ class BillTransformer extends TransformerAbstract ]; /** @var Note $note */ $note = $bill->notes()->first(); - if (!is_null($note)) { + if (null !== $note) { $data['notes'] = $note->text; } @@ -222,7 +222,7 @@ class BillTransformer extends TransformerAbstract protected function paidData(Bill $bill): array { Log::debug(sprintf('Now in paidData for bill #%d', $bill->id)); - if (is_null($this->parameters->get('start')) || is_null($this->parameters->get('end'))) { + if (null === $this->parameters->get('start') || null === $this->parameters->get('end')) { Log::debug('parameters are NULL, return empty array'); return [ @@ -267,7 +267,7 @@ class BillTransformer extends TransformerAbstract */ protected function payDates(Bill $bill): array { - if (is_null($this->parameters->get('start')) || is_null($this->parameters->get('end'))) { + if (null === $this->parameters->get('start') || null === $this->parameters->get('end')) { return []; } $set = new Collection; diff --git a/app/Transformers/BudgetTransformer.php b/app/Transformers/BudgetTransformer.php index 7fc3d82db7..698c3009b8 100644 --- a/app/Transformers/BudgetTransformer.php +++ b/app/Transformers/BudgetTransformer.php @@ -75,7 +75,7 @@ class BudgetTransformer extends TransformerAbstract */ public function includeTransactions(Budget $budget): FractalCollection { - $pageSize = intval(app('preferences')->getForUser($budget->user, 'listPageSize', 50)->data); + $pageSize = (int)app('preferences')->getForUser($budget->user, 'listPageSize', 50)->data; // journals always use collector and limited using URL parameters. $collector = app(JournalCollectorInterface::class); @@ -83,7 +83,7 @@ class BudgetTransformer extends TransformerAbstract $collector->withOpposingAccount()->withCategoryInformation()->withBudgetInformation(); $collector->setAllAssetAccounts(); $collector->setBudgets(new Collection([$budget])); - if (!is_null($this->parameters->get('start')) && !is_null($this->parameters->get('end'))) { + if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) { $collector->setRange($this->parameters->get('start'), $this->parameters->get('end')); } $collector->setLimit($pageSize)->setPage($this->parameters->get('page')); @@ -118,7 +118,7 @@ class BudgetTransformer extends TransformerAbstract 'id' => (int)$budget->id, 'updated_at' => $budget->updated_at->toAtomString(), 'created_at' => $budget->created_at->toAtomString(), - 'active' => intval($budget->active) === 1, + 'active' => (int)$budget->active === 1, 'name' => $budget->name, 'links' => [ [ diff --git a/app/Transformers/CategoryTransformer.php b/app/Transformers/CategoryTransformer.php index 8c7ea8d6dc..3d7de337c9 100644 --- a/app/Transformers/CategoryTransformer.php +++ b/app/Transformers/CategoryTransformer.php @@ -75,7 +75,7 @@ class CategoryTransformer extends TransformerAbstract */ public function includeTransactions(Category $category): FractalCollection { - $pageSize = intval(app('preferences')->getForUser($category->user, 'listPageSize', 50)->data); + $pageSize = (int)app('preferences')->getForUser($category->user, 'listPageSize', 50)->data; // journals always use collector and limited using URL parameters. $collector = app(JournalCollectorInterface::class); @@ -83,7 +83,7 @@ class CategoryTransformer extends TransformerAbstract $collector->withOpposingAccount()->withCategoryInformation()->withCategoryInformation(); $collector->setAllAssetAccounts(); $collector->setCategories(new Collection([$category])); - if (!is_null($this->parameters->get('start')) && !is_null($this->parameters->get('end'))) { + if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) { $collector->setRange($this->parameters->get('start'), $this->parameters->get('end')); } $collector->setLimit($pageSize)->setPage($this->parameters->get('page')); diff --git a/app/Transformers/JournalMetaTransformer.php b/app/Transformers/JournalMetaTransformer.php index 09de3a397a..6f54be2e2e 100644 --- a/app/Transformers/JournalMetaTransformer.php +++ b/app/Transformers/JournalMetaTransformer.php @@ -75,7 +75,7 @@ class JournalMetaTransformer extends TransformerAbstract public function includeTransactions(TransactionJournalMeta $meta): FractalCollection { $journal = $meta->transactionJournal; - $pageSize = intval(app('preferences')->getForUser($journal->user, 'listPageSize', 50)->data); + $pageSize = (int)app('preferences')->getForUser($journal->user, 'listPageSize', 50)->data; // journals always use collector and limited using URL parameters. $collector = app(JournalCollectorInterface::class); @@ -83,7 +83,7 @@ class JournalMetaTransformer extends TransformerAbstract $collector->withOpposingAccount()->withCategoryInformation()->withCategoryInformation(); $collector->setAllAssetAccounts(); $collector->setJournals(new Collection([$journal])); - if (!is_null($this->parameters->get('start')) && !is_null($this->parameters->get('end'))) { + if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) { $collector->setRange($this->parameters->get('start'), $this->parameters->get('end')); } $collector->setLimit($pageSize)->setPage($this->parameters->get('page')); diff --git a/app/Transformers/PiggyBankEventTransformer.php b/app/Transformers/PiggyBankEventTransformer.php index 2fad262ebd..a9b53ab085 100644 --- a/app/Transformers/PiggyBankEventTransformer.php +++ b/app/Transformers/PiggyBankEventTransformer.php @@ -91,7 +91,7 @@ class PiggyBankEventTransformer extends TransformerAbstract public function includeTransaction(PiggyBankEvent $event): Item { $journal = $event->transactionJournal; - $pageSize = intval(app('preferences')->getForUser($journal->user, 'listPageSize', 50)->data); + $pageSize = (int)app('preferences')->getForUser($journal->user, 'listPageSize', 50)->data; // journals always use collector and limited using URL parameters. $collector = app(JournalCollectorInterface::class); @@ -99,7 +99,7 @@ class PiggyBankEventTransformer extends TransformerAbstract $collector->withOpposingAccount()->withCategoryInformation()->withCategoryInformation(); $collector->setAllAssetAccounts(); $collector->setJournals(new Collection([$journal])); - if (!is_null($this->parameters->get('start')) && !is_null($this->parameters->get('end'))) { + if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) { $collector->setRange($this->parameters->get('start'), $this->parameters->get('end')); } $collector->setLimit($pageSize)->setPage($this->parameters->get('page')); @@ -118,7 +118,7 @@ class PiggyBankEventTransformer extends TransformerAbstract public function transform(PiggyBankEvent $event): array { $account = $event->piggyBank->account; - $currencyId = intval($account->getMeta('currency_id')); + $currencyId = (int)$account->getMeta('currency_id'); $decimalPlaces = 2; if ($currencyId > 0) { /** @var CurrencyRepositoryInterface $repository */ diff --git a/app/Transformers/PiggyBankTransformer.php b/app/Transformers/PiggyBankTransformer.php index dba7617104..02a4831c8d 100644 --- a/app/Transformers/PiggyBankTransformer.php +++ b/app/Transformers/PiggyBankTransformer.php @@ -117,7 +117,7 @@ class PiggyBankTransformer extends TransformerAbstract public function transform(PiggyBank $piggyBank): array { $account = $piggyBank->account; - $currencyId = intval($account->getMeta('currency_id')); + $currencyId = (int)$account->getMeta('currency_id'); $decimalPlaces = 2; if ($currencyId > 0) { /** @var CurrencyRepositoryInterface $repository */ @@ -133,8 +133,8 @@ class PiggyBankTransformer extends TransformerAbstract $piggyRepos->setUser($account->user); $currentAmount = round($piggyRepos->getCurrentAmount($piggyBank), $decimalPlaces); - $startDate = is_null($piggyBank->startdate) ? null : $piggyBank->startdate->format('Y-m-d'); - $targetDate = is_null($piggyBank->targetdate) ? null : $piggyBank->targetdate->format('Y-m-d'); + $startDate = null === $piggyBank->startdate ? null : $piggyBank->startdate->format('Y-m-d'); + $targetDate = null === $piggyBank->targetdate ? null : $piggyBank->targetdate->format('Y-m-d'); $targetAmount = round($piggyBank->targetamount, $decimalPlaces); $data = [ 'id' => (int)$piggyBank->id, @@ -146,7 +146,7 @@ class PiggyBankTransformer extends TransformerAbstract 'startdate' => $startDate, 'targetdate' => $targetDate, 'order' => (int)$piggyBank->order, - 'active' => intval($piggyBank->active) === 1, + 'active' => (int)$piggyBank->active === 1, 'notes' => null, 'links' => [ [ @@ -157,7 +157,7 @@ class PiggyBankTransformer extends TransformerAbstract ]; /** @var Note $note */ $note = $piggyBank->notes()->first(); - if (!is_null($note)) { + if (null !== $note) { $data['notes'] = $note->text; } diff --git a/app/Transformers/TagTransformer.php b/app/Transformers/TagTransformer.php index d57b6f2599..19ce472453 100644 --- a/app/Transformers/TagTransformer.php +++ b/app/Transformers/TagTransformer.php @@ -74,7 +74,7 @@ class TagTransformer extends TransformerAbstract */ public function includeTransactions(Tag $tag): FractalCollection { - $pageSize = intval(app('preferences')->getForUser($tag->user, 'listPageSize', 50)->data); + $pageSize = (int)app('preferences')->getForUser($tag->user, 'listPageSize', 50)->data; // journals always use collector and limited using URL parameters. $collector = app(JournalCollectorInterface::class); @@ -82,7 +82,7 @@ class TagTransformer extends TransformerAbstract $collector->withOpposingAccount()->withCategoryInformation()->withCategoryInformation(); $collector->setAllAssetAccounts(); $collector->setTag($tag); - if (!is_null($this->parameters->get('start')) && !is_null($this->parameters->get('end'))) { + if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) { $collector->setRange($this->parameters->get('start'), $this->parameters->get('end')); } $collector->setLimit($pageSize)->setPage($this->parameters->get('page')); @@ -113,7 +113,7 @@ class TagTransformer extends TransformerAbstract */ public function transform(Tag $tag): array { - $date = is_null($tag->date) ? null : $tag->date->format('Y-m-d'); + $date = null === $tag->date ? null : $tag->date->format('Y-m-d'); $data = [ 'id' => (int)$tag->id, 'updated_at' => $tag->updated_at->toAtomString(), diff --git a/app/Transformers/TransactionTransformer.php b/app/Transformers/TransactionTransformer.php index 29a1333ad9..4f028bc60e 100644 --- a/app/Transformers/TransactionTransformer.php +++ b/app/Transformers/TransactionTransformer.php @@ -157,21 +157,21 @@ class TransactionTransformer extends TransformerAbstract $categoryName = null; $budgetId = null; $budgetName = null; - $categoryId = is_null($transaction->transaction_category_id) ? $transaction->transaction_journal_category_id + $categoryId = null === $transaction->transaction_category_id ? $transaction->transaction_journal_category_id : $transaction->transaction_category_id; - $categoryName = is_null($transaction->transaction_category_name) ? $transaction->transaction_journal_category_name + $categoryName = null === $transaction->transaction_category_name ? $transaction->transaction_journal_category_name : $transaction->transaction_category_name; if ($transaction->transaction_type_type === TransactionType::WITHDRAWAL) { - $budgetId = is_null($transaction->transaction_budget_id) ? $transaction->transaction_journal_budget_id + $budgetId = null === $transaction->transaction_budget_id ? $transaction->transaction_journal_budget_id : $transaction->transaction_budget_id; - $budgetName = is_null($transaction->transaction_budget_name) ? $transaction->transaction_journal_budget_name + $budgetName = null === $transaction->transaction_budget_name ? $transaction->transaction_journal_budget_name : $transaction->transaction_budget_name; } /** @var Note $dbNote */ $dbNote = $transaction->transactionJournal->notes()->first(); $notes = null; - if (!is_null($dbNote)) { + if (null !== $dbNote) { $notes = $dbNote->text; } @@ -186,7 +186,7 @@ class TransactionTransformer extends TransformerAbstract 'identifier' => $transaction->identifier, 'journal_id' => (int)$transaction->journal_id, 'reconciled' => (bool)$transaction->reconciled, - 'amount' => round($transaction->transaction_amount, intval($transaction->transaction_currency_dp)), + 'amount' => round($transaction->transaction_amount, (int)$transaction->transaction_currency_dp), 'currency_id' => $transaction->transaction_currency_id, 'currency_code' => $transaction->transaction_currency_code, 'currency_symbol' => $transaction->transaction_currency_symbol, @@ -212,8 +212,8 @@ class TransactionTransformer extends TransformerAbstract ]; // expand foreign amount: - if (!is_null($transaction->transaction_foreign_amount)) { - $data['foreign_amount'] = round($transaction->transaction_foreign_amount, intval($transaction->foreign_currency_dp)); + if (null !== $transaction->transaction_foreign_amount) { + $data['foreign_amount'] = round($transaction->transaction_foreign_amount, (int)$transaction->foreign_currency_dp); } // switch on type for consistency @@ -251,7 +251,7 @@ class TransactionTransformer extends TransformerAbstract } // expand description. - if (strlen(strval($transaction->transaction_description)) > 0) { + if (strlen((string)$transaction->transaction_description) > 0) { $data['description'] = $transaction->transaction_description . ' (' . $transaction->description . ')'; } diff --git a/app/Transformers/UserTransformer.php b/app/Transformers/UserTransformer.php index 902c601f1a..dadb23fb94 100644 --- a/app/Transformers/UserTransformer.php +++ b/app/Transformers/UserTransformer.php @@ -184,7 +184,7 @@ class UserTransformer extends TransformerAbstract { /** @var Role $role */ $role = $user->roles()->first(); - if (!is_null($role)) { + if (null !== $role) { $role = $role->name; } @@ -193,7 +193,7 @@ class UserTransformer extends TransformerAbstract 'updated_at' => $user->updated_at->toAtomString(), 'created_at' => $user->created_at->toAtomString(), 'email' => $user->email, - 'blocked' => intval($user->blocked) === 1, + 'blocked' => (int)$user->blocked === 1, 'blocked_code' => $user->blocked_code, 'role' => $role, 'links' => [ diff --git a/app/User.php b/app/User.php index c5dbe49ad7..641bbc70dc 100644 --- a/app/User.php +++ b/app/User.php @@ -76,14 +76,14 @@ class User extends Authenticatable * @param string $value * * @return User - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException + * @throws NotFoundHttpException */ public static function routeBinder(string $value): User { if (auth()->check()) { - $userId = intval($value); + $userId = (int)$value; $user = self::find($userId); - if (!is_null($user)) { + if (null !== $user) { return $user; } } @@ -212,7 +212,7 @@ class User extends Authenticatable { $bytes = random_bytes(16); - return strval(bin2hex($bytes)); + return (string)bin2hex($bytes); } /** diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 061857c346..e72472c99d 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -37,7 +37,6 @@ use FireflyIII\TransactionRules\Triggers\TriggerInterface; use FireflyIII\User; use Google2FA; use Illuminate\Contracts\Encryption\DecryptException; -use Illuminate\Contracts\Translation\Translator; use Illuminate\Validation\Validator; /** @@ -45,18 +44,6 @@ use Illuminate\Validation\Validator; */ class FireflyValidator extends Validator { - /** - * @param Translator $translator - * @param array $data - * @param array $rules - * @param array $messages - * @param array $customAttributes - */ - public function __construct(Translator $translator, array $data, array $rules, array $messages = [], array $customAttributes = []) - { - parent::__construct($translator, $data, $rules, $messages, $customAttributes); - } - /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @@ -89,7 +76,7 @@ class FireflyValidator extends Validator { $field = $parameters[1] ?? 'id'; - if (0 === intval($value)) { + if (0 === (int)$value) { return true; } $count = DB::table($parameters[0])->where('user_id', auth()->user()->id)->where($field, $value)->count(); @@ -196,7 +183,7 @@ class FireflyValidator extends Validator $iban = str_replace($search, $replace, $iban); $checksum = bcmod($iban, '97'); - return 1 === intval($checksum); + return 1 === (int)$checksum; } /** @@ -209,9 +196,9 @@ class FireflyValidator extends Validator */ public function validateMore($attribute, $value, $parameters): bool { - $compare = strval($parameters[0] ?? '0'); + $compare = (string)$parameters[0] ?? '0'; - return bccomp(strval($value), $compare) > 0; + return bccomp((string)$value, $compare) > 0; } /** @@ -227,7 +214,7 @@ class FireflyValidator extends Validator { $field = $parameters[1] ?? 'id'; - if (0 === intval($value)) { + if (0 === (int)$value) { return true; } $count = DB::table($parameters[0])->where($field, $value)->count(); @@ -333,7 +320,7 @@ class FireflyValidator extends Validator { $verify = false; if (isset($this->data['verify_password'])) { - $verify = 1 === intval($this->data['verify_password']); + $verify = 1 === (int)$this->data['verify_password']; } if ($verify) { /** @var Verifier $service */ @@ -389,9 +376,9 @@ class FireflyValidator extends Validator */ public function validateUniqueAccountNumberForUser($attribute, $value, $parameters): bool { - $accountId = $this->data['id'] ?? 0; + $accountId = (int)($this->data['id'] ?? 0.0); if ($accountId === 0) { - $accountId = $parameters[0] ?? 0; + $accountId = (int)($parameters[0] ?? 0.0); } $query = AccountMeta::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id') @@ -399,9 +386,9 @@ class FireflyValidator extends Validator ->where('accounts.user_id', auth()->user()->id) ->where('account_meta.name', 'accountNumber'); - if (intval($accountId) > 0) { + if ((int)$accountId > 0) { // exclude current account from check. - $query->where('account_meta.account_id', '!=', intval($accountId)); + $query->where('account_meta.account_id', '!=', (int)$accountId); } $set = $query->get(['account_meta.*']); @@ -435,15 +422,15 @@ class FireflyValidator extends Validator // exclude? $table = $parameters[0]; $field = $parameters[1]; - $exclude = $parameters[2] ?? 0; + $exclude = (int)($parameters[2] ?? 0.0); /* * If other data (in $this->getData()) contains * ID field, set that field to be the $exclude. */ $data = $this->getData(); - if (!isset($parameters[2]) && isset($data['id']) && intval($data['id']) > 0) { - $exclude = intval($data['id']); + if (!isset($parameters[2]) && isset($data['id']) && (int)$data['id'] > 0) { + $exclude = (int)$data['id']; } @@ -586,7 +573,7 @@ class FireflyValidator extends Validator private function validateByAccountTypeId($value, $parameters): bool { $type = AccountType::find($this->data['account_type_id'])->first(); - $ignore = $parameters[0] ?? 0; + $ignore = (int)($parameters[0] ?? 0.0); $value = $this->tryDecrypt($value); $set = auth()->user()->accounts()->where('account_type_id', $type->id)->where('id', '!=', $ignore)->get(); @@ -611,7 +598,7 @@ class FireflyValidator extends Validator { $search = Config::get('firefly.accountTypeByIdentifier.' . $type); $accountType = AccountType::whereType($search)->first(); - $ignore = $parameters[0] ?? 0; + $ignore = (int)($parameters[0] ?? 0.0); $set = auth()->user()->accounts()->where('account_type_id', $accountType->id)->where('id', '!=', $ignore)->get(); /** @var Account $entry */ diff --git a/changelog.md b/changelog.md index 8f78da8813..0f4a629f43 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [4.7.2.1] - 2018-04-02 +### Fixed +- Null pointer exception in transaction overview. +- Installations running in subdirs were incapable of creating OAuth tokens. +- OAuth keys were not created in all cases. ## [4.7.2] - 2018-04-01 ### Added diff --git a/composer.json b/composer.json index 9b90499718..49c1ecdd6f 100644 --- a/composer.json +++ b/composer.json @@ -49,8 +49,8 @@ "ext-curl": "*", "ext-gd": "*", "ext-intl": "*", - "ext-zip": "*", "ext-xml": "*", + "ext-zip": "*", "bacon/bacon-qr-code": "1.*", "davejamesmiller/laravel-breadcrumbs": "5.*", "doctrine/dbal": "2.*", @@ -61,12 +61,11 @@ "league/commonmark": "0.*", "league/csv": "9.*", "league/fractal": "^0.17.0", - "pragmarx/google2fa": "2.*", - "pragmarx/google2fa-laravel": "^0.1.4", + "pragmarx/google2fa": "3.*", + "pragmarx/google2fa-laravel": "0.*", "rcrowe/twigbridge": "0.9.*", "rmccue/requests": "1.*", - "twig/twig": "1.*", - "watson/validating": "3.*" + "twig/twig": "1.*" }, "require-dev": { "barryvdh/laravel-debugbar": "3.*", diff --git a/composer.lock b/composer.lock index 5fd1caf2fb..4b66b09356 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "823070d72a990bfa26bdf63404e50651", + "content-hash": "3de47eba99b9bbd1bfb0f129fbf3494a", "packages": [ { "name": "bacon/bacon-qr-code", @@ -2153,16 +2153,16 @@ }, { "name": "pragmarx/google2fa", - "version": "v2.0.7", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/antonioribeiro/google2fa.git", - "reference": "5a818bda62fab0c0a79060b06d50d50b5525d631" + "reference": "40b3ce025bed0f9cd0c1c8ab7fc8265344c73de0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/5a818bda62fab0c0a79060b06d50d50b5525d631", - "reference": "5a818bda62fab0c0a79060b06d50d50b5525d631", + "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/40b3ce025bed0f9cd0c1c8ab7fc8265344c73de0", + "reference": "40b3ce025bed0f9cd0c1c8ab7fc8265344c73de0", "shasum": "" }, "require": { @@ -2193,7 +2193,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { @@ -2210,30 +2210,30 @@ "google2fa", "laravel" ], - "time": "2018-01-06T16:21:07+00:00" + "time": "2018-03-15T23:14:19+00:00" }, { "name": "pragmarx/google2fa-laravel", - "version": "v0.1.4", + "version": "v0.2.0", "source": { "type": "git", "url": "https://github.com/antonioribeiro/google2fa-laravel.git", - "reference": "38bd96a1732b9dea963c52e0f503a65265c077c9" + "reference": "54f0c30c9be5497a7bd248844f1099156457e719" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antonioribeiro/google2fa-laravel/zipball/38bd96a1732b9dea963c52e0f503a65265c077c9", - "reference": "38bd96a1732b9dea963c52e0f503a65265c077c9", + "url": "https://api.github.com/repos/antonioribeiro/google2fa-laravel/zipball/54f0c30c9be5497a7bd248844f1099156457e719", + "reference": "54f0c30c9be5497a7bd248844f1099156457e719", "shasum": "" }, "require": { "laravel/framework": ">=5.2", "php": ">=5.4", - "pragmarx/google2fa": "~2.0" + "pragmarx/google2fa": "~3.0" }, "require-dev": { - "benconstable/phpspec-laravel": "~3.0", - "phpspec/phpspec": "~3" + "orchestra/testbench-browser-kit": "~3.4|~3.5|~3.6", + "phpunit/phpunit": "~5|~6|~7" }, "suggest": { "bacon/bacon-qr-code": "Required to generate inline QR Codes.", @@ -2246,7 +2246,7 @@ "Laravel" ], "branch-alias": { - "dev-master": "0.1-dev" + "dev-master": "0.2-dev" }, "laravel": { "providers": [ @@ -2260,7 +2260,7 @@ "autoload": { "psr-4": { "PragmaRX\\Google2FALaravel\\": "src/", - "spec\\PragmaRX\\Google2FALaravel\\": "tests/spec/" + "PragmaRX\\Google2FALaravel\\Tests\\": "tests/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2281,7 +2281,7 @@ "google2fa", "laravel" ], - "time": "2017-12-06T03:26:14+00:00" + "time": "2018-03-08T04:08:14+00:00" }, { "name": "psr/container", @@ -3869,56 +3869,6 @@ ], "time": "2016-09-01T10:05:43+00:00" }, - { - "name": "watson/validating", - "version": "3.1.2", - "source": { - "type": "git", - "url": "https://github.com/dwightwatson/validating.git", - "reference": "22edd06d45893f5d4f79c9e901bd7fbce174a79f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dwightwatson/validating/zipball/22edd06d45893f5d4f79c9e901bd7fbce174a79f", - "reference": "22edd06d45893f5d4f79c9e901bd7fbce174a79f", - "shasum": "" - }, - "require": { - "illuminate/contracts": ">=5.3", - "illuminate/database": ">=5.3", - "illuminate/events": ">=5.3", - "illuminate/support": ">=5.3", - "illuminate/validation": ">=5.3", - "php": ">=5.4.0" - }, - "require-dev": { - "mockery/mockery": "0.9.*", - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Watson\\Validating\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Dwight Watson", - "email": "dwight@studiousapp.com" - } - ], - "description": "Eloquent model validating trait.", - "keywords": [ - "eloquent", - "laravel", - "validation" - ], - "time": "2017-11-06T21:35:49+00:00" - }, { "name": "zendframework/zend-diactoros", "version": "1.7.1", @@ -6271,8 +6221,8 @@ "ext-curl": "*", "ext-gd": "*", "ext-intl": "*", - "ext-zip": "*", - "ext-xml": "*" + "ext-xml": "*", + "ext-zip": "*" }, "platform-dev": [] } diff --git a/config/breadcrumbs.php b/config/breadcrumbs.php index f238785376..ea323c8789 100644 --- a/config/breadcrumbs.php +++ b/config/breadcrumbs.php @@ -2,7 +2,6 @@ declare(strict_types=1); - /** * breadcrumbs.php * Copyright (c) 2018 thegrumpydictator@gmail.com @@ -55,7 +54,7 @@ return [ | */ - 'files' => base_path('routes/breadcrumbs.php'), + 'files' => base_path('routes/breadcrumbs.php'), /* |-------------------------------------------------------------------------- @@ -67,13 +66,13 @@ return [ */ // When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException) - 'unnamed-route-exception' => true, + 'unnamed-route-exception' => true, // When route-bound breadcrumbs are used and the matching breadcrumb doesn't exist (InvalidBreadcrumbException) 'missing-route-bound-breadcrumb-exception' => true, // When a named breadcrumb is used but doesn't exist (InvalidBreadcrumbException) - 'invalid-named-breadcrumb-exception' => true, + 'invalid-named-breadcrumb-exception' => true, /* |-------------------------------------------------------------------------- @@ -85,9 +84,9 @@ return [ */ // Manager - 'manager-class' => DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class, + 'manager-class' => DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class, // Generator - 'generator-class' => DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class, + 'generator-class' => DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class, ]; diff --git a/config/csv.php b/config/csv.php index 32404f3738..8f6ff88f9a 100644 --- a/config/csv.php +++ b/config/csv.php @@ -1,4 +1,12 @@ . */ -declare(strict_types=1); - return [ @@ -28,11 +34,11 @@ return [ * Configuration for the CSV specifics. */ 'import_specifics' => [ - 'IngDescription' => 'FireflyIII\Import\Specifics\IngDescription', - 'RabobankDescription' => 'FireflyIII\Import\Specifics\RabobankDescription', - 'AbnAmroDescription' => 'FireflyIII\Import\Specifics\AbnAmroDescription', - 'SnsDescription' => 'FireflyIII\Import\Specifics\SnsDescription', - 'PresidentsChoice' => 'FireflyIII\Import\Specifics\PresidentsChoice', + 'IngDescription' => IngDescription::class, + 'RabobankDescription' => RabobankDescription::class, + 'AbnAmroDescription' => AbnAmroDescription::class, + 'SnsDescription' => SnsDescription::class, + 'PresidentsChoice' => PresidentsChoice::class, ], /* @@ -137,102 +143,102 @@ return [ 'field' => 'external-id', ], - 'currency-symbol' => [ + 'currency-symbol' => [ 'mappable' => true, 'pre-process-map' => false, 'converter' => 'CurrencySymbol', 'field' => 'currency', 'mapper' => 'TransactionCurrencies', ], - 'description' => [ + 'description' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', 'field' => 'description', ], - 'date-transaction' => [ + 'date-transaction' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Date', 'field' => 'date', ], - 'date-interest' => [ + 'date-interest' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Date', 'field' => 'date-interest', ], - 'date-book' => [ + 'date-book' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Date', 'field' => 'date-book', ], - 'date-process' => [ + 'date-process' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Date', 'field' => 'date-process', ], - 'date-due' => [ + 'date-due' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Date', 'field' => 'date-due', ], - 'date-payment' => [ + 'date-payment' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Date', 'field' => 'date-payment', ], - 'date-invoice' => [ + 'date-invoice' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Date', 'field' => 'date-invoice', ], - 'budget-id' => [ + 'budget-id' => [ 'mappable' => true, 'pre-process-map' => false, 'converter' => 'BudgetId', 'field' => 'budget', 'mapper' => 'Budgets', ], - 'budget-name' => [ + 'budget-name' => [ 'mappable' => true, 'pre-process-map' => false, 'converter' => 'BudgetName', 'field' => 'budget', 'mapper' => 'Budgets', ], - 'rabo-debit-credit' => [ + 'rabo-debit-credit' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'RabobankDebitCredit', 'field' => 'amount-modifier', ], - 'ing-debit-credit' => [ + 'ing-debit-credit' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'INGDebitCredit', 'field' => 'amount-modifier', ], - 'category-id' => [ + 'category-id' => [ 'mappable' => true, 'pre-process-map' => false, 'converter' => 'CategoryId', 'field' => 'category', 'mapper' => 'Categories', ], - 'category-name' => [ + 'category-name' => [ 'mappable' => true, 'pre-process-map' => false, 'converter' => 'CategoryName', 'field' => 'category', 'mapper' => 'Categories', ], - 'tags-comma' => [ + 'tags-comma' => [ 'mappable' => false, 'pre-process-map' => true, 'pre-process-mapper' => 'TagsComma', @@ -240,7 +246,7 @@ return [ 'converter' => 'TagsComma', 'mapper' => 'Tags', ], - 'tags-space' => [ + 'tags-space' => [ 'mappable' => false, 'pre-process-map' => true, 'pre-process-mapper' => 'TagsSpace', @@ -248,21 +254,21 @@ return [ 'converter' => 'TagsSpace', 'mapper' => 'Tags', ], - 'account-id' => [ + 'account-id' => [ 'mappable' => true, 'pre-process-map' => false, 'field' => 'asset-account-id', 'converter' => 'AccountId', 'mapper' => 'AssetAccounts', ], - 'account-name' => [ + 'account-name' => [ 'mappable' => true, 'pre-process-map' => false, 'field' => 'asset-account-name', 'converter' => 'AssetAccountName', 'mapper' => 'AssetAccounts', ], - 'account-iban' => [ + 'account-iban' => [ 'mappable' => true, 'pre-process-map' => false, 'field' => 'asset-account-iban', @@ -270,66 +276,66 @@ return [ 'mapper' => 'AssetAccountIbans', ], - 'account-number' => [ + 'account-number' => [ 'mappable' => true, 'pre-process-map' => false, 'field' => 'asset-account-number', 'converter' => 'AssetAccountNumber', 'mapper' => 'AssetAccounts', ], - 'opposing-id' => [ + 'opposing-id' => [ 'mappable' => true, 'pre-process-map' => false, 'field' => 'opposing-account-id', 'converter' => 'AccountId', 'mapper' => 'OpposingAccounts', ], - 'opposing-bic' => [ + 'opposing-bic' => [ 'mappable' => false, 'pre-process-map' => false, 'field' => 'opposing-account-bic', 'converter' => 'AccountBic', ], - 'opposing-name' => [ + 'opposing-name' => [ 'mappable' => true, 'pre-process-map' => false, 'field' => 'opposing-account-name', 'converter' => 'OpposingAccountName', 'mapper' => 'OpposingAccounts', ], - 'opposing-iban' => [ + 'opposing-iban' => [ 'mappable' => true, 'pre-process-map' => false, 'field' => 'opposing-account-iban', 'converter' => 'OpposingAccountIban', 'mapper' => 'OpposingAccountIbans', ], - 'opposing-number' => [ + 'opposing-number' => [ 'mappable' => true, 'pre-process-map' => false, 'field' => 'opposing-account-number', 'converter' => 'OpposingAccountNumber', 'mapper' => 'OpposingAccounts', ], - 'amount' => [ + 'amount' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Amount', 'field' => 'amount', ], - 'amount_debit' => [ + 'amount_debit' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'AmountDebit', 'field' => 'amount_debit', ], - 'amount_credit' => [ + 'amount_credit' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'AmountCredit', 'field' => 'amount_credit', ], - 'amount_foreign' => [ + 'amount_foreign' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Amount', @@ -337,56 +343,56 @@ return [ ], // SEPA end to end ID - 'sepa-ct-id' => [ + 'sepa-ct-id' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', 'field' => 'sepa_ct_id', ], // SEPA opposing account identifier - 'sepa-ct-op' => [ + 'sepa-ct-op' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', 'field' => 'sepa_ct_op', ], // SEPA Direct Debit Mandate Identifier - 'sepa-db' => [ + 'sepa-db' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', 'field' => 'sepa_db', ], // SEPA clearing code - 'sepa-cc' => [ + 'sepa-cc' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', 'field' => 'sepa_cc', ], // SEPA country - 'sepa-country' => [ + 'sepa-country' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', 'field' => 'sepa_country', ], // SEPA external purpose - 'sepa-ep' => [ + 'sepa-ep' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', 'field' => 'sepa_ep', ], // SEPA creditor identifier - 'sepa-ci' => [ + 'sepa-ci' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', 'field' => 'sepa_ci', ], // Internal reference - 'internal-reference' => [ + 'internal-reference' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', diff --git a/config/firefly.php b/config/firefly.php index 1b0a7639b7..70a3b9047a 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -1,4 +1,58 @@ . */ -declare(strict_types=1); /* * DO NOT EDIT THIS FILE. IT IS AUTO GENERATED. @@ -33,7 +86,7 @@ return [ 'is_demo_site' => false, ], 'encryption' => null === env('USE_ENCRYPTION') || env('USE_ENCRYPTION') === true, - 'version' => '4.7.2', + 'version' => '4.7.2.1', 'api_version' => '0.1', 'db_version' => 2, 'maxUploadSize' => 15242880, @@ -101,20 +154,20 @@ return [ ], 'list_length' => 10, 'export_formats' => [ - 'csv' => 'FireflyIII\Export\Exporter\CsvExporter', + 'csv' => CsvExporter::class, ], 'spectre' => [ 'server' => 'https://www.saltedge.com', ], - 'default_export_format' => 'csv', - 'default_import_format' => 'csv', - 'bill_periods' => ['weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], - 'accountRoles' => ['defaultAsset', 'sharedAsset', 'savingAsset', 'ccAsset',], - 'ccTypes' => [ + 'default_export_format' => 'csv', + 'default_import_format' => 'csv', + 'bill_periods' => ['weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], + 'accountRoles' => ['defaultAsset', 'sharedAsset', 'savingAsset', 'ccAsset',], + 'ccTypes' => [ 'monthlyFull' => 'Full payment every month', ], - 'range_to_repeat_freq' => [ + 'range_to_repeat_freq' => [ '1D' => 'weekly', '1W' => 'weekly', '1M' => 'monthly', @@ -123,14 +176,14 @@ return [ '1Y' => 'yearly', 'custom' => 'custom', ], - 'subTitlesByIdentifier' => + 'subTitlesByIdentifier' => [ 'asset' => 'Asset accounts', 'expense' => 'Expense accounts', 'revenue' => 'Revenue accounts', 'cash' => 'Cash accounts', ], - 'subIconsByIdentifier' => + 'subIconsByIdentifier' => [ 'asset' => 'fa-money', 'Asset account' => 'fa-money', @@ -144,14 +197,14 @@ return [ 'import' => 'fa-download', 'Import account' => 'fa-download', ], - 'accountTypesByIdentifier' => + 'accountTypesByIdentifier' => [ 'asset' => ['Default account', 'Asset account'], 'expense' => ['Expense account', 'Beneficiary account'], 'revenue' => ['Revenue account'], 'import' => ['Import account'], ], - 'accountTypeByIdentifier' => + 'accountTypeByIdentifier' => [ 'asset' => 'Asset account', 'expense' => 'Expense account', @@ -161,7 +214,7 @@ return [ 'import' => 'Import account', 'reconcile' => 'Reconciliation account', ], - 'shortNamesByFullName' => + 'shortNamesByFullName' => [ 'Default account' => 'asset', 'Asset account' => 'asset', @@ -171,7 +224,7 @@ return [ 'Revenue account' => 'revenue', 'Cash account' => 'cash', ], - 'languages' => [ + 'languages' => [ // completed languages 'en_US' => ['name_locale' => 'English', 'name_english' => 'English'], 'es_ES' => ['name_locale' => 'Español', 'name_english' => 'Spanish'], @@ -188,7 +241,7 @@ return [ // incomplete languages: // 'ca_ES' => ['name_locale' => 'Català', 'name_english' => 'Catalan'], ], - 'transactionTypesByWhat' => [ + 'transactionTypesByWhat' => [ 'expenses' => ['Withdrawal'], 'withdrawal' => ['Withdrawal'], 'revenue' => ['Deposit'], @@ -196,7 +249,7 @@ return [ 'transfer' => ['Transfer'], 'transfers' => ['Transfer'], ], - 'transactionIconsByWhat' => [ + 'transactionIconsByWhat' => [ 'expenses' => 'fa-long-arrow-left', 'withdrawal' => 'fa-long-arrow-left', 'revenue' => 'fa-long-arrow-right', @@ -205,7 +258,7 @@ return [ 'transfers' => 'fa-exchange', ], - 'bindables' => [ + 'bindables' => [ // models 'account' => \FireflyIII\Models\Account::class, 'attachment' => \FireflyIII\Models\Attachment::class, @@ -249,60 +302,60 @@ return [ ], - 'rule-triggers' => [ - 'user_action' => 'FireflyIII\TransactionRules\Triggers\UserAction', - 'from_account_starts' => 'FireflyIII\TransactionRules\Triggers\FromAccountStarts', - 'from_account_ends' => 'FireflyIII\TransactionRules\Triggers\FromAccountEnds', - 'from_account_is' => 'FireflyIII\TransactionRules\Triggers\FromAccountIs', - 'from_account_contains' => 'FireflyIII\TransactionRules\Triggers\FromAccountContains', - 'to_account_starts' => 'FireflyIII\TransactionRules\Triggers\ToAccountStarts', - 'to_account_ends' => 'FireflyIII\TransactionRules\Triggers\ToAccountEnds', - 'to_account_is' => 'FireflyIII\TransactionRules\Triggers\ToAccountIs', - 'to_account_contains' => 'FireflyIII\TransactionRules\Triggers\ToAccountContains', - 'amount_less' => 'FireflyIII\TransactionRules\Triggers\AmountLess', - 'amount_exactly' => 'FireflyIII\TransactionRules\Triggers\AmountExactly', - 'amount_more' => 'FireflyIII\TransactionRules\Triggers\AmountMore', - 'description_starts' => 'FireflyIII\TransactionRules\Triggers\DescriptionStarts', - 'description_ends' => 'FireflyIII\TransactionRules\Triggers\DescriptionEnds', - 'description_contains' => 'FireflyIII\TransactionRules\Triggers\DescriptionContains', - 'description_is' => 'FireflyIII\TransactionRules\Triggers\DescriptionIs', - 'transaction_type' => 'FireflyIII\TransactionRules\Triggers\TransactionType', - 'category_is' => 'FireflyIII\TransactionRules\Triggers\CategoryIs', - 'budget_is' => 'FireflyIII\TransactionRules\Triggers\BudgetIs', - 'tag_is' => 'FireflyIII\TransactionRules\Triggers\TagIs', - 'has_attachments' => 'FireflyIII\TransactionRules\Triggers\HasAttachment', - 'has_no_category' => 'FireflyIII\TransactionRules\Triggers\HasNoCategory', - 'has_any_category' => 'FireflyIII\TransactionRules\Triggers\HasAnyCategory', - 'has_no_budget' => 'FireflyIII\TransactionRules\Triggers\HasNoBudget', - 'has_any_budget' => 'FireflyIII\TransactionRules\Triggers\HasAnyBudget', - 'has_no_tag' => 'FireflyIII\TransactionRules\Triggers\HasNoTag', - 'has_any_tag' => 'FireflyIII\TransactionRules\Triggers\HasAnyTag', - 'notes_contain' => 'FireflyIII\TransactionRules\Triggers\NotesContain', - 'notes_start' => 'FireflyIII\TransactionRules\Triggers\NotesStart', - 'notes_end' => 'FireflyIII\TransactionRules\Triggers\NotesEnd', - 'notes_are' => 'FireflyIII\TransactionRules\Triggers\NotesAre', - 'no_notes' => 'FireflyIII\TransactionRules\Triggers\NotesEmpty', - 'any_notes' => 'FireflyIII\TransactionRules\Triggers\NotesAny', + 'rule-triggers' => [ + 'user_action' => UserAction::class, + 'from_account_starts' => FromAccountStarts::class, + 'from_account_ends' => FromAccountEnds::class, + 'from_account_is' => FromAccountIs::class, + 'from_account_contains' => FromAccountContains::class, + 'to_account_starts' => ToAccountStarts::class, + 'to_account_ends' => ToAccountEnds::class, + 'to_account_is' => ToAccountIs::class, + 'to_account_contains' => ToAccountContains::class, + 'amount_less' => AmountLess::class, + 'amount_exactly' => AmountExactly::class, + 'amount_more' => AmountMore::class, + 'description_starts' => DescriptionStarts::class, + 'description_ends' => DescriptionEnds::class, + 'description_contains' => DescriptionContains::class, + 'description_is' => DescriptionIs::class, + 'transaction_type' => TransactionType::class, + 'category_is' => CategoryIs::class, + 'budget_is' => BudgetIs::class, + 'tag_is' => TagIs::class, + 'has_attachments' => HasAttachment::class, + 'has_no_category' => HasNoCategory::class, + 'has_any_category' => HasAnyCategory::class, + 'has_no_budget' => HasNoBudget::class, + 'has_any_budget' => HasAnyBudget::class, + 'has_no_tag' => HasNoTag::class, + 'has_any_tag' => HasAnyTag::class, + 'notes_contain' => NotesContain::class, + 'notes_start' => NotesStart::class, + 'notes_end' => NotesEnd::class, + 'notes_are' => NotesAre::class, + 'no_notes' => NotesEmpty::class, + 'any_notes' => NotesAny::class, ], - 'rule-actions' => [ - 'set_category' => 'FireflyIII\TransactionRules\Actions\SetCategory', - 'clear_category' => 'FireflyIII\TransactionRules\Actions\ClearCategory', - 'set_budget' => 'FireflyIII\TransactionRules\Actions\SetBudget', - 'clear_budget' => 'FireflyIII\TransactionRules\Actions\ClearBudget', - 'add_tag' => 'FireflyIII\TransactionRules\Actions\AddTag', - 'remove_tag' => 'FireflyIII\TransactionRules\Actions\RemoveTag', - 'remove_all_tags' => 'FireflyIII\TransactionRules\Actions\RemoveAllTags', - 'set_description' => 'FireflyIII\TransactionRules\Actions\SetDescription', - 'append_description' => 'FireflyIII\TransactionRules\Actions\AppendDescription', - 'prepend_description' => 'FireflyIII\TransactionRules\Actions\PrependDescription', - 'set_source_account' => 'FireflyIII\TransactionRules\Actions\SetSourceAccount', - 'set_destination_account' => 'FireflyIII\TransactionRules\Actions\SetDestinationAccount', - 'set_notes' => 'FireflyIII\TransactionRules\Actions\SetNotes', - 'append_notes' => 'FireflyIII\TransactionRules\Actions\AppendNotes', - 'prepend_notes' => 'FireflyIII\TransactionRules\Actions\PrependNotes', - 'clear_notes' => 'FireflyIII\TransactionRules\Actions\ClearNotes', + 'rule-actions' => [ + 'set_category' => SetCategory::class, + 'clear_category' => ClearCategory::class, + 'set_budget' => SetBudget::class, + 'clear_budget' => ClearBudget::class, + 'add_tag' => AddTag::class, + 'remove_tag' => RemoveTag::class, + 'remove_all_tags' => RemoveAllTags::class, + 'set_description' => SetDescription::class, + 'append_description' => AppendDescription::class, + 'prepend_description' => PrependDescription::class, + 'set_source_account' => SetSourceAccount::class, + 'set_destination_account' => SetDestinationAccount::class, + 'set_notes' => SetNotes::class, + 'append_notes' => AppendNotes::class, + 'prepend_notes' => PrependNotes::class, + 'clear_notes' => ClearNotes::class, ], - 'rule-actions-text' => [ + 'rule-actions-text' => [ 'set_category', 'set_budget', 'add_tag', @@ -311,18 +364,13 @@ return [ 'append_description', 'prepend_description', ], - 'test-triggers' => [ + 'test-triggers' => [ 'limit' => 10, 'range' => 200, ], - 'default_currency' => 'EUR', - 'default_language' => 'en_US', - 'search_modifiers' => ['amount_is', 'amount', 'amount_max', 'amount_min', 'amount_less', 'amount_more', 'source', 'destination', 'category', - 'budget', 'bill', 'type', 'date', 'date_before', 'date_after', 'on', 'before', 'after'], + 'default_currency' => 'EUR', + 'default_language' => 'en_US', + 'search_modifiers' => ['amount_is', 'amount', 'amount_max', 'amount_min', 'amount_less', 'amount_more', 'source', 'destination', 'category', + 'budget', 'bill', 'type', 'date', 'date_before', 'date_after', 'on', 'before', 'after'], // tag notes has_attachments - 'currency_exchange_services' => [ - 'fixerio' => 'FireflyIII\Services\Currency\FixerIO', - ], - 'preferred_exchange_service' => 'fixerio', - ]; diff --git a/config/google2fa.php b/config/google2fa.php index 0e99a087d1..2ff91b26c2 100644 --- a/config/google2fa.php +++ b/config/google2fa.php @@ -2,7 +2,6 @@ declare(strict_types=1); - /** * google2fa.php * Copyright (c) 2018 thegrumpydictator@gmail.com @@ -54,17 +53,17 @@ return [ * 2FA verified session var */ - 'session_var' => 'google2fa', + 'session_var' => 'google2fa', /* * One Time Password request input name */ - 'otp_input' => 'one_time_password', + 'otp_input' => 'one_time_password', /* * One Time Password Window */ - 'window' => 1, + 'window' => 1, /* * Forbid user to reuse One Time Passwords. @@ -74,17 +73,17 @@ return [ /* * User's table column for google2fa secret */ - 'otp_secret_column' => 'google2fa_secret', + 'otp_secret_column' => 'google2fa_secret', /* * One Time Password View */ - 'view' => 'google2fa.index', + 'view' => 'google2fa.index', /* * One Time Password error message */ - 'error_messages' => [ + 'error_messages' => [ 'wrong_otp' => "The 'One Time Password' typed was wrong.", ], diff --git a/config/import.php b/config/import.php index e078a78ea1..b6a05b62dc 100644 --- a/config/import.php +++ b/config/import.php @@ -1,4 +1,17 @@ . */ -declare(strict_types=1); return [ 'enabled' => [ @@ -29,22 +41,22 @@ return [ 'plaid' => false, ], 'prerequisites' => [ - 'file' => 'FireflyIII\Import\Prerequisites\FilePrerequisites', - 'bunq' => 'FireflyIII\Import\Prerequisites\BunqPrerequisites', - 'spectre' => 'FireflyIII\Import\Prerequisites\SpectrePrerequisites', + 'file' => FilePrerequisites::class, + 'bunq' => BunqPrerequisites::class, + 'spectre' => SpectrePrerequisites::class, 'plaid' => 'FireflyIII\Import\Prerequisites\PlaidPrerequisites', ], 'configuration' => [ - 'file' => 'FireflyIII\Import\Configuration\FileConfigurator', - 'bunq' => 'FireflyIII\Import\Configuration\BunqConfigurator', - 'spectre' => 'FireflyIII\Import\Configuration\SpectreConfigurator', + 'file' => FileConfigurator::class, + 'bunq' => BunqConfigurator::class, + 'spectre' => SpectreConfigurator::class, 'plaid' => 'FireflyIII\Import\Configuration\PlaidConfigurator', ], 'routine' => [ - 'file' => 'FireflyIII\Import\Routine\FileRoutine', - 'bunq' => 'FireflyIII\Import\Routine\BunqRoutine', - 'spectre' => 'FireflyIII\Import\Routine\SpectreRoutine', + 'file' => FileRoutine::class, + 'bunq' => BunqRoutine::class, + 'spectre' => SpectreRoutine::class, 'plaid' => 'FireflyIII\Import\Routine\PlaidRoutine', ], @@ -53,7 +65,7 @@ return [ 'import_formats' => ['csv'], // mt940 'default_import_format' => 'csv', 'processors' => [ - 'csv' => 'FireflyIII\Import\FileProcessor\CsvProcessor', + 'csv' => CsvProcessor::class, ], ], 'bunq' => [ diff --git a/config/intro.php b/config/intro.php index dafcb13bac..29fccb7fa0 100644 --- a/config/intro.php +++ b/config/intro.php @@ -37,7 +37,7 @@ return [ ], // accounts: create 'accounts_create' => [ - 'iban' => ['element' => '#ffInput_iban'], + 'iban' => ['element' => '#ffInput_iban'], ], // extra text for asset account creation. 'accounts_create_asset' => [ diff --git a/config/twigbridge.php b/config/twigbridge.php index 2433a298c2..60f2d36c79 100644 --- a/config/twigbridge.php +++ b/config/twigbridge.php @@ -1,4 +1,18 @@ . */ -declare(strict_types=1); - /** * Configuration options for Twig. @@ -59,7 +71,7 @@ return [ // The base template class to use for generated templates. // default: TwigBridge\Twig\Template - 'base_template_class' => 'TwigBridge\Twig\Template', + 'base_template_class' => Template::class, // An absolute path where to store the compiled templates, or false to disable caching. If null // then the cache file path is used. @@ -111,18 +123,18 @@ return [ | */ 'enabled' => [ - 'TwigBridge\Extension\Loader\Facades', - 'TwigBridge\Extension\Loader\Filters', - 'TwigBridge\Extension\Loader\Functions', + Facades::class, + Filters::class, + Functions::class, - 'TwigBridge\Extension\Laravel\Auth', - 'TwigBridge\Extension\Laravel\Config', - 'TwigBridge\Extension\Laravel\Dump', - 'TwigBridge\Extension\Laravel\Input', - 'TwigBridge\Extension\Laravel\Session', - 'TwigBridge\Extension\Laravel\Str', - 'TwigBridge\Extension\Laravel\Translator', - 'TwigBridge\Extension\Laravel\Url', + Auth::class, + Config::class, + Dump::class, + Input::class, + Session::class, + Str::class, + Translator::class, + Url::class, // 'TwigBridge\Extension\Laravel\Gate', // 'TwigBridge\Extension\Laravel\Form', diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index bcd5edae50..5a1e9ee90d 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -239,8 +239,8 @@ $factory->define( FireflyIII\Models\Transaction::class, function (Faker\Generator $faker) { return [ - 'transaction_amount' => strval($faker->randomFloat(2, -100, 100)), - 'destination_amount' => strval($faker->randomFloat(2, -100, 100)), + 'transaction_amount' => (string)$faker->randomFloat(2, -100, 100), + 'destination_amount' => (string)$faker->randomFloat(2, -100, 100), 'opposing_account_id' => $faker->numberBetween(1, 10), 'source_account_id' => $faker->numberBetween(1, 10), 'opposing_account_name' => $faker->words(3, true), @@ -249,7 +249,7 @@ $factory->define( 'destination_account_id' => $faker->numberBetween(1, 10), 'date' => new Carbon, 'destination_account_name' => $faker->words(3, true), - 'amount' => strval($faker->randomFloat(2, -100, 100)), + 'amount' => (string)$faker->randomFloat(2, -100, 100), 'budget_id' => 0, 'category' => $faker->words(3, true), 'transaction_journal_id' => $faker->numberBetween(1, 10), diff --git a/database/seeds/ConfigSeeder.php b/database/seeds/ConfigSeeder.php index 73a3955c03..e37857aa81 100644 --- a/database/seeds/ConfigSeeder.php +++ b/database/seeds/ConfigSeeder.php @@ -14,7 +14,7 @@ class ConfigSeeder extends Seeder public function run() { $entry = Configuration::where('name', 'db_version')->first(); - if (is_null($entry)) { + if (null === $entry) { Log::warning('No database version entry is present. Database is assumed to be OLD (version 1).'); // FF old or no version present. Put at 1: Configuration::create( @@ -24,8 +24,8 @@ class ConfigSeeder extends Seeder ] ); } - if (!is_null($entry)) { - $version = intval(config('firefly.db_version')); + if (null !== $entry) { + $version = (int)config('firefly.db_version'); $entry->data = $version; $entry->save(); diff --git a/public/css/app.css b/public/css/app.css index 99c3d14a5b..9fbbfd93bb 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -6,7 +6,7 @@ /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0} -/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{background:transparent!important;color:#000!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:Glyphicons Halflings;src:url(../fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.eot?f4769f9bdb7466be65088239c12046d1);src:url(../fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.eot?f4769f9bdb7466be65088239c12046d1?#iefix) format("embedded-opentype"),url(../fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affeb) format("woff2"),url(../fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff?fa2772327f55d8198301fdb8bcfc8158) format("woff"),url(../fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.ttf?e18bbf611f2a2e43afc071aa2f4e1512) format("truetype"),url(../fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.svg?89889688147bd7575d6327160d64e760#glyphicons_halflingsregular) format("svg")}.glyphicon{position:relative;top:1px;display:inline-block;font-family:Glyphicons Halflings;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"*"}.glyphicon-plus:before{content:"+"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20AC"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270F"}.glyphicon-glass:before{content:"\E001"}.glyphicon-music:before{content:"\E002"}.glyphicon-search:before{content:"\E003"}.glyphicon-heart:before{content:"\E005"}.glyphicon-star:before{content:"\E006"}.glyphicon-star-empty:before{content:"\E007"}.glyphicon-user:before{content:"\E008"}.glyphicon-film:before{content:"\E009"}.glyphicon-th-large:before{content:"\E010"}.glyphicon-th:before{content:"\E011"}.glyphicon-th-list:before{content:"\E012"}.glyphicon-ok:before{content:"\E013"}.glyphicon-remove:before{content:"\E014"}.glyphicon-zoom-in:before{content:"\E015"}.glyphicon-zoom-out:before{content:"\E016"}.glyphicon-off:before{content:"\E017"}.glyphicon-signal:before{content:"\E018"}.glyphicon-cog:before{content:"\E019"}.glyphicon-trash:before{content:"\E020"}.glyphicon-home:before{content:"\E021"}.glyphicon-file:before{content:"\E022"}.glyphicon-time:before{content:"\E023"}.glyphicon-road:before{content:"\E024"}.glyphicon-download-alt:before{content:"\E025"}.glyphicon-download:before{content:"\E026"}.glyphicon-upload:before{content:"\E027"}.glyphicon-inbox:before{content:"\E028"}.glyphicon-play-circle:before{content:"\E029"}.glyphicon-repeat:before{content:"\E030"}.glyphicon-refresh:before{content:"\E031"}.glyphicon-list-alt:before{content:"\E032"}.glyphicon-lock:before{content:"\E033"}.glyphicon-flag:before{content:"\E034"}.glyphicon-headphones:before{content:"\E035"}.glyphicon-volume-off:before{content:"\E036"}.glyphicon-volume-down:before{content:"\E037"}.glyphicon-volume-up:before{content:"\E038"}.glyphicon-qrcode:before{content:"\E039"}.glyphicon-barcode:before{content:"\E040"}.glyphicon-tag:before{content:"\E041"}.glyphicon-tags:before{content:"\E042"}.glyphicon-book:before{content:"\E043"}.glyphicon-bookmark:before{content:"\E044"}.glyphicon-print:before{content:"\E045"}.glyphicon-camera:before{content:"\E046"}.glyphicon-font:before{content:"\E047"}.glyphicon-bold:before{content:"\E048"}.glyphicon-italic:before{content:"\E049"}.glyphicon-text-height:before{content:"\E050"}.glyphicon-text-width:before{content:"\E051"}.glyphicon-align-left:before{content:"\E052"}.glyphicon-align-center:before{content:"\E053"}.glyphicon-align-right:before{content:"\E054"}.glyphicon-align-justify:before{content:"\E055"}.glyphicon-list:before{content:"\E056"}.glyphicon-indent-left:before{content:"\E057"}.glyphicon-indent-right:before{content:"\E058"}.glyphicon-facetime-video:before{content:"\E059"}.glyphicon-picture:before{content:"\E060"}.glyphicon-map-marker:before{content:"\E062"}.glyphicon-adjust:before{content:"\E063"}.glyphicon-tint:before{content:"\E064"}.glyphicon-edit:before{content:"\E065"}.glyphicon-share:before{content:"\E066"}.glyphicon-check:before{content:"\E067"}.glyphicon-move:before{content:"\E068"}.glyphicon-step-backward:before{content:"\E069"}.glyphicon-fast-backward:before{content:"\E070"}.glyphicon-backward:before{content:"\E071"}.glyphicon-play:before{content:"\E072"}.glyphicon-pause:before{content:"\E073"}.glyphicon-stop:before{content:"\E074"}.glyphicon-forward:before{content:"\E075"}.glyphicon-fast-forward:before{content:"\E076"}.glyphicon-step-forward:before{content:"\E077"}.glyphicon-eject:before{content:"\E078"}.glyphicon-chevron-left:before{content:"\E079"}.glyphicon-chevron-right:before{content:"\E080"}.glyphicon-plus-sign:before{content:"\E081"}.glyphicon-minus-sign:before{content:"\E082"}.glyphicon-remove-sign:before{content:"\E083"}.glyphicon-ok-sign:before{content:"\E084"}.glyphicon-question-sign:before{content:"\E085"}.glyphicon-info-sign:before{content:"\E086"}.glyphicon-screenshot:before{content:"\E087"}.glyphicon-remove-circle:before{content:"\E088"}.glyphicon-ok-circle:before{content:"\E089"}.glyphicon-ban-circle:before{content:"\E090"}.glyphicon-arrow-left:before{content:"\E091"}.glyphicon-arrow-right:before{content:"\E092"}.glyphicon-arrow-up:before{content:"\E093"}.glyphicon-arrow-down:before{content:"\E094"}.glyphicon-share-alt:before{content:"\E095"}.glyphicon-resize-full:before{content:"\E096"}.glyphicon-resize-small:before{content:"\E097"}.glyphicon-exclamation-sign:before{content:"\E101"}.glyphicon-gift:before{content:"\E102"}.glyphicon-leaf:before{content:"\E103"}.glyphicon-fire:before{content:"\E104"}.glyphicon-eye-open:before{content:"\E105"}.glyphicon-eye-close:before{content:"\E106"}.glyphicon-warning-sign:before{content:"\E107"}.glyphicon-plane:before{content:"\E108"}.glyphicon-calendar:before{content:"\E109"}.glyphicon-random:before{content:"\E110"}.glyphicon-comment:before{content:"\E111"}.glyphicon-magnet:before{content:"\E112"}.glyphicon-chevron-up:before{content:"\E113"}.glyphicon-chevron-down:before{content:"\E114"}.glyphicon-retweet:before{content:"\E115"}.glyphicon-shopping-cart:before{content:"\E116"}.glyphicon-folder-close:before{content:"\E117"}.glyphicon-folder-open:before{content:"\E118"}.glyphicon-resize-vertical:before{content:"\E119"}.glyphicon-resize-horizontal:before{content:"\E120"}.glyphicon-hdd:before{content:"\E121"}.glyphicon-bullhorn:before{content:"\E122"}.glyphicon-bell:before{content:"\E123"}.glyphicon-certificate:before{content:"\E124"}.glyphicon-thumbs-up:before{content:"\E125"}.glyphicon-thumbs-down:before{content:"\E126"}.glyphicon-hand-right:before{content:"\E127"}.glyphicon-hand-left:before{content:"\E128"}.glyphicon-hand-up:before{content:"\E129"}.glyphicon-hand-down:before{content:"\E130"}.glyphicon-circle-arrow-right:before{content:"\E131"}.glyphicon-circle-arrow-left:before{content:"\E132"}.glyphicon-circle-arrow-up:before{content:"\E133"}.glyphicon-circle-arrow-down:before{content:"\E134"}.glyphicon-globe:before{content:"\E135"}.glyphicon-wrench:before{content:"\E136"}.glyphicon-tasks:before{content:"\E137"}.glyphicon-filter:before{content:"\E138"}.glyphicon-briefcase:before{content:"\E139"}.glyphicon-fullscreen:before{content:"\E140"}.glyphicon-dashboard:before{content:"\E141"}.glyphicon-paperclip:before{content:"\E142"}.glyphicon-heart-empty:before{content:"\E143"}.glyphicon-link:before{content:"\E144"}.glyphicon-phone:before{content:"\E145"}.glyphicon-pushpin:before{content:"\E146"}.glyphicon-usd:before{content:"\E148"}.glyphicon-gbp:before{content:"\E149"}.glyphicon-sort:before{content:"\E150"}.glyphicon-sort-by-alphabet:before{content:"\E151"}.glyphicon-sort-by-alphabet-alt:before{content:"\E152"}.glyphicon-sort-by-order:before{content:"\E153"}.glyphicon-sort-by-order-alt:before{content:"\E154"}.glyphicon-sort-by-attributes:before{content:"\E155"}.glyphicon-sort-by-attributes-alt:before{content:"\E156"}.glyphicon-unchecked:before{content:"\E157"}.glyphicon-expand:before{content:"\E158"}.glyphicon-collapse-down:before{content:"\E159"}.glyphicon-collapse-up:before{content:"\E160"}.glyphicon-log-in:before{content:"\E161"}.glyphicon-flash:before{content:"\E162"}.glyphicon-log-out:before{content:"\E163"}.glyphicon-new-window:before{content:"\E164"}.glyphicon-record:before{content:"\E165"}.glyphicon-save:before{content:"\E166"}.glyphicon-open:before{content:"\E167"}.glyphicon-saved:before{content:"\E168"}.glyphicon-import:before{content:"\E169"}.glyphicon-export:before{content:"\E170"}.glyphicon-send:before{content:"\E171"}.glyphicon-floppy-disk:before{content:"\E172"}.glyphicon-floppy-saved:before{content:"\E173"}.glyphicon-floppy-remove:before{content:"\E174"}.glyphicon-floppy-save:before{content:"\E175"}.glyphicon-floppy-open:before{content:"\E176"}.glyphicon-credit-card:before{content:"\E177"}.glyphicon-transfer:before{content:"\E178"}.glyphicon-cutlery:before{content:"\E179"}.glyphicon-header:before{content:"\E180"}.glyphicon-compressed:before{content:"\E181"}.glyphicon-earphone:before{content:"\E182"}.glyphicon-phone-alt:before{content:"\E183"}.glyphicon-tower:before{content:"\E184"}.glyphicon-stats:before{content:"\E185"}.glyphicon-sd-video:before{content:"\E186"}.glyphicon-hd-video:before{content:"\E187"}.glyphicon-subtitles:before{content:"\E188"}.glyphicon-sound-stereo:before{content:"\E189"}.glyphicon-sound-dolby:before{content:"\E190"}.glyphicon-sound-5-1:before{content:"\E191"}.glyphicon-sound-6-1:before{content:"\E192"}.glyphicon-sound-7-1:before{content:"\E193"}.glyphicon-copyright-mark:before{content:"\E194"}.glyphicon-registration-mark:before{content:"\E195"}.glyphicon-cloud-download:before{content:"\E197"}.glyphicon-cloud-upload:before{content:"\E198"}.glyphicon-tree-conifer:before{content:"\E199"}.glyphicon-tree-deciduous:before{content:"\E200"}.glyphicon-cd:before{content:"\E201"}.glyphicon-save-file:before{content:"\E202"}.glyphicon-open-file:before{content:"\E203"}.glyphicon-level-up:before{content:"\E204"}.glyphicon-copy:before{content:"\E205"}.glyphicon-paste:before{content:"\E206"}.glyphicon-alert:before{content:"\E209"}.glyphicon-equalizer:before{content:"\E210"}.glyphicon-king:before{content:"\E211"}.glyphicon-queen:before{content:"\E212"}.glyphicon-pawn:before{content:"\E213"}.glyphicon-bishop:before{content:"\E214"}.glyphicon-knight:before{content:"\E215"}.glyphicon-baby-formula:before{content:"\E216"}.glyphicon-tent:before{content:"\26FA"}.glyphicon-blackboard:before{content:"\E218"}.glyphicon-bed:before{content:"\E219"}.glyphicon-apple:before{content:"\F8FF"}.glyphicon-erase:before{content:"\E221"}.glyphicon-hourglass:before{content:"\231B"}.glyphicon-lamp:before{content:"\E223"}.glyphicon-duplicate:before{content:"\E224"}.glyphicon-piggy-bank:before{content:"\E225"}.glyphicon-scissors:before{content:"\E226"}.glyphicon-bitcoin:before,.glyphicon-btc:before,.glyphicon-xbt:before{content:"\E227"}.glyphicon-jpy:before,.glyphicon-yen:before{content:"\A5"}.glyphicon-rub:before,.glyphicon-ruble:before{content:"\20BD"}.glyphicon-scale:before{content:"\E230"}.glyphicon-ice-lolly:before{content:"\E231"}.glyphicon-ice-lolly-tasted:before{content:"\E232"}.glyphicon-education:before{content:"\E233"}.glyphicon-option-horizontal:before{content:"\E234"}.glyphicon-option-vertical:before{content:"\E235"}.glyphicon-menu-hamburger:before{content:"\E236"}.glyphicon-modal-window:before{content:"\E237"}.glyphicon-oil:before{content:"\E238"}.glyphicon-grain:before{content:"\E239"}.glyphicon-sunglasses:before{content:"\E240"}.glyphicon-text-size:before{content:"\E241"}.glyphicon-text-color:before{content:"\E242"}.glyphicon-text-background:before{content:"\E243"}.glyphicon-object-align-top:before{content:"\E244"}.glyphicon-object-align-bottom:before{content:"\E245"}.glyphicon-object-align-horizontal:before{content:"\E246"}.glyphicon-object-align-left:before{content:"\E247"}.glyphicon-object-align-vertical:before{content:"\E248"}.glyphicon-object-align-right:before{content:"\E249"}.glyphicon-triangle-right:before{content:"\E250"}.glyphicon-triangle-left:before{content:"\E251"}.glyphicon-triangle-bottom:before{content:"\E252"}.glyphicon-triangle-top:before{content:"\E253"}.glyphicon-console:before{content:"\E254"}.glyphicon-superscript:before{content:"\E255"}.glyphicon-subscript:before{content:"\E256"}.glyphicon-menu-left:before{content:"\E257"}.glyphicon-menu-right:before{content:"\E258"}.glyphicon-menu-down:before{content:"\E259"}.glyphicon-menu-up:before{content:"\E260"}*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:transparent}body{font-family:Raleway,sans-serif;font-size:14px;line-height:1.6;color:#636b6f;background-color:#f5f8fa}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#3097d1;text-decoration:none}a:focus,a:hover{color:#216a94;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.6;background-color:#f5f8fa;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:22px;margin-bottom:22px;border:0;border-top:1px solid #eee}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:22px;margin-bottom:11px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:11px;margin-bottom:11px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 11px}.lead{margin-bottom:22px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{background-color:#fcf8e3;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.initialism,.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#3097d1}a.text-primary:focus,a.text-primary:hover{color:#2579a9}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#3097d1}a.bg-primary:focus,a.bg-primary:hover{background-color:#2579a9}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:10px;margin:44px 0 22px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:11px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-inline,.list-unstyled{padding-left:0;list-style:none}.list-inline{margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:22px}dd,dt{line-height:1.6}dt{font-weight:700}dd{margin-left:0}.dl-horizontal dd:after,.dl-horizontal dd:before{content:" ";display:table}.dl-horizontal dd:after{clear:both}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%}blockquote{padding:11px 22px;margin:0 0 22px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.6;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:"\2014 \A0"}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:""}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:"\A0 \2014"}address{margin-bottom:22px;font-style:normal;line-height:1.6}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,Courier New,monospace}code{color:#c7254e;background-color:#f9f2f4;border-radius:4px}code,kbd{padding:2px 4px;font-size:90%}kbd{color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:10.5px;margin:0 0 11px;font-size:13px;line-height:1.6;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.container:after,.container:before{content:" ";display:table}.container:after{clear:both}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.container-fluid:after,.container-fluid:before{content:" ";display:table}.container-fluid:after{clear:both}.row{margin-left:-15px;margin-right:-15px}.row:after,.row:before{content:" ";display:table}.row:after{clear:both}.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-1{width:8.33333333%}.col-xs-2{width:16.66666667%}.col-xs-3{width:25%}.col-xs-4{width:33.33333333%}.col-xs-5{width:41.66666667%}.col-xs-6{width:50%}.col-xs-7{width:58.33333333%}.col-xs-8{width:66.66666667%}.col-xs-9{width:75%}.col-xs-10{width:83.33333333%}.col-xs-11{width:91.66666667%}.col-xs-12{width:100%}.col-xs-pull-0{right:auto}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-3{right:25%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-6{right:50%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-9{right:75%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-12{right:100%}.col-xs-push-0{left:auto}.col-xs-push-1{left:8.33333333%}.col-xs-push-2{left:16.66666667%}.col-xs-push-3{left:25%}.col-xs-push-4{left:33.33333333%}.col-xs-push-5{left:41.66666667%}.col-xs-push-6{left:50%}.col-xs-push-7{left:58.33333333%}.col-xs-push-8{left:66.66666667%}.col-xs-push-9{left:75%}.col-xs-push-10{left:83.33333333%}.col-xs-push-11{left:91.66666667%}.col-xs-push-12{left:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-12{margin-left:100%}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-1{width:8.33333333%}.col-sm-2{width:16.66666667%}.col-sm-3{width:25%}.col-sm-4{width:33.33333333%}.col-sm-5{width:41.66666667%}.col-sm-6{width:50%}.col-sm-7{width:58.33333333%}.col-sm-8{width:66.66666667%}.col-sm-9{width:75%}.col-sm-10{width:83.33333333%}.col-sm-11{width:91.66666667%}.col-sm-12{width:100%}.col-sm-pull-0{right:auto}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-3{right:25%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-6{right:50%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-9{right:75%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-12{right:100%}.col-sm-push-0{left:auto}.col-sm-push-1{left:8.33333333%}.col-sm-push-2{left:16.66666667%}.col-sm-push-3{left:25%}.col-sm-push-4{left:33.33333333%}.col-sm-push-5{left:41.66666667%}.col-sm-push-6{left:50%}.col-sm-push-7{left:58.33333333%}.col-sm-push-8{left:66.66666667%}.col-sm-push-9{left:75%}.col-sm-push-10{left:83.33333333%}.col-sm-push-11{left:91.66666667%}.col-sm-push-12{left:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-12{margin-left:100%}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-1{width:8.33333333%}.col-md-2{width:16.66666667%}.col-md-3{width:25%}.col-md-4{width:33.33333333%}.col-md-5{width:41.66666667%}.col-md-6{width:50%}.col-md-7{width:58.33333333%}.col-md-8{width:66.66666667%}.col-md-9{width:75%}.col-md-10{width:83.33333333%}.col-md-11{width:91.66666667%}.col-md-12{width:100%}.col-md-pull-0{right:auto}.col-md-pull-1{right:8.33333333%}.col-md-pull-2{right:16.66666667%}.col-md-pull-3{right:25%}.col-md-pull-4{right:33.33333333%}.col-md-pull-5{right:41.66666667%}.col-md-pull-6{right:50%}.col-md-pull-7{right:58.33333333%}.col-md-pull-8{right:66.66666667%}.col-md-pull-9{right:75%}.col-md-pull-10{right:83.33333333%}.col-md-pull-11{right:91.66666667%}.col-md-pull-12{right:100%}.col-md-push-0{left:auto}.col-md-push-1{left:8.33333333%}.col-md-push-2{left:16.66666667%}.col-md-push-3{left:25%}.col-md-push-4{left:33.33333333%}.col-md-push-5{left:41.66666667%}.col-md-push-6{left:50%}.col-md-push-7{left:58.33333333%}.col-md-push-8{left:66.66666667%}.col-md-push-9{left:75%}.col-md-push-10{left:83.33333333%}.col-md-push-11{left:91.66666667%}.col-md-push-12{left:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-12{margin-left:100%}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-1{width:8.33333333%}.col-lg-2{width:16.66666667%}.col-lg-3{width:25%}.col-lg-4{width:33.33333333%}.col-lg-5{width:41.66666667%}.col-lg-6{width:50%}.col-lg-7{width:58.33333333%}.col-lg-8{width:66.66666667%}.col-lg-9{width:75%}.col-lg-10{width:83.33333333%}.col-lg-11{width:91.66666667%}.col-lg-12{width:100%}.col-lg-pull-0{right:auto}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-3{right:25%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-6{right:50%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-9{right:75%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-12{right:100%}.col-lg-push-0{left:auto}.col-lg-push-1{left:8.33333333%}.col-lg-push-2{left:16.66666667%}.col-lg-push-3{left:25%}.col-lg-push-4{left:33.33333333%}.col-lg-push-5{left:41.66666667%}.col-lg-push-6{left:50%}.col-lg-push-7{left:58.33333333%}.col-lg-push-8{left:66.66666667%}.col-lg-push-9{left:75%}.col-lg-push-10{left:83.33333333%}.col-lg-push-11{left:91.66666667%}.col-lg-push-12{left:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-12{margin-left:100%}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777}caption,th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:22px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.6;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#f5f8fa}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered,.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;float:none;display:table-column}table td[class*=col-],table th[class*=col-]{position:static;float:none;display:table-cell}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{overflow-x:auto;min-height:.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:16.5px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{margin:0;min-width:0}fieldset,legend{padding:0;border:0}legend{display:block;width:100%;margin-bottom:22px;font-size:21px;line-height:inherit;color:#333;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{padding-top:7px}.form-control,output{display:block;font-size:14px;line-height:1.6;color:#555}.form-control{width:100%;height:36px;padding:6px 12px;background-color:#fff;background-image:none;border:1px solid #ccd0d2;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out}.form-control:focus{border-color:#98cbe8;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(152,203,232,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(152,203,232,.6)}.form-control::-moz-placeholder{color:#b1b7ba;opacity:1}.form-control:-ms-input-placeholder{color:#b1b7ba}.form-control::-webkit-input-placeholder{color:#b1b7ba}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{line-height:36px}.input-group-sm>.input-group-btn>input[type=date].btn,.input-group-sm>.input-group-btn>input[type=datetime-local].btn,.input-group-sm>.input-group-btn>input[type=month].btn,.input-group-sm>.input-group-btn>input[type=time].btn,.input-group-sm>input[type=date].form-control,.input-group-sm>input[type=date].input-group-addon,.input-group-sm>input[type=datetime-local].form-control,.input-group-sm>input[type=datetime-local].input-group-addon,.input-group-sm>input[type=month].form-control,.input-group-sm>input[type=month].input-group-addon,.input-group-sm>input[type=time].form-control,.input-group-sm>input[type=time].input-group-addon,.input-group-sm input[type=date],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],.input-group-sm input[type=time],input[type=date].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm,input[type=time].input-sm{line-height:30px}.input-group-lg>.input-group-btn>input[type=date].btn,.input-group-lg>.input-group-btn>input[type=datetime-local].btn,.input-group-lg>.input-group-btn>input[type=month].btn,.input-group-lg>.input-group-btn>input[type=time].btn,.input-group-lg>input[type=date].form-control,.input-group-lg>input[type=date].input-group-addon,.input-group-lg>input[type=datetime-local].form-control,.input-group-lg>input[type=datetime-local].input-group-addon,.input-group-lg>input[type=month].form-control,.input-group-lg>input[type=month].input-group-addon,.input-group-lg>input[type=time].form-control,.input-group-lg>input[type=time].input-group-addon,.input-group-lg input[type=date],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],.input-group-lg input[type=time],input[type=date].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg,input[type=time].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:22px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox-inline input[type=checkbox],.checkbox input[type=checkbox],.radio-inline input[type=radio],.radio input[type=radio]{position:absolute;margin-left:-20px;margin-top:4px\9}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:400;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}.checkbox-inline.disabled,.checkbox.disabled label,.radio-inline.disabled,.radio.disabled label,fieldset[disabled] .checkbox-inline,fieldset[disabled] .checkbox label,fieldset[disabled] .radio-inline,fieldset[disabled] .radio label,fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0;min-height:36px}.form-control-static.input-lg,.form-control-static.input-sm,.input-group-lg>.form-control-static.form-control,.input-group-lg>.form-control-static.input-group-addon,.input-group-lg>.input-group-btn>.form-control-static.btn,.input-group-sm>.form-control-static.form-control,.input-group-sm>.form-control-static.input-group-addon,.input-group-sm>.input-group-btn>.form-control-static.btn{padding-left:0;padding-right:0}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn,.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.input-group-sm>.input-group-btn>select.btn,.input-group-sm>select.form-control,.input-group-sm>select.input-group-addon,select.input-sm{height:30px;line-height:30px}.input-group-sm>.input-group-btn>select[multiple].btn,.input-group-sm>.input-group-btn>textarea.btn,.input-group-sm>select[multiple].form-control,.input-group-sm>select[multiple].input-group-addon,.input-group-sm>textarea.form-control,.input-group-sm>textarea.input-group-addon,select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:34px;padding:6px 10px;font-size:12px;line-height:1.5}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn,.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.input-group-lg>.input-group-btn>select.btn,.input-group-lg>select.form-control,.input-group-lg>select.input-group-addon,select.input-lg{height:46px;line-height:46px}.input-group-lg>.input-group-btn>select[multiple].btn,.input-group-lg>.input-group-btn>textarea.btn,.input-group-lg>select[multiple].form-control,.input-group-lg>select[multiple].input-group-addon,.input-group-lg>textarea.form-control,.input-group-lg>textarea.input-group-addon,select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:40px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:45px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:36px;height:36px;line-height:36px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-group-lg>.form-control+.form-control-feedback,.input-group-lg>.input-group-addon+.form-control-feedback,.input-group-lg>.input-group-btn>.btn+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-group-sm>.form-control+.form-control-feedback,.input-group-sm>.input-group-addon+.form-control-feedback,.input-group-sm>.input-group-btn>.btn+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success.checkbox-inline label,.has-success.checkbox label,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.radio-inline label,.has-success.radio label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning.checkbox-inline label,.has-warning.checkbox label,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.radio-inline label,.has-warning.radio label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error.checkbox-inline label,.has-error.checkbox label,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.radio-inline label,.has-error.radio label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:27px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#a4aaae}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .checkbox,.form-horizontal .radio{min-height:29px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .form-group:after,.form-horizontal .form-group:before{content:" ";display:table}.form-horizontal .form-group:after{clear:both}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:7px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.6;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#636b6f;text-decoration:none}.btn.active,.btn:active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#636b6f;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#636b6f;background-color:#e6e5e5;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.btn-default:hover,.open>.btn-default.dropdown-toggle{color:#636b6f;background-color:#e6e5e5;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.btn-default.dropdown-toggle.focus,.open>.btn-default.dropdown-toggle:focus,.open>.btn-default.dropdown-toggle:hover{color:#636b6f;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.btn-default.dropdown-toggle{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#636b6f}.btn-primary{color:#fff;background-color:#3097d1;border-color:#2a88bd}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#2579a9;border-color:#133d55}.btn-primary.active,.btn-primary:active,.btn-primary:hover,.open>.btn-primary.dropdown-toggle{color:#fff;background-color:#2579a9;border-color:#1f648b}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.btn-primary.dropdown-toggle.focus,.open>.btn-primary.dropdown-toggle:focus,.open>.btn-primary.dropdown-toggle:hover{color:#fff;background-color:#1f648b;border-color:#133d55}.btn-primary.active,.btn-primary:active,.open>.btn-primary.dropdown-toggle{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#3097d1;border-color:#2a88bd}.btn-primary .badge{color:#3097d1;background-color:#fff}.btn-success{color:#fff;background-color:#2ab27b;border-color:#259d6d}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#20895e;border-color:#0d3625}.btn-success.active,.btn-success:active,.btn-success:hover,.open>.btn-success.dropdown-toggle{color:#fff;background-color:#20895e;border-color:#196c4b}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.btn-success.dropdown-toggle.focus,.open>.btn-success.dropdown-toggle:focus,.open>.btn-success.dropdown-toggle:hover{color:#fff;background-color:#196c4b;border-color:#0d3625}.btn-success.active,.btn-success:active,.open>.btn-success.dropdown-toggle{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#2ab27b;border-color:#259d6d}.btn-success .badge{color:#2ab27b;background-color:#fff}.btn-info{color:#fff;background-color:#8eb4cb;border-color:#7da8c3}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#6b9dbb;border-color:#3d6983}.btn-info.active,.btn-info:active,.btn-info:hover,.open>.btn-info.dropdown-toggle{color:#fff;background-color:#6b9dbb;border-color:#538db0}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.btn-info.dropdown-toggle.focus,.open>.btn-info.dropdown-toggle:focus,.open>.btn-info.dropdown-toggle:hover{color:#fff;background-color:#538db0;border-color:#3d6983}.btn-info.active,.btn-info:active,.open>.btn-info.dropdown-toggle{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#8eb4cb;border-color:#7da8c3}.btn-info .badge{color:#8eb4cb;background-color:#fff}.btn-warning{color:#fff;background-color:#cbb956;border-color:#c5b143}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#b6a338;border-color:#685d20}.btn-warning.active,.btn-warning:active,.btn-warning:hover,.open>.btn-warning.dropdown-toggle{color:#fff;background-color:#b6a338;border-color:#9b8a30}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.btn-warning.dropdown-toggle.focus,.open>.btn-warning.dropdown-toggle:focus,.open>.btn-warning.dropdown-toggle:hover{color:#fff;background-color:#9b8a30;border-color:#685d20}.btn-warning.active,.btn-warning:active,.open>.btn-warning.dropdown-toggle{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#cbb956;border-color:#c5b143}.btn-warning .badge{color:#cbb956;background-color:#fff}.btn-danger{color:#fff;background-color:#bf5329;border-color:#aa4a24}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#954120;border-color:#411c0e}.btn-danger.active,.btn-danger:active,.btn-danger:hover,.open>.btn-danger.dropdown-toggle{color:#fff;background-color:#954120;border-color:#78341a}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.btn-danger.dropdown-toggle.focus,.open>.btn-danger.dropdown-toggle:focus,.open>.btn-danger.dropdown-toggle:hover{color:#fff;background-color:#78341a;border-color:#411c0e}.btn-danger.active,.btn-danger:active,.open>.btn-danger.dropdown-toggle{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#bf5329;border-color:#aa4a24}.btn-danger .badge{color:#bf5329;background-color:#fff}.btn-link{color:#3097d1;font-weight:400;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#216a94;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height,visibility;transition-property:height,visibility;-webkit-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:10px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.6;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;outline:0;background-color:#3097d1}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.6;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar:after,.btn-toolbar:before{content:" ";display:table}.btn-toolbar:after{clear:both}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group-lg.btn-group>.btn+.dropdown-toggle,.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-group-lg>.btn .caret,.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-group-lg>.btn .caret,.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before{content:" ";display:table}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio],[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccd0d2;border-radius:4px}.input-group-addon.input-sm,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.input-group-addon.btn{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.input-group-addon.btn{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group .form-control:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group .form-control:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{font-size:0;white-space:nowrap}.input-group-btn,.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav:after,.nav:before{content:" ";display:table}.nav:after{clear:both}.nav>li,.nav>li>a{position:relative;display:block}.nav>li>a{padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#3097d1}.nav .nav-divider{height:1px;margin:10px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.6;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;background-color:#f5f8fa;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#3097d1}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified,.nav-tabs.nav-justified{width:100%}.nav-justified>li,.nav-tabs.nav-justified>li{float:none}.nav-justified>li>a,.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li,.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a,.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified,.nav-tabs.nav-justified{border-bottom:0}.nav-tabs-justified>li>a,.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a,.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#f5f8fa}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:22px;border:1px solid transparent}.navbar:after,.navbar:before{content:" ";display:table}.navbar:after{clear:both}@media (min-width:768px){.navbar{border-radius:4px}}.navbar-header:after,.navbar-header:before{content:" ";display:table}.navbar-header:after{clear:both}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1);box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1);-webkit-overflow-scrolling:touch}.navbar-collapse:after,.navbar-collapse:before{content:" ";display:table}.navbar-collapse:after{clear:both}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:14px 15px;font-size:18px;line-height:22px;height:50px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container-fluid .navbar-brand,.navbar>.container .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:22px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:22px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:14px;padding-bottom:14px}}.navbar-form{margin:7px -15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1),0 1px 0 hsla(0,0%,100%,.1);box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1),0 1px 0 hsla(0,0%,100%,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:7px;margin-bottom:7px}.btn-group-sm>.navbar-btn.btn,.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.btn-group-xs>.navbar-btn.btn,.navbar-btn.btn-xs,.navbar-text{margin-top:14px;margin-bottom:14px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#fff;border-color:#d3e0e9}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5d5d;background-color:transparent}.navbar-default .navbar-nav>li>a,.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#eee}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#d3e0e9}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{background-color:#eee;color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#eee}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#090909}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>li>a,.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#090909}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{background-color:#090909;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#090909}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#090909}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#090909}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:22px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\A0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:22px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.6;text-decoration:none;color:#3097d1;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#216a94;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;background-color:#3097d1;border-color:#3097d1;cursor:default}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:22px 0;list-style:none;text-align:center}.pager:after,.pager:before{content:" ";display:table}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label:empty{display:none}.btn .label{position:relative;top:-1px}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#3097d1}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#2579a9}.label-success{background-color:#2ab27b}.label-success[href]:focus,.label-success[href]:hover{background-color:#20895e}.label-info{background-color:#8eb4cb}.label-info[href]:focus,.label-info[href]:hover{background-color:#6b9dbb}.label-warning{background-color:#cbb956}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#b6a338}.label-danger{background-color:#bf5329}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#954120}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;color:#fff;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#3097d1;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;background-color:#eee}.jumbotron,.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container-fluid .jumbotron,.container .jumbotron{border-radius:6px;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container-fluid .jumbotron,.container .jumbotron{padding-left:60px;padding-right:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:22px;line-height:1.6;background-color:#f5f8fa;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{display:block;max-width:100%;height:auto;margin-left:auto;margin-right:auto}.thumbnail .caption{padding:9px;color:#636b6f}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#3097d1}.alert{padding:15px;margin-bottom:22px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:22px;margin-bottom:22px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:22px;color:#fff;text-align:center;background-color:#3097d1;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#2ab27b}.progress-striped .progress-bar-success{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress-bar-info{background-color:#8eb4cb}.progress-striped .progress-bar-info{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress-bar-warning{background-color:#cbb956}.progress-striped .progress-bar-warning{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress-bar-danger{background-color:#bf5329}.progress-striped .progress-bar-danger{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #d3e0e9}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{text-decoration:none;color:#555;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{background-color:#eee;color:#777;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#3097d1;border-color:#3097d1}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#d7ebf6}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:22px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-body:after,.panel-body:before{content:" ";display:table}.panel-body:after{clear:both}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle,.panel-title{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #d3e0e9;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.list-group+.panel-footer,.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table-responsive>.table caption,.panel>.table caption{padding-left:15px;padding-right:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:22px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #d3e0e9}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #d3e0e9}.panel-default{border-color:#d3e0e9}.panel-default>.panel-heading{color:#333;background-color:#fff;border-color:#d3e0e9}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d3e0e9}.panel-default>.panel-heading .badge{color:#fff;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d3e0e9}.panel-primary{border-color:#3097d1}.panel-primary>.panel-heading{color:#fff;background-color:#3097d1;border-color:#3097d1}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#3097d1}.panel-primary>.panel-heading .badge{color:#3097d1;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#3097d1}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal,.modal-open{overflow:hidden}.modal{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translateY(-25%);transform:translateY(-25%);-webkit-transition:-webkit-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0);transform:translate(0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header:after,.modal-header:before{content:" ";display:table}.modal-header:after{clear:both}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.6}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer:after,.modal-footer:before{content:" ";display:table}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:Raleway,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;line-height:1.6;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:12px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px}.tooltip.top-left .tooltip-arrow,.tooltip.top-right .tooltip-arrow{bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{left:5px}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:Raleway,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;line-height:1.6;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:14px;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel,.carousel-inner{position:relative}.carousel-inner{overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:left .6s ease-in-out;transition:left .6s ease-in-out}.carousel-inner>.item>a>img,.carousel-inner>.item>img{display:block;max-width:100%;height:auto;line-height:1}@media (-webkit-transform-3d),(transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);left:0}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);left:0}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{-webkit-transform:translateZ(0);transform:translateZ(0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:transparent}.carousel-control.left{background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(90deg,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001));background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#80000000",endColorstr="#00000000",GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(90deg,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5));background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00000000",endColorstr="#80000000",GradientType=1)}.carousel-control:focus,.carousel-control:hover{outline:0;color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:"\2039"}.carousel-control .icon-next:before{content:"\203A"}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer;background-color:#000\9;background-color:transparent}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:after,.clearfix:before{content:" ";display:table}.clearfix:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} +/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{background:transparent!important;color:#000!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:Glyphicons Halflings;src:url(/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.eot?f4769f9bdb7466be65088239c12046d1);src:url(/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.eot?f4769f9bdb7466be65088239c12046d1?#iefix) format("embedded-opentype"),url(/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affeb) format("woff2"),url(/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff?fa2772327f55d8198301fdb8bcfc8158) format("woff"),url(/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.ttf?e18bbf611f2a2e43afc071aa2f4e1512) format("truetype"),url(/fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.svg?89889688147bd7575d6327160d64e760#glyphicons_halflingsregular) format("svg")}.glyphicon{position:relative;top:1px;display:inline-block;font-family:Glyphicons Halflings;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"*"}.glyphicon-plus:before{content:"+"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20AC"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270F"}.glyphicon-glass:before{content:"\E001"}.glyphicon-music:before{content:"\E002"}.glyphicon-search:before{content:"\E003"}.glyphicon-heart:before{content:"\E005"}.glyphicon-star:before{content:"\E006"}.glyphicon-star-empty:before{content:"\E007"}.glyphicon-user:before{content:"\E008"}.glyphicon-film:before{content:"\E009"}.glyphicon-th-large:before{content:"\E010"}.glyphicon-th:before{content:"\E011"}.glyphicon-th-list:before{content:"\E012"}.glyphicon-ok:before{content:"\E013"}.glyphicon-remove:before{content:"\E014"}.glyphicon-zoom-in:before{content:"\E015"}.glyphicon-zoom-out:before{content:"\E016"}.glyphicon-off:before{content:"\E017"}.glyphicon-signal:before{content:"\E018"}.glyphicon-cog:before{content:"\E019"}.glyphicon-trash:before{content:"\E020"}.glyphicon-home:before{content:"\E021"}.glyphicon-file:before{content:"\E022"}.glyphicon-time:before{content:"\E023"}.glyphicon-road:before{content:"\E024"}.glyphicon-download-alt:before{content:"\E025"}.glyphicon-download:before{content:"\E026"}.glyphicon-upload:before{content:"\E027"}.glyphicon-inbox:before{content:"\E028"}.glyphicon-play-circle:before{content:"\E029"}.glyphicon-repeat:before{content:"\E030"}.glyphicon-refresh:before{content:"\E031"}.glyphicon-list-alt:before{content:"\E032"}.glyphicon-lock:before{content:"\E033"}.glyphicon-flag:before{content:"\E034"}.glyphicon-headphones:before{content:"\E035"}.glyphicon-volume-off:before{content:"\E036"}.glyphicon-volume-down:before{content:"\E037"}.glyphicon-volume-up:before{content:"\E038"}.glyphicon-qrcode:before{content:"\E039"}.glyphicon-barcode:before{content:"\E040"}.glyphicon-tag:before{content:"\E041"}.glyphicon-tags:before{content:"\E042"}.glyphicon-book:before{content:"\E043"}.glyphicon-bookmark:before{content:"\E044"}.glyphicon-print:before{content:"\E045"}.glyphicon-camera:before{content:"\E046"}.glyphicon-font:before{content:"\E047"}.glyphicon-bold:before{content:"\E048"}.glyphicon-italic:before{content:"\E049"}.glyphicon-text-height:before{content:"\E050"}.glyphicon-text-width:before{content:"\E051"}.glyphicon-align-left:before{content:"\E052"}.glyphicon-align-center:before{content:"\E053"}.glyphicon-align-right:before{content:"\E054"}.glyphicon-align-justify:before{content:"\E055"}.glyphicon-list:before{content:"\E056"}.glyphicon-indent-left:before{content:"\E057"}.glyphicon-indent-right:before{content:"\E058"}.glyphicon-facetime-video:before{content:"\E059"}.glyphicon-picture:before{content:"\E060"}.glyphicon-map-marker:before{content:"\E062"}.glyphicon-adjust:before{content:"\E063"}.glyphicon-tint:before{content:"\E064"}.glyphicon-edit:before{content:"\E065"}.glyphicon-share:before{content:"\E066"}.glyphicon-check:before{content:"\E067"}.glyphicon-move:before{content:"\E068"}.glyphicon-step-backward:before{content:"\E069"}.glyphicon-fast-backward:before{content:"\E070"}.glyphicon-backward:before{content:"\E071"}.glyphicon-play:before{content:"\E072"}.glyphicon-pause:before{content:"\E073"}.glyphicon-stop:before{content:"\E074"}.glyphicon-forward:before{content:"\E075"}.glyphicon-fast-forward:before{content:"\E076"}.glyphicon-step-forward:before{content:"\E077"}.glyphicon-eject:before{content:"\E078"}.glyphicon-chevron-left:before{content:"\E079"}.glyphicon-chevron-right:before{content:"\E080"}.glyphicon-plus-sign:before{content:"\E081"}.glyphicon-minus-sign:before{content:"\E082"}.glyphicon-remove-sign:before{content:"\E083"}.glyphicon-ok-sign:before{content:"\E084"}.glyphicon-question-sign:before{content:"\E085"}.glyphicon-info-sign:before{content:"\E086"}.glyphicon-screenshot:before{content:"\E087"}.glyphicon-remove-circle:before{content:"\E088"}.glyphicon-ok-circle:before{content:"\E089"}.glyphicon-ban-circle:before{content:"\E090"}.glyphicon-arrow-left:before{content:"\E091"}.glyphicon-arrow-right:before{content:"\E092"}.glyphicon-arrow-up:before{content:"\E093"}.glyphicon-arrow-down:before{content:"\E094"}.glyphicon-share-alt:before{content:"\E095"}.glyphicon-resize-full:before{content:"\E096"}.glyphicon-resize-small:before{content:"\E097"}.glyphicon-exclamation-sign:before{content:"\E101"}.glyphicon-gift:before{content:"\E102"}.glyphicon-leaf:before{content:"\E103"}.glyphicon-fire:before{content:"\E104"}.glyphicon-eye-open:before{content:"\E105"}.glyphicon-eye-close:before{content:"\E106"}.glyphicon-warning-sign:before{content:"\E107"}.glyphicon-plane:before{content:"\E108"}.glyphicon-calendar:before{content:"\E109"}.glyphicon-random:before{content:"\E110"}.glyphicon-comment:before{content:"\E111"}.glyphicon-magnet:before{content:"\E112"}.glyphicon-chevron-up:before{content:"\E113"}.glyphicon-chevron-down:before{content:"\E114"}.glyphicon-retweet:before{content:"\E115"}.glyphicon-shopping-cart:before{content:"\E116"}.glyphicon-folder-close:before{content:"\E117"}.glyphicon-folder-open:before{content:"\E118"}.glyphicon-resize-vertical:before{content:"\E119"}.glyphicon-resize-horizontal:before{content:"\E120"}.glyphicon-hdd:before{content:"\E121"}.glyphicon-bullhorn:before{content:"\E122"}.glyphicon-bell:before{content:"\E123"}.glyphicon-certificate:before{content:"\E124"}.glyphicon-thumbs-up:before{content:"\E125"}.glyphicon-thumbs-down:before{content:"\E126"}.glyphicon-hand-right:before{content:"\E127"}.glyphicon-hand-left:before{content:"\E128"}.glyphicon-hand-up:before{content:"\E129"}.glyphicon-hand-down:before{content:"\E130"}.glyphicon-circle-arrow-right:before{content:"\E131"}.glyphicon-circle-arrow-left:before{content:"\E132"}.glyphicon-circle-arrow-up:before{content:"\E133"}.glyphicon-circle-arrow-down:before{content:"\E134"}.glyphicon-globe:before{content:"\E135"}.glyphicon-wrench:before{content:"\E136"}.glyphicon-tasks:before{content:"\E137"}.glyphicon-filter:before{content:"\E138"}.glyphicon-briefcase:before{content:"\E139"}.glyphicon-fullscreen:before{content:"\E140"}.glyphicon-dashboard:before{content:"\E141"}.glyphicon-paperclip:before{content:"\E142"}.glyphicon-heart-empty:before{content:"\E143"}.glyphicon-link:before{content:"\E144"}.glyphicon-phone:before{content:"\E145"}.glyphicon-pushpin:before{content:"\E146"}.glyphicon-usd:before{content:"\E148"}.glyphicon-gbp:before{content:"\E149"}.glyphicon-sort:before{content:"\E150"}.glyphicon-sort-by-alphabet:before{content:"\E151"}.glyphicon-sort-by-alphabet-alt:before{content:"\E152"}.glyphicon-sort-by-order:before{content:"\E153"}.glyphicon-sort-by-order-alt:before{content:"\E154"}.glyphicon-sort-by-attributes:before{content:"\E155"}.glyphicon-sort-by-attributes-alt:before{content:"\E156"}.glyphicon-unchecked:before{content:"\E157"}.glyphicon-expand:before{content:"\E158"}.glyphicon-collapse-down:before{content:"\E159"}.glyphicon-collapse-up:before{content:"\E160"}.glyphicon-log-in:before{content:"\E161"}.glyphicon-flash:before{content:"\E162"}.glyphicon-log-out:before{content:"\E163"}.glyphicon-new-window:before{content:"\E164"}.glyphicon-record:before{content:"\E165"}.glyphicon-save:before{content:"\E166"}.glyphicon-open:before{content:"\E167"}.glyphicon-saved:before{content:"\E168"}.glyphicon-import:before{content:"\E169"}.glyphicon-export:before{content:"\E170"}.glyphicon-send:before{content:"\E171"}.glyphicon-floppy-disk:before{content:"\E172"}.glyphicon-floppy-saved:before{content:"\E173"}.glyphicon-floppy-remove:before{content:"\E174"}.glyphicon-floppy-save:before{content:"\E175"}.glyphicon-floppy-open:before{content:"\E176"}.glyphicon-credit-card:before{content:"\E177"}.glyphicon-transfer:before{content:"\E178"}.glyphicon-cutlery:before{content:"\E179"}.glyphicon-header:before{content:"\E180"}.glyphicon-compressed:before{content:"\E181"}.glyphicon-earphone:before{content:"\E182"}.glyphicon-phone-alt:before{content:"\E183"}.glyphicon-tower:before{content:"\E184"}.glyphicon-stats:before{content:"\E185"}.glyphicon-sd-video:before{content:"\E186"}.glyphicon-hd-video:before{content:"\E187"}.glyphicon-subtitles:before{content:"\E188"}.glyphicon-sound-stereo:before{content:"\E189"}.glyphicon-sound-dolby:before{content:"\E190"}.glyphicon-sound-5-1:before{content:"\E191"}.glyphicon-sound-6-1:before{content:"\E192"}.glyphicon-sound-7-1:before{content:"\E193"}.glyphicon-copyright-mark:before{content:"\E194"}.glyphicon-registration-mark:before{content:"\E195"}.glyphicon-cloud-download:before{content:"\E197"}.glyphicon-cloud-upload:before{content:"\E198"}.glyphicon-tree-conifer:before{content:"\E199"}.glyphicon-tree-deciduous:before{content:"\E200"}.glyphicon-cd:before{content:"\E201"}.glyphicon-save-file:before{content:"\E202"}.glyphicon-open-file:before{content:"\E203"}.glyphicon-level-up:before{content:"\E204"}.glyphicon-copy:before{content:"\E205"}.glyphicon-paste:before{content:"\E206"}.glyphicon-alert:before{content:"\E209"}.glyphicon-equalizer:before{content:"\E210"}.glyphicon-king:before{content:"\E211"}.glyphicon-queen:before{content:"\E212"}.glyphicon-pawn:before{content:"\E213"}.glyphicon-bishop:before{content:"\E214"}.glyphicon-knight:before{content:"\E215"}.glyphicon-baby-formula:before{content:"\E216"}.glyphicon-tent:before{content:"\26FA"}.glyphicon-blackboard:before{content:"\E218"}.glyphicon-bed:before{content:"\E219"}.glyphicon-apple:before{content:"\F8FF"}.glyphicon-erase:before{content:"\E221"}.glyphicon-hourglass:before{content:"\231B"}.glyphicon-lamp:before{content:"\E223"}.glyphicon-duplicate:before{content:"\E224"}.glyphicon-piggy-bank:before{content:"\E225"}.glyphicon-scissors:before{content:"\E226"}.glyphicon-bitcoin:before,.glyphicon-btc:before,.glyphicon-xbt:before{content:"\E227"}.glyphicon-jpy:before,.glyphicon-yen:before{content:"\A5"}.glyphicon-rub:before,.glyphicon-ruble:before{content:"\20BD"}.glyphicon-scale:before{content:"\E230"}.glyphicon-ice-lolly:before{content:"\E231"}.glyphicon-ice-lolly-tasted:before{content:"\E232"}.glyphicon-education:before{content:"\E233"}.glyphicon-option-horizontal:before{content:"\E234"}.glyphicon-option-vertical:before{content:"\E235"}.glyphicon-menu-hamburger:before{content:"\E236"}.glyphicon-modal-window:before{content:"\E237"}.glyphicon-oil:before{content:"\E238"}.glyphicon-grain:before{content:"\E239"}.glyphicon-sunglasses:before{content:"\E240"}.glyphicon-text-size:before{content:"\E241"}.glyphicon-text-color:before{content:"\E242"}.glyphicon-text-background:before{content:"\E243"}.glyphicon-object-align-top:before{content:"\E244"}.glyphicon-object-align-bottom:before{content:"\E245"}.glyphicon-object-align-horizontal:before{content:"\E246"}.glyphicon-object-align-left:before{content:"\E247"}.glyphicon-object-align-vertical:before{content:"\E248"}.glyphicon-object-align-right:before{content:"\E249"}.glyphicon-triangle-right:before{content:"\E250"}.glyphicon-triangle-left:before{content:"\E251"}.glyphicon-triangle-bottom:before{content:"\E252"}.glyphicon-triangle-top:before{content:"\E253"}.glyphicon-console:before{content:"\E254"}.glyphicon-superscript:before{content:"\E255"}.glyphicon-subscript:before{content:"\E256"}.glyphicon-menu-left:before{content:"\E257"}.glyphicon-menu-right:before{content:"\E258"}.glyphicon-menu-down:before{content:"\E259"}.glyphicon-menu-up:before{content:"\E260"}*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:transparent}body{font-family:Raleway,sans-serif;font-size:14px;line-height:1.6;color:#636b6f;background-color:#f5f8fa}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#3097d1;text-decoration:none}a:focus,a:hover{color:#216a94;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.6;background-color:#f5f8fa;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:22px;margin-bottom:22px;border:0;border-top:1px solid #eee}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:22px;margin-bottom:11px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:11px;margin-bottom:11px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 11px}.lead{margin-bottom:22px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{background-color:#fcf8e3;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.initialism,.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#3097d1}a.text-primary:focus,a.text-primary:hover{color:#2579a9}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#3097d1}a.bg-primary:focus,a.bg-primary:hover{background-color:#2579a9}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:10px;margin:44px 0 22px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:11px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-inline,.list-unstyled{padding-left:0;list-style:none}.list-inline{margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:22px}dd,dt{line-height:1.6}dt{font-weight:700}dd{margin-left:0}.dl-horizontal dd:after,.dl-horizontal dd:before{content:" ";display:table}.dl-horizontal dd:after{clear:both}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%}blockquote{padding:11px 22px;margin:0 0 22px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.6;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:"\2014 \A0"}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:""}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:"\A0 \2014"}address{margin-bottom:22px;font-style:normal;line-height:1.6}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,Courier New,monospace}code{color:#c7254e;background-color:#f9f2f4;border-radius:4px}code,kbd{padding:2px 4px;font-size:90%}kbd{color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:10.5px;margin:0 0 11px;font-size:13px;line-height:1.6;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.container:after,.container:before{content:" ";display:table}.container:after{clear:both}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.container-fluid:after,.container-fluid:before{content:" ";display:table}.container-fluid:after{clear:both}.row{margin-left:-15px;margin-right:-15px}.row:after,.row:before{content:" ";display:table}.row:after{clear:both}.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-1{width:8.33333333%}.col-xs-2{width:16.66666667%}.col-xs-3{width:25%}.col-xs-4{width:33.33333333%}.col-xs-5{width:41.66666667%}.col-xs-6{width:50%}.col-xs-7{width:58.33333333%}.col-xs-8{width:66.66666667%}.col-xs-9{width:75%}.col-xs-10{width:83.33333333%}.col-xs-11{width:91.66666667%}.col-xs-12{width:100%}.col-xs-pull-0{right:auto}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-3{right:25%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-6{right:50%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-9{right:75%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-12{right:100%}.col-xs-push-0{left:auto}.col-xs-push-1{left:8.33333333%}.col-xs-push-2{left:16.66666667%}.col-xs-push-3{left:25%}.col-xs-push-4{left:33.33333333%}.col-xs-push-5{left:41.66666667%}.col-xs-push-6{left:50%}.col-xs-push-7{left:58.33333333%}.col-xs-push-8{left:66.66666667%}.col-xs-push-9{left:75%}.col-xs-push-10{left:83.33333333%}.col-xs-push-11{left:91.66666667%}.col-xs-push-12{left:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-12{margin-left:100%}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-1{width:8.33333333%}.col-sm-2{width:16.66666667%}.col-sm-3{width:25%}.col-sm-4{width:33.33333333%}.col-sm-5{width:41.66666667%}.col-sm-6{width:50%}.col-sm-7{width:58.33333333%}.col-sm-8{width:66.66666667%}.col-sm-9{width:75%}.col-sm-10{width:83.33333333%}.col-sm-11{width:91.66666667%}.col-sm-12{width:100%}.col-sm-pull-0{right:auto}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-3{right:25%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-6{right:50%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-9{right:75%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-12{right:100%}.col-sm-push-0{left:auto}.col-sm-push-1{left:8.33333333%}.col-sm-push-2{left:16.66666667%}.col-sm-push-3{left:25%}.col-sm-push-4{left:33.33333333%}.col-sm-push-5{left:41.66666667%}.col-sm-push-6{left:50%}.col-sm-push-7{left:58.33333333%}.col-sm-push-8{left:66.66666667%}.col-sm-push-9{left:75%}.col-sm-push-10{left:83.33333333%}.col-sm-push-11{left:91.66666667%}.col-sm-push-12{left:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-12{margin-left:100%}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-1{width:8.33333333%}.col-md-2{width:16.66666667%}.col-md-3{width:25%}.col-md-4{width:33.33333333%}.col-md-5{width:41.66666667%}.col-md-6{width:50%}.col-md-7{width:58.33333333%}.col-md-8{width:66.66666667%}.col-md-9{width:75%}.col-md-10{width:83.33333333%}.col-md-11{width:91.66666667%}.col-md-12{width:100%}.col-md-pull-0{right:auto}.col-md-pull-1{right:8.33333333%}.col-md-pull-2{right:16.66666667%}.col-md-pull-3{right:25%}.col-md-pull-4{right:33.33333333%}.col-md-pull-5{right:41.66666667%}.col-md-pull-6{right:50%}.col-md-pull-7{right:58.33333333%}.col-md-pull-8{right:66.66666667%}.col-md-pull-9{right:75%}.col-md-pull-10{right:83.33333333%}.col-md-pull-11{right:91.66666667%}.col-md-pull-12{right:100%}.col-md-push-0{left:auto}.col-md-push-1{left:8.33333333%}.col-md-push-2{left:16.66666667%}.col-md-push-3{left:25%}.col-md-push-4{left:33.33333333%}.col-md-push-5{left:41.66666667%}.col-md-push-6{left:50%}.col-md-push-7{left:58.33333333%}.col-md-push-8{left:66.66666667%}.col-md-push-9{left:75%}.col-md-push-10{left:83.33333333%}.col-md-push-11{left:91.66666667%}.col-md-push-12{left:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-12{margin-left:100%}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-1{width:8.33333333%}.col-lg-2{width:16.66666667%}.col-lg-3{width:25%}.col-lg-4{width:33.33333333%}.col-lg-5{width:41.66666667%}.col-lg-6{width:50%}.col-lg-7{width:58.33333333%}.col-lg-8{width:66.66666667%}.col-lg-9{width:75%}.col-lg-10{width:83.33333333%}.col-lg-11{width:91.66666667%}.col-lg-12{width:100%}.col-lg-pull-0{right:auto}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-3{right:25%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-6{right:50%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-9{right:75%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-12{right:100%}.col-lg-push-0{left:auto}.col-lg-push-1{left:8.33333333%}.col-lg-push-2{left:16.66666667%}.col-lg-push-3{left:25%}.col-lg-push-4{left:33.33333333%}.col-lg-push-5{left:41.66666667%}.col-lg-push-6{left:50%}.col-lg-push-7{left:58.33333333%}.col-lg-push-8{left:66.66666667%}.col-lg-push-9{left:75%}.col-lg-push-10{left:83.33333333%}.col-lg-push-11{left:91.66666667%}.col-lg-push-12{left:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-12{margin-left:100%}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777}caption,th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:22px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.6;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#f5f8fa}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered,.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;float:none;display:table-column}table td[class*=col-],table th[class*=col-]{position:static;float:none;display:table-cell}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{overflow-x:auto;min-height:.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:16.5px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{margin:0;min-width:0}fieldset,legend{padding:0;border:0}legend{display:block;width:100%;margin-bottom:22px;font-size:21px;line-height:inherit;color:#333;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{padding-top:7px}.form-control,output{display:block;font-size:14px;line-height:1.6;color:#555}.form-control{width:100%;height:36px;padding:6px 12px;background-color:#fff;background-image:none;border:1px solid #ccd0d2;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,-webkit-box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-box-shadow .15s ease-in-out}.form-control:focus{border-color:#98cbe8;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(152,203,232,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(152,203,232,.6)}.form-control::-moz-placeholder{color:#b1b7ba;opacity:1}.form-control:-ms-input-placeholder{color:#b1b7ba}.form-control::-webkit-input-placeholder{color:#b1b7ba}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{line-height:36px}.input-group-sm>.input-group-btn>input[type=date].btn,.input-group-sm>.input-group-btn>input[type=datetime-local].btn,.input-group-sm>.input-group-btn>input[type=month].btn,.input-group-sm>.input-group-btn>input[type=time].btn,.input-group-sm>input[type=date].form-control,.input-group-sm>input[type=date].input-group-addon,.input-group-sm>input[type=datetime-local].form-control,.input-group-sm>input[type=datetime-local].input-group-addon,.input-group-sm>input[type=month].form-control,.input-group-sm>input[type=month].input-group-addon,.input-group-sm>input[type=time].form-control,.input-group-sm>input[type=time].input-group-addon,.input-group-sm input[type=date],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],.input-group-sm input[type=time],input[type=date].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm,input[type=time].input-sm{line-height:30px}.input-group-lg>.input-group-btn>input[type=date].btn,.input-group-lg>.input-group-btn>input[type=datetime-local].btn,.input-group-lg>.input-group-btn>input[type=month].btn,.input-group-lg>.input-group-btn>input[type=time].btn,.input-group-lg>input[type=date].form-control,.input-group-lg>input[type=date].input-group-addon,.input-group-lg>input[type=datetime-local].form-control,.input-group-lg>input[type=datetime-local].input-group-addon,.input-group-lg>input[type=month].form-control,.input-group-lg>input[type=month].input-group-addon,.input-group-lg>input[type=time].form-control,.input-group-lg>input[type=time].input-group-addon,.input-group-lg input[type=date],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],.input-group-lg input[type=time],input[type=date].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg,input[type=time].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:22px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox-inline input[type=checkbox],.checkbox input[type=checkbox],.radio-inline input[type=radio],.radio input[type=radio]{position:absolute;margin-left:-20px;margin-top:4px\9}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:400;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}.checkbox-inline.disabled,.checkbox.disabled label,.radio-inline.disabled,.radio.disabled label,fieldset[disabled] .checkbox-inline,fieldset[disabled] .checkbox label,fieldset[disabled] .radio-inline,fieldset[disabled] .radio label,fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0;min-height:36px}.form-control-static.input-lg,.form-control-static.input-sm,.input-group-lg>.form-control-static.form-control,.input-group-lg>.form-control-static.input-group-addon,.input-group-lg>.input-group-btn>.form-control-static.btn,.input-group-sm>.form-control-static.form-control,.input-group-sm>.form-control-static.input-group-addon,.input-group-sm>.input-group-btn>.form-control-static.btn{padding-left:0;padding-right:0}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn,.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.input-group-sm>.input-group-btn>select.btn,.input-group-sm>select.form-control,.input-group-sm>select.input-group-addon,select.input-sm{height:30px;line-height:30px}.input-group-sm>.input-group-btn>select[multiple].btn,.input-group-sm>.input-group-btn>textarea.btn,.input-group-sm>select[multiple].form-control,.input-group-sm>select[multiple].input-group-addon,.input-group-sm>textarea.form-control,.input-group-sm>textarea.input-group-addon,select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:34px;padding:6px 10px;font-size:12px;line-height:1.5}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn,.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.input-group-lg>.input-group-btn>select.btn,.input-group-lg>select.form-control,.input-group-lg>select.input-group-addon,select.input-lg{height:46px;line-height:46px}.input-group-lg>.input-group-btn>select[multiple].btn,.input-group-lg>.input-group-btn>textarea.btn,.input-group-lg>select[multiple].form-control,.input-group-lg>select[multiple].input-group-addon,.input-group-lg>textarea.form-control,.input-group-lg>textarea.input-group-addon,select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:40px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:45px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:36px;height:36px;line-height:36px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-group-lg>.form-control+.form-control-feedback,.input-group-lg>.input-group-addon+.form-control-feedback,.input-group-lg>.input-group-btn>.btn+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-group-sm>.form-control+.form-control-feedback,.input-group-sm>.input-group-addon+.form-control-feedback,.input-group-sm>.input-group-btn>.btn+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success.checkbox-inline label,.has-success.checkbox label,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.radio-inline label,.has-success.radio label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning.checkbox-inline label,.has-warning.checkbox label,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.radio-inline label,.has-warning.radio label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error.checkbox-inline label,.has-error.checkbox label,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.radio-inline label,.has-error.radio label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:27px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#a4aaae}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .checkbox,.form-horizontal .radio{min-height:29px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .form-group:after,.form-horizontal .form-group:before{content:" ";display:table}.form-horizontal .form-group:after{clear:both}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:7px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.6;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#636b6f;text-decoration:none}.btn.active,.btn:active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#636b6f;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#636b6f;background-color:#e6e5e5;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.btn-default:hover,.open>.btn-default.dropdown-toggle{color:#636b6f;background-color:#e6e5e5;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.btn-default.dropdown-toggle.focus,.open>.btn-default.dropdown-toggle:focus,.open>.btn-default.dropdown-toggle:hover{color:#636b6f;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.btn-default.dropdown-toggle{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#636b6f}.btn-primary{color:#fff;background-color:#3097d1;border-color:#2a88bd}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#2579a9;border-color:#133d55}.btn-primary.active,.btn-primary:active,.btn-primary:hover,.open>.btn-primary.dropdown-toggle{color:#fff;background-color:#2579a9;border-color:#1f648b}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.btn-primary.dropdown-toggle.focus,.open>.btn-primary.dropdown-toggle:focus,.open>.btn-primary.dropdown-toggle:hover{color:#fff;background-color:#1f648b;border-color:#133d55}.btn-primary.active,.btn-primary:active,.open>.btn-primary.dropdown-toggle{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#3097d1;border-color:#2a88bd}.btn-primary .badge{color:#3097d1;background-color:#fff}.btn-success{color:#fff;background-color:#2ab27b;border-color:#259d6d}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#20895e;border-color:#0d3625}.btn-success.active,.btn-success:active,.btn-success:hover,.open>.btn-success.dropdown-toggle{color:#fff;background-color:#20895e;border-color:#196c4b}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.btn-success.dropdown-toggle.focus,.open>.btn-success.dropdown-toggle:focus,.open>.btn-success.dropdown-toggle:hover{color:#fff;background-color:#196c4b;border-color:#0d3625}.btn-success.active,.btn-success:active,.open>.btn-success.dropdown-toggle{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#2ab27b;border-color:#259d6d}.btn-success .badge{color:#2ab27b;background-color:#fff}.btn-info{color:#fff;background-color:#8eb4cb;border-color:#7da8c3}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#6b9dbb;border-color:#3d6983}.btn-info.active,.btn-info:active,.btn-info:hover,.open>.btn-info.dropdown-toggle{color:#fff;background-color:#6b9dbb;border-color:#538db0}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.btn-info.dropdown-toggle.focus,.open>.btn-info.dropdown-toggle:focus,.open>.btn-info.dropdown-toggle:hover{color:#fff;background-color:#538db0;border-color:#3d6983}.btn-info.active,.btn-info:active,.open>.btn-info.dropdown-toggle{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#8eb4cb;border-color:#7da8c3}.btn-info .badge{color:#8eb4cb;background-color:#fff}.btn-warning{color:#fff;background-color:#cbb956;border-color:#c5b143}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#b6a338;border-color:#685d20}.btn-warning.active,.btn-warning:active,.btn-warning:hover,.open>.btn-warning.dropdown-toggle{color:#fff;background-color:#b6a338;border-color:#9b8a30}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.btn-warning.dropdown-toggle.focus,.open>.btn-warning.dropdown-toggle:focus,.open>.btn-warning.dropdown-toggle:hover{color:#fff;background-color:#9b8a30;border-color:#685d20}.btn-warning.active,.btn-warning:active,.open>.btn-warning.dropdown-toggle{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#cbb956;border-color:#c5b143}.btn-warning .badge{color:#cbb956;background-color:#fff}.btn-danger{color:#fff;background-color:#bf5329;border-color:#aa4a24}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#954120;border-color:#411c0e}.btn-danger.active,.btn-danger:active,.btn-danger:hover,.open>.btn-danger.dropdown-toggle{color:#fff;background-color:#954120;border-color:#78341a}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.btn-danger.dropdown-toggle.focus,.open>.btn-danger.dropdown-toggle:focus,.open>.btn-danger.dropdown-toggle:hover{color:#fff;background-color:#78341a;border-color:#411c0e}.btn-danger.active,.btn-danger:active,.open>.btn-danger.dropdown-toggle{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#bf5329;border-color:#aa4a24}.btn-danger .badge{color:#bf5329;background-color:#fff}.btn-link{color:#3097d1;font-weight:400;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#216a94;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height,visibility;transition-property:height,visibility;-webkit-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:10px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.6;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;outline:0;background-color:#3097d1}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.6;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar:after,.btn-toolbar:before{content:" ";display:table}.btn-toolbar:after{clear:both}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group-lg.btn-group>.btn+.dropdown-toggle,.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-group-lg>.btn .caret,.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-group-lg>.btn .caret,.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before{content:" ";display:table}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio],[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccd0d2;border-radius:4px}.input-group-addon.input-sm,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.input-group-addon.btn{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.input-group-addon.btn{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group .form-control:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group .form-control:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{font-size:0;white-space:nowrap}.input-group-btn,.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav:after,.nav:before{content:" ";display:table}.nav:after{clear:both}.nav>li,.nav>li>a{position:relative;display:block}.nav>li>a{padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#3097d1}.nav .nav-divider{height:1px;margin:10px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.6;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;background-color:#f5f8fa;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#3097d1}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified,.nav-tabs.nav-justified{width:100%}.nav-justified>li,.nav-tabs.nav-justified>li{float:none}.nav-justified>li>a,.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li,.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a,.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified,.nav-tabs.nav-justified{border-bottom:0}.nav-tabs-justified>li>a,.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a,.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#f5f8fa}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:22px;border:1px solid transparent}.navbar:after,.navbar:before{content:" ";display:table}.navbar:after{clear:both}@media (min-width:768px){.navbar{border-radius:4px}}.navbar-header:after,.navbar-header:before{content:" ";display:table}.navbar-header:after{clear:both}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1);box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1);-webkit-overflow-scrolling:touch}.navbar-collapse:after,.navbar-collapse:before{content:" ";display:table}.navbar-collapse:after{clear:both}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:14px 15px;font-size:18px;line-height:22px;height:50px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container-fluid .navbar-brand,.navbar>.container .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:22px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:22px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:14px;padding-bottom:14px}}.navbar-form{margin:7px -15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1),0 1px 0 hsla(0,0%,100%,.1);box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1),0 1px 0 hsla(0,0%,100%,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:7px;margin-bottom:7px}.btn-group-sm>.navbar-btn.btn,.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.btn-group-xs>.navbar-btn.btn,.navbar-btn.btn-xs,.navbar-text{margin-top:14px;margin-bottom:14px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#fff;border-color:#d3e0e9}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5d5d;background-color:transparent}.navbar-default .navbar-nav>li>a,.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#eee}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#d3e0e9}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{background-color:#eee;color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#eee}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#090909}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>li>a,.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#090909}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{background-color:#090909;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#090909}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#090909}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#090909}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:22px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\A0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:22px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.6;text-decoration:none;color:#3097d1;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#216a94;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;background-color:#3097d1;border-color:#3097d1;cursor:default}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:22px 0;list-style:none;text-align:center}.pager:after,.pager:before{content:" ";display:table}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label:empty{display:none}.btn .label{position:relative;top:-1px}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#3097d1}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#2579a9}.label-success{background-color:#2ab27b}.label-success[href]:focus,.label-success[href]:hover{background-color:#20895e}.label-info{background-color:#8eb4cb}.label-info[href]:focus,.label-info[href]:hover{background-color:#6b9dbb}.label-warning{background-color:#cbb956}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#b6a338}.label-danger{background-color:#bf5329}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#954120}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;color:#fff;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#3097d1;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;background-color:#eee}.jumbotron,.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container-fluid .jumbotron,.container .jumbotron{border-radius:6px;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container-fluid .jumbotron,.container .jumbotron{padding-left:60px;padding-right:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:22px;line-height:1.6;background-color:#f5f8fa;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{display:block;max-width:100%;height:auto;margin-left:auto;margin-right:auto}.thumbnail .caption{padding:9px;color:#636b6f}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#3097d1}.alert{padding:15px;margin-bottom:22px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:22px;margin-bottom:22px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:22px;color:#fff;text-align:center;background-color:#3097d1;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#2ab27b}.progress-striped .progress-bar-success{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress-bar-info{background-color:#8eb4cb}.progress-striped .progress-bar-info{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress-bar-warning{background-color:#cbb956}.progress-striped .progress-bar-warning{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress-bar-danger{background-color:#bf5329}.progress-striped .progress-bar-danger{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #d3e0e9}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{text-decoration:none;color:#555;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{background-color:#eee;color:#777;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#3097d1;border-color:#3097d1}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#d7ebf6}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:22px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-body:after,.panel-body:before{content:" ";display:table}.panel-body:after{clear:both}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle,.panel-title{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #d3e0e9;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.list-group+.panel-footer,.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table-responsive>.table caption,.panel>.table caption{padding-left:15px;padding-right:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:22px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #d3e0e9}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #d3e0e9}.panel-default{border-color:#d3e0e9}.panel-default>.panel-heading{color:#333;background-color:#fff;border-color:#d3e0e9}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d3e0e9}.panel-default>.panel-heading .badge{color:#fff;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d3e0e9}.panel-primary{border-color:#3097d1}.panel-primary>.panel-heading{color:#fff;background-color:#3097d1;border-color:#3097d1}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#3097d1}.panel-primary>.panel-heading .badge{color:#3097d1;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#3097d1}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal,.modal-open{overflow:hidden}.modal{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translateY(-25%);transform:translateY(-25%);-webkit-transition:-webkit-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0);transform:translate(0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header:after,.modal-header:before{content:" ";display:table}.modal-header:after{clear:both}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.6}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer:after,.modal-footer:before{content:" ";display:table}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:Raleway,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;line-height:1.6;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:12px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px}.tooltip.top-left .tooltip-arrow,.tooltip.top-right .tooltip-arrow{bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{left:5px}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:Raleway,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;line-height:1.6;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:14px;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel,.carousel-inner{position:relative}.carousel-inner{overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:left .6s ease-in-out;transition:left .6s ease-in-out}.carousel-inner>.item>a>img,.carousel-inner>.item>img{display:block;max-width:100%;height:auto;line-height:1}@media (-webkit-transform-3d),(transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);left:0}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);left:0}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{-webkit-transform:translateZ(0);transform:translateZ(0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:transparent}.carousel-control.left{background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(90deg,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001));background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#80000000",endColorstr="#00000000",GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(90deg,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5));background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00000000",endColorstr="#80000000",GradientType=1)}.carousel-control:focus,.carousel-control:hover{outline:0;color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:"\2039"}.carousel-control .icon-next:before{content:"\203A"}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer;background-color:#000\9;background-color:transparent}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:after,.clearfix:before{content:" ";display:table}.clearfix:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} /*! * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome diff --git a/public/index.php b/public/index.php index eedd6e418e..86d14aca18 100644 --- a/public/index.php +++ b/public/index.php @@ -54,6 +54,7 @@ require __DIR__ . '/../vendor/autoload.php'; | */ +/** @noinspection UsingInclusionOnceReturnValueInspection */ $app = require_once __DIR__ . '/../bootstrap/app.php'; /* diff --git a/public/js/app.js b/public/js/app.js index 8e29fa9b26..c7157cdf46 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1 +1 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}([function(t,e,n){"use strict";var r=n(6),i=n(21),o=Object.prototype.toString;function a(t){return"[object Array]"===o.call(t)}function s(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===o.call(t)}function c(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n