diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 996fc4c991..168e674f2b 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -14,8 +14,11 @@ namespace FireflyIII\Http\Controllers\Admin; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Repositories\User\UserRepositoryInterface; +use FireflyIII\Support\Facades\FireflyConfig; use FireflyIII\User; +use Illuminate\Http\Request; use Preferences; +use Session; /** * Class UserController @@ -24,8 +27,29 @@ use Preferences; */ class UserController extends Controller { + + /** + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View + */ + public function domains() + { + + $title = strval(trans('firefly.administration')); + $mainTitleIcon = 'fa-hand-spock-o'; + $subTitle = strval(trans('firefly.blocked_domains')); + $subTitleIcon = 'fa-users'; + $domains = FireflyConfig::get('blocked-domains', [])->data; + + // known domains + $knownDomains = $this->getKnownDomains(); + + return view('admin.users.domains', compact('title', 'mainTitleIcon', 'knownDomains', 'subTitle', 'subTitleIcon', 'domains')); + } + /** * @param UserRepositoryInterface $repository + * + * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function index(UserRepositoryInterface $repository) { @@ -61,4 +85,92 @@ class UserController extends Controller } + /** + * @param Request $request + * + * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector + */ + public function manual(Request $request) + { + if (strlen($request->get('domain')) === 0) { + Session::flash('error', trans('firefly.no_domain_filled_in')); + + return redirect(route('admin.users.domains')); + } + + $domain = $request->get('domain'); + $blocked = FireflyConfig::get('blocked-domains', [])->data; + + if (in_array($domain, $blocked)) { + Session::flash('error', trans('firefly.domain_already_blocked', ['domain' => $domain])); + + return redirect(route('admin.users.domains')); + } + $blocked[] = $domain; + FireflyConfig::set('blocked-domains', $blocked); + + Session::flash('success', trans('firefly.domain_is_now_blocked', ['domain' => $domain])); + return redirect(route('admin.users.domains')); + } + + /** + * @param string $domain + * + * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector + */ + public function toggleDomain(string $domain) + { + $blocked = FireflyConfig::get('blocked-domains', [])->data; + + if (in_array($domain, $blocked)) { + $key = array_search($domain, $blocked); + unset($blocked[$key]); + sort($blocked); + + FireflyConfig::set('blocked-domains', $blocked); + Session::flash('message', trans('firefly.domain_now_unblocked', ['domain' => $domain])); + + + return redirect(route('admin.users.domains')); + + } + + $blocked[] = $domain; + + FireflyConfig::set('blocked-domains', $blocked); + Session::flash('message', trans('firefly.domain_now_blocked', ['domain' => $domain])); + + return redirect(route('admin.users.domains')); + } + + /** + * @return array + */ + private function getKnownDomains(): array + { + $users = User::get(); + $set = []; + $filtered = []; + /** @var User $user */ + foreach ($users as $user) { + $email = $user->email; + $parts = explode('@', $email); + $domain = $parts[1]; + $set[] = $domain; + } + $set = array_unique($set); + // filter for already banned domains: + $blocked = FireflyConfig::get('blocked-domains', [])->data; + + foreach ($set as $domain) { + // in the block array? ignore it. + if (!in_array($domain, $blocked)) { + $filtered[] = $domain; + } + } + asort($filtered); + + return $filtered; + } + } diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index f1925bc906..c1dcda94cd 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -96,6 +96,23 @@ Breadcrumbs::register( } ); +/** + * ADMIN + */ +Breadcrumbs::register( + 'admin.index', function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('home'); + $breadcrumbs->push(trans('firefly.administration'), route('admin.index')); +} +); + +Breadcrumbs::register( + 'admin.users', function (BreadCrumbGenerator $breadcrumbs) { + $breadcrumbs->parent('admin.index'); + $breadcrumbs->push(trans('firefly.list_all_users'), route('admin.users')); +} +); + /** * ATTACHMENTS */ diff --git a/app/Http/routes.php b/app/Http/routes.php index b2496d42cd..4d1f4b7617 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -424,6 +424,10 @@ Route::group( // user manager Route::get('/admin/users', ['uses' => 'Admin\UserController@index', 'as' => 'admin.users']); + Route::get('/admin/users/domains', ['uses' => 'Admin\UserController@domains', 'as' => 'admin.users.domains']); + Route::get('/admin/users/domains/toggle/{domain}', ['uses' => 'Admin\UserController@toggleDomain', 'as' => 'admin.users.domains.block-toggle']); + + Route::post('/admin/users/domains/manual', ['uses' => 'Admin\UserController@manual', 'as' => 'admin.users.domains.manual']); } ); diff --git a/app/Import/Converter/AssetAccountId.php b/app/Import/Converter/AccountId.php similarity index 93% rename from app/Import/Converter/AssetAccountId.php rename to app/Import/Converter/AccountId.php index f055f819c7..5ba5e19d61 100644 --- a/app/Import/Converter/AssetAccountId.php +++ b/app/Import/Converter/AccountId.php @@ -1,6 +1,6 @@ certainty; + } + /** * @param array $config */ diff --git a/app/Import/Converter/BudgetId.php b/app/Import/Converter/BudgetId.php index 652c27dcc6..71178f3a67 100644 --- a/app/Import/Converter/BudgetId.php +++ b/app/Import/Converter/BudgetId.php @@ -12,6 +12,9 @@ declare(strict_types = 1); namespace FireflyIII\Import\Converter; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Models\Budget; +use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; +use Log; /** * Class BudgetId @@ -24,11 +27,40 @@ class BudgetId extends BasicConverter implements ConverterInterface /** * @param $value * - * @throws FireflyException + * @return Budget */ public function convert($value) { - throw new FireflyException('Importer with name BudgetId has not yet been configured.'); + $value = intval(trim($value)); + Log::debug('Going to convert using BudgetId', ['value' => $value]); + + if ($value === 0) { + return new Budget; + } + + /** @var BudgetRepositoryInterface $repository */ + $repository = app(BudgetRepositoryInterface::class, [$this->user]); + + if (isset($this->mapping[$value])) { + Log::debug('Found budget in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]); + $budget = $repository->find(intval($this->mapping[$value])); + if (!is_null($budget->id)) { + Log::debug('Found budget by ID', ['id' => $budget->id]); + + return $budget; + } + } + + // not mapped? Still try to find it first: + $budget = $repository->find($value); + if (!is_null($budget->id)) { + Log::debug('Found budget by ID ', ['id' => $budget->id]); + + return $budget; + } + + // should not really happen. If the ID does not match FF, what is FF supposed to do? + return new Budget; } } \ No newline at end of file diff --git a/app/Import/Converter/BudgetName.php b/app/Import/Converter/BudgetName.php index 6db955bc12..8aeab92dbf 100644 --- a/app/Import/Converter/BudgetName.php +++ b/app/Import/Converter/BudgetName.php @@ -12,6 +12,9 @@ declare(strict_types = 1); namespace FireflyIII\Import\Converter; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Models\Budget; +use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; +use Log; /** * Class BudgetName @@ -24,11 +27,47 @@ class BudgetName extends BasicConverter implements ConverterInterface /** * @param $value * - * @throws FireflyException + * @return Budget */ public function convert($value) { - throw new FireflyException('Importer with name BudgetName has not yet been configured.'); + $value = trim($value); + Log::debug('Going to convert using BudgetName', ['value' => $value]); + + if (strlen($value) === 0) { + return new Budget; + } + + /** @var BudgetRepositoryInterface $repository */ + $repository = app(BudgetRepositoryInterface::class, [$this->user]); + + if (isset($this->mapping[$value])) { + Log::debug('Found budget in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]); + $budget = $repository->find(intval($this->mapping[$value])); + if (!is_null($budget->id)) { + Log::debug('Found budget by ID', ['id' => $budget->id]); + + return $budget; + } + } + + // not mapped? Still try to find it first: + $budget = $repository->findByName($value); + if (!is_null($budget->id)) { + Log::debug('Found budget by name ', ['id' => $budget->id]); + + return $budget; + } + + // create new budget. Use a lot of made up values. + $budget = $repository->store( + [ + 'name' => $value, + 'user_id' => $this->user->id, + ] + ); + + return $budget; } } \ No newline at end of file diff --git a/app/Import/Converter/CategoryId.php b/app/Import/Converter/CategoryId.php index b177835914..4704a81f43 100644 --- a/app/Import/Converter/CategoryId.php +++ b/app/Import/Converter/CategoryId.php @@ -12,6 +12,9 @@ declare(strict_types = 1); namespace FireflyIII\Import\Converter; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Models\Category; +use FireflyIII\Repositories\Category\CategoryRepositoryInterface; +use Log; /** * Class CategoryId @@ -24,11 +27,40 @@ class CategoryId extends BasicConverter implements ConverterInterface /** * @param $value * - * @throws FireflyException + * @return Category */ public function convert($value) { - throw new FireflyException('Importer with name CategoryId has not yet been configured.'); + $value = intval(trim($value)); + Log::debug('Going to convert using CategoryId', ['value' => $value]); + + if ($value === 0) { + return new Category; + } + + /** @var CategoryRepositoryInterface $repository */ + $repository = app(CategoryRepositoryInterface::class, [$this->user]); + + if (isset($this->mapping[$value])) { + Log::debug('Found category in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]); + $category = $repository->find(intval($this->mapping[$value])); + if (!is_null($category->id)) { + Log::debug('Found category by ID', ['id' => $category->id]); + + return $category; + } + } + + // not mapped? Still try to find it first: + $category = $repository->find($value); + if (!is_null($category->id)) { + Log::debug('Found category by ID ', ['id' => $category->id]); + + return $category; + } + + // should not really happen. If the ID does not match FF, what is FF supposed to do? + return new Category; } } \ No newline at end of file diff --git a/app/Import/Converter/CategoryName.php b/app/Import/Converter/CategoryName.php index f87a2bd7bc..bfcefeb75b 100644 --- a/app/Import/Converter/CategoryName.php +++ b/app/Import/Converter/CategoryName.php @@ -12,6 +12,9 @@ declare(strict_types = 1); namespace FireflyIII\Import\Converter; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Models\Category; +use FireflyIII\Repositories\Category\CategoryRepositoryInterface; +use Log; /** * Class CategoryName @@ -24,11 +27,47 @@ class CategoryName extends BasicConverter implements ConverterInterface /** * @param $value * - * @throws FireflyException + * @return Category */ public function convert($value) { - throw new FireflyException('Importer with name CategoryName has not yet been configured.'); + $value = trim($value); + Log::debug('Going to convert using CategoryName', ['value' => $value]); + + if (strlen($value) === 0) { + return new Category; + } + + /** @var CategoryRepositoryInterface $repository */ + $repository = app(CategoryRepositoryInterface::class, [$this->user]); + + if (isset($this->mapping[$value])) { + Log::debug('Found category in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]); + $category = $repository->find(intval($this->mapping[$value])); + if (!is_null($category->id)) { + Log::debug('Found category by ID', ['id' => $category->id]); + + return $category; + } + } + + // not mapped? Still try to find it first: + $category = $repository->findByName($value); + if (!is_null($category->id)) { + Log::debug('Found category by name ', ['id' => $category->id]); + + return $category; + } + + // create new category. Use a lot of made up values. + $category = $repository->store( + [ + 'name' => $value, + 'user_id' => $this->user->id, + ] + ); + + return $category; } } \ No newline at end of file diff --git a/app/Import/Converter/ConverterInterface.php b/app/Import/Converter/ConverterInterface.php index 87e8fc5d62..ac127f1275 100644 --- a/app/Import/Converter/ConverterInterface.php +++ b/app/Import/Converter/ConverterInterface.php @@ -31,6 +31,11 @@ interface ConverterInterface */ public function setConfig(array $config); + /** + * @return int + */ + public function getCertainty(): int; + /** * @param bool $doMap */ diff --git a/app/Import/Converter/CurrencyId.php b/app/Import/Converter/CurrencyId.php index dbf5cac5e8..1bc4314ac5 100644 --- a/app/Import/Converter/CurrencyId.php +++ b/app/Import/Converter/CurrencyId.php @@ -12,6 +12,9 @@ declare(strict_types = 1); namespace FireflyIII\Import\Converter; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Models\TransactionCurrency; +use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; +use Log; /** * Class CurrencyId @@ -24,11 +27,40 @@ class CurrencyId extends BasicConverter implements ConverterInterface /** * @param $value * - * @throws FireflyException + * @return TransactionCurrency */ public function convert($value) { - throw new FireflyException('Importer with name CurrencyId has not yet been configured.'); + $value = intval(trim($value)); + Log::debug('Going to convert using CurrencyId', ['value' => $value]); + + if ($value === 0) { + return new TransactionCurrency; + } + + /** @var CurrencyRepositoryInterface $repository */ + $repository = app(CurrencyRepositoryInterface::class, [$this->user]); + + if (isset($this->mapping[$value])) { + Log::debug('Found currency in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]); + $currency = $repository->find(intval($this->mapping[$value])); + if (!is_null($currency->id)) { + Log::debug('Found currency by ID', ['id' => $currency->id]); + + return $currency; + } + } + + // not mapped? Still try to find it first: + $currency = $repository->find($value); + if (!is_null($currency->id)) { + Log::debug('Found currency by ID ', ['id' => $currency->id]); + + return $currency; + } + + // should not really happen. If the ID does not match FF, what is FF supposed to do? + return new TransactionCurrency; } } \ No newline at end of file diff --git a/app/Import/Converter/CurrencyName.php b/app/Import/Converter/CurrencyName.php index 70a03fbe0a..f28194d018 100644 --- a/app/Import/Converter/CurrencyName.php +++ b/app/Import/Converter/CurrencyName.php @@ -11,7 +11,9 @@ declare(strict_types = 1); namespace FireflyIII\Import\Converter; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Models\TransactionCurrency; +use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; +use Log; /** * Class CurrencyName @@ -24,11 +26,48 @@ class CurrencyName extends BasicConverter implements ConverterInterface /** * @param $value * - * @throws FireflyException + * @return TransactionCurrency */ public function convert($value) { - throw new FireflyException('Importer with name CurrencyName has not yet been configured.'); + $value = trim($value); + Log::debug('Going to convert using CurrencyName', ['value' => $value]); + + if ($value === 0) { + return new TransactionCurrency; + } + + /** @var CurrencyRepositoryInterface $repository */ + $repository = app(CurrencyRepositoryInterface::class, [$this->user]); + + if (isset($this->mapping[$value])) { + Log::debug('Found currency in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]); + $currency = $repository->find(intval($this->mapping[$value])); + if (!is_null($currency->id)) { + Log::debug('Found currency by ID', ['id' => $currency->id]); + + return $currency; + } + } + + // not mapped? Still try to find it first: + $currency = $repository->findByName($value); + if (!is_null($currency->id)) { + Log::debug('Found currency by name ', ['id' => $currency->id]); + + return $currency; + } + + // create new currency + $currency = $repository->store( + [ + 'name' => $value, + 'code' => strtoupper(substr($value, 0, 3)), + 'symbol' => strtoupper(substr($value, 0, 1)), + ] + ); + + return $currency; } } \ No newline at end of file diff --git a/app/Import/Converter/CurrencySymbol.php b/app/Import/Converter/CurrencySymbol.php index f468ecc6e8..2f829d26d0 100644 --- a/app/Import/Converter/CurrencySymbol.php +++ b/app/Import/Converter/CurrencySymbol.php @@ -11,7 +11,9 @@ declare(strict_types = 1); namespace FireflyIII\Import\Converter; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Models\TransactionCurrency; +use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; +use Log; /** * Class CurrencySymbol @@ -24,11 +26,48 @@ class CurrencySymbol extends BasicConverter implements ConverterInterface /** * @param $value * - * @throws FireflyException + * @return TransactionCurrency */ public function convert($value) { - throw new FireflyException('Importer with name CurrencySymbol has not yet been configured.'); + $value = trim($value); + Log::debug('Going to convert using CurrencySymbol', ['value' => $value]); + + if ($value === 0) { + return new TransactionCurrency; + } + + /** @var CurrencyRepositoryInterface $repository */ + $repository = app(CurrencyRepositoryInterface::class, [$this->user]); + + if (isset($this->mapping[$value])) { + Log::debug('Found currency in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]); + $currency = $repository->find(intval($this->mapping[$value])); + if (!is_null($currency->id)) { + Log::debug('Found currency by ID', ['id' => $currency->id]); + + return $currency; + } + } + + // not mapped? Still try to find it first: + $currency = $repository->findBySymbol($value); + if (!is_null($currency->id)) { + Log::debug('Found currency by symbol ', ['id' => $currency->id]); + + return $currency; + } + + // create new currency + $currency = $repository->store( + [ + 'name' => 'Currency ' . $value, + 'code' => $value, + 'symbol' => $value, + ] + ); + + return $currency; } } \ No newline at end of file diff --git a/app/Import/Converter/INGDebetCredit.php b/app/Import/Converter/INGDebetCredit.php index 658127fd2f..cede9dba3a 100644 --- a/app/Import/Converter/INGDebetCredit.php +++ b/app/Import/Converter/INGDebetCredit.php @@ -12,6 +12,7 @@ declare(strict_types = 1); namespace FireflyIII\Import\Converter; use FireflyIII\Exceptions\FireflyException; +use Log; /** * Class INGDebetCredit @@ -24,11 +25,19 @@ class INGDebetCredit extends BasicConverter implements ConverterInterface /** * @param $value * - * @throws FireflyException + * @return int */ public function convert($value) { - throw new FireflyException('Importer with name INGDebetCredit has not yet been configured.'); + Log::debug('Going to convert ', ['value' => $value]); + + if ($value === 'Af') { + Log::debug('Return -1'); + return -1; + } + + Log::debug('Return 1'); + return 1; } } \ No newline at end of file diff --git a/app/Import/Converter/OpposingAccountId.php b/app/Import/Converter/OpposingAccountId.php deleted file mode 100644 index c71af34127..0000000000 --- a/app/Import/Converter/OpposingAccountId.php +++ /dev/null @@ -1,34 +0,0 @@ - $value]); + + if (strlen($value) === 0) { + return new Account; + } + + /** @var AccountCrudInterface $repository */ + $repository = app(AccountCrudInterface::class, [$this->user]); + + + if (isset($this->mapping[$value])) { + Log::debug('Found account in mapping. Should exist.', ['value' => $value, 'map' => $this->mapping[$value]]); + $account = $repository->find(intval($this->mapping[$value])); + if (!is_null($account->id)) { + Log::debug('Found account by ID', ['id' => $account->id]); + + return $account; + } + } + + // not mapped? Still try to find it first: + $account = $repository->findByAccountNumber($value, []); + if (!is_null($account->id)) { + Log::debug('Found account by name', ['id' => $account->id]); + + return $account; + } + + + $account = $repository->store( + ['name' => 'Account with number ' . $value, 'openingBalance' => 0, 'iban' => null, 'user' => $this->user->id, 'accountType' => 'asset', + 'virtualBalance' => 0, 'active' => true] + ); + + return $account; } } \ No newline at end of file diff --git a/app/Import/Converter/RabobankDebetCredit.php b/app/Import/Converter/RabobankDebetCredit.php index ca450b5b76..01feb80c59 100644 --- a/app/Import/Converter/RabobankDebetCredit.php +++ b/app/Import/Converter/RabobankDebetCredit.php @@ -31,9 +31,13 @@ class RabobankDebetCredit extends BasicConverter implements ConverterInterface Log::debug('Going to convert ', ['value' => $value]); if ($value === 'D') { + Log::debug('Return -1'); + return -1; } + Log::debug('Return 1'); + return 1; } } \ No newline at end of file diff --git a/app/Import/Converter/TagsComma.php b/app/Import/Converter/TagsComma.php index 78064397a4..7b02e7972b 100644 --- a/app/Import/Converter/TagsComma.php +++ b/app/Import/Converter/TagsComma.php @@ -11,7 +11,9 @@ declare(strict_types = 1); namespace FireflyIII\Import\Converter; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Repositories\Tag\TagRepositoryInterface; +use Illuminate\Support\Collection; +use Log; /** * Class TagsComma @@ -24,11 +26,59 @@ class TagsComma extends BasicConverter implements ConverterInterface /** * @param $value * - * @throws FireflyException + * @return Collection */ public function convert($value) { - throw new FireflyException('Importer with name TagsComma has not yet been configured.'); + $value = trim($value); + Log::debug('Going to convert using TagsComma', ['value' => $value]); + if (strlen($value) === 0) { + return new Collection; + } + $parts = array_unique(explode(',', $value)); + $set = new Collection; + Log::debug('Exploded parts.', $parts); + + /** @var TagRepositoryInterface $repository */ + $repository = app(TagRepositoryInterface::class, [$this->user]); + + + /** @var string $part */ + foreach ($parts as $part) { + if (isset($this->mapping[$part])) { + Log::debug('Found tag in mapping. Should exist.', ['value' => $part, 'map' => $this->mapping[$part]]); + $tag = $repository->find(intval($this->mapping[$part])); + if (!is_null($tag->id)) { + Log::debug('Found tag by ID', ['id' => $tag->id]); + + $set->push($tag); + continue; + } + } + // not mapped? Still try to find it first: + $tag = $repository->findByTag($part); + if (!is_null($tag->id)) { + Log::debug('Found tag by name ', ['id' => $tag->id]); + + $set->push($tag); + continue; + } + // create new tag + $tag = $repository->store( + [ + 'tag' => $part, + 'date' => null, + 'description' => $part, + 'latitude' => null, + 'longitude' => null, + 'zoomLevel' => null, + 'tagMode' => 'nothing', + ] + ); + Log::debug('Created new tag', ['name' => $part, 'id' => $tag->id]); + $set->push($tag); + } + return $set; } } \ No newline at end of file diff --git a/app/Import/Converter/TagsSpace.php b/app/Import/Converter/TagsSpace.php index b522281e9a..211e85c0d3 100644 --- a/app/Import/Converter/TagsSpace.php +++ b/app/Import/Converter/TagsSpace.php @@ -11,7 +11,9 @@ declare(strict_types = 1); namespace FireflyIII\Import\Converter; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Repositories\Tag\TagRepositoryInterface; +use Illuminate\Support\Collection; +use Log; /** * Class TagsSpace @@ -24,11 +26,61 @@ class TagsSpace extends BasicConverter implements ConverterInterface /** * @param $value * - * @throws FireflyException + * @return Collection */ public function convert($value) { - throw new FireflyException('Importer with name TagsSpace has not yet been configured.'); + $value = trim($value); + Log::debug('Going to convert using TagsSpace', ['value' => $value]); + + if (strlen($value) === 0) { + return new Collection; + } + $parts = array_unique(explode(' ', $value)); + $set = new Collection; + Log::debug('Exploded parts.', $parts); + + /** @var TagRepositoryInterface $repository */ + $repository = app(TagRepositoryInterface::class, [$this->user]); + + + /** @var string $part */ + foreach ($parts as $part) { + if (isset($this->mapping[$part])) { + Log::debug('Found tag in mapping. Should exist.', ['value' => $part, 'map' => $this->mapping[$part]]); + $tag = $repository->find(intval($this->mapping[$part])); + if (!is_null($tag->id)) { + Log::debug('Found tag by ID', ['id' => $tag->id]); + + $set->push($tag); + continue; + } + } + // not mapped? Still try to find it first: + $tag = $repository->findByTag($part); + if (!is_null($tag->id)) { + Log::debug('Found tag by name ', ['id' => $tag->id]); + + $set->push($tag); + continue; + } + // create new tag + $tag = $repository->store( + [ + 'tag' => $part, + 'date' => null, + 'description' => $part, + 'latitude' => null, + 'longitude' => null, + 'zoomLevel' => null, + 'tagMode' => 'nothing', + ] + ); + Log::debug('Created new tag', ['name' => $part, 'id' => $tag->id]); + $set->push($tag); + } + + return $set; } } \ No newline at end of file diff --git a/app/Import/ImportEntry.php b/app/Import/ImportEntry.php index c69ab325e9..d23310646e 100644 --- a/app/Import/ImportEntry.php +++ b/app/Import/ImportEntry.php @@ -12,7 +12,7 @@ declare(strict_types = 1); namespace FireflyIII\Import; use FireflyIII\Exceptions\FireflyException; -use FireflyIII\Models\Account; +use Log; /** * Class ImportEntry @@ -21,21 +21,39 @@ use FireflyIII\Models\Account; */ class ImportEntry { - /** @var Account */ - public $assetAccount; + public $amount; + /** - * @param $role - * @param $value + * @param string $role + * @param string $value + * @param int $certainty + * @param $convertedValue * * @throws FireflyException */ - public function fromRawValue($role, $value) + public function importValue(string $role, string $value, int $certainty, $convertedValue) { switch ($role) { default: - throw new FireflyException('Cannot handle role of type "' . $role . '".'); + Log::error('Import entry cannot handle object.', ['role' => $role]); + throw new FireflyException('Import entry cannot handle object of type "' . $role . '".'); + break; + case 'amount': + $this->setAmount($convertedValue); + return; + case 'account-id': + + break; } } + + /** + * @param float $amount + */ + private function setAmount(float $amount) + { + $this->amount = $amount; + } } \ No newline at end of file diff --git a/app/Import/Importer/CsvImporter.php b/app/Import/Importer/CsvImporter.php index 2779fb33cc..731129bdc5 100644 --- a/app/Import/Importer/CsvImporter.php +++ b/app/Import/Importer/CsvImporter.php @@ -485,11 +485,13 @@ class CsvImporter implements ImporterInterface // run the converter for this value: $convertedValue = $converter->convert($value); + $certainty = $converter->getCertainty(); // log it. Log::debug('Value ', ['index' => $index, 'value' => $value, 'role' => $role]); // store in import entry: + $object->importValue($role, $value, $certainty, $convertedValue); // $object->fromRawValue($role, $value); diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php new file mode 100644 index 0000000000..93de3d0602 --- /dev/null +++ b/app/Models/Configuration.php @@ -0,0 +1,62 @@ +attributes['data'] = json_encode($value); + } + + + +} diff --git a/app/Models/Preference.php b/app/Models/Preference.php index cbb7b0512a..b19d4458d7 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -47,6 +47,7 @@ class Preference extends Model * @param $value * * @return mixed + * @throws FireflyException */ public function getDataAttribute($value) { diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index 6ea3d33f3e..8380895404 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -13,6 +13,7 @@ namespace FireflyIII\Providers; use FireflyIII\Support\Amount; use FireflyIII\Support\ExpandedForm; +use FireflyIII\Support\FireflyConfig; use FireflyIII\Support\Navigation; use FireflyIII\Support\Preferences; use FireflyIII\Support\Steam; @@ -62,6 +63,12 @@ class FireflyServiceProvider extends ServiceProvider return new Preferences; } ); + + $this->app->bind( + 'fireflyconfig', function () { + return new FireflyConfig; + } + ); $this->app->bind( 'navigation', function () { return new Navigation; diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index c12d3a3fb4..af1994ebce 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -23,7 +23,6 @@ use FireflyIII\User; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Collection; -use Log; /** * Class BudgetRepository @@ -86,6 +85,26 @@ class BudgetRepository implements BudgetRepositoryInterface return $budget; } + /** + * Find a budget. + * + * @param string $name + * + * @return Budget + */ + public function findByName(string $name): Budget + { + $budgets = $this->user->budgets()->get(); + /** @var Budget $budget */ + foreach ($budgets as $budget) { + if ($budget->name === $name) { + return $budget; + } + } + + return new Budget; + } + /** * This method returns the oldest journal or transaction date known to this budget. * Will cache result. @@ -499,5 +518,4 @@ class BudgetRepository implements BudgetRepositoryInterface return $limit; } - } diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index 31bf8d4ed2..ae5a07f3fc 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -24,6 +24,11 @@ use Illuminate\Support\Collection; interface BudgetRepositoryInterface { + /** + * @return bool + */ + public function cleanupBudgets(): bool; + /** * @param Budget $budget * @@ -40,6 +45,15 @@ interface BudgetRepositoryInterface */ public function find(int $budgetId): Budget; + /** + * Find a budget. + * + * @param string $name + * + * @return Budget + */ + public function findByName(string $name): Budget; + /** * This method returns the oldest journal or transaction date known to this budget. * Will cache result. @@ -92,15 +106,6 @@ interface BudgetRepositoryInterface */ public function journalsInPeriodWithoutBudget(Collection $accounts, Carbon $start, Carbon $end): Collection; - /** - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return string - */ - public function spentInPeriodWithoutBudget(Collection $accounts, Carbon $start, Carbon $end): string; - /** * @param Collection $budgets * @param Collection $accounts @@ -112,9 +117,13 @@ interface BudgetRepositoryInterface public function spentInPeriod(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end) : string; /** - * @return bool + * @param Collection $accounts + * @param Carbon $start + * @param Carbon $end + * + * @return string */ - public function cleanupBudgets(): bool; + public function spentInPeriodWithoutBudget(Collection $accounts, Carbon $start, Carbon $end): string; /** * @param array $data diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 4287eb429c..9cd4024928 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -101,6 +101,25 @@ class CategoryRepository implements CategoryRepositoryInterface return $category; } + /** + * Find a category + * + * @param string $name + * + * @return Category + */ + public function findByName(string $name) : Category + { + $categories = $this->user->categories()->get(); + foreach ($categories as $category) { + if ($category->name === $name) { + return $category; + } + } + + return new Category; + } + /** * @param Category $category * @param Collection $accounts @@ -554,4 +573,5 @@ class CategoryRepository implements CategoryRepositoryInterface return $sum; } + } diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php index 3df5717ab9..cb6d757e32 100644 --- a/app/Repositories/Category/CategoryRepositoryInterface.php +++ b/app/Repositories/Category/CategoryRepositoryInterface.php @@ -59,6 +59,15 @@ interface CategoryRepositoryInterface */ public function find(int $categoryId) : Category; + /** + * Find a category + * + * @param string $name + * + * @return Category + */ + public function findByName(string $name) : Category; + /** * @param Category $category * @param Collection $accounts @@ -94,15 +103,6 @@ interface CategoryRepositoryInterface */ public function journalsInPeriod(Collection $categories, Collection $accounts, array $types, Carbon $start, Carbon $end): Collection; - /** - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return string - */ - public function spentInPeriodWithoutCategory(Collection $accounts, Carbon $start, Carbon $end) : string; - /** * @param Collection $accounts * @param array $types @@ -133,6 +133,15 @@ interface CategoryRepositoryInterface */ public function spentInPeriod(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): string; + /** + * @param Collection $accounts + * @param Carbon $start + * @param Carbon $end + * + * @return string + */ + public function spentInPeriodWithoutCategory(Collection $accounts, Carbon $start, Carbon $end) : string; + /** * @param array $data * diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index b2ae35a528..d83f9ce17f 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -82,6 +82,39 @@ class TagRepository implements TagRepositoryInterface return true; } + /** + * @param int $tagId + * + * @return Tag + */ + public function find(int $tagId) : Tag + { + $tag = $this->user->tags()->find($tagId); + if (is_null($tag)) { + $tag = new Tag; + } + + return $tag; + } + + /** + * @param string $tag + * + * @return Tag + */ + public function findByTag(string $tag) : Tag + { + $tags = $this->user->tags()->get(); + /** @var Tag $tag */ + foreach ($tags as $tag) { + if ($tag->tag === $tag) { + return $tag; + } + } + + return new Tag; + } + /** * @return Collection */ diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php index 4f9304c662..fad9b301c8 100644 --- a/app/Repositories/Tag/TagRepositoryInterface.php +++ b/app/Repositories/Tag/TagRepositoryInterface.php @@ -42,6 +42,20 @@ interface TagRepositoryInterface */ public function destroy(Tag $tag): bool; + /** + * @param string $tag + * + * @return Tag + */ + public function findByTag(string $tag) : Tag; + + /** + * @param int $tagId + * + * @return Tag + */ + public function find(int $tagId) : Tag; + /** * This method returns all the user's tags. * diff --git a/app/Support/Facades/FireflyConfig.php b/app/Support/Facades/FireflyConfig.php new file mode 100644 index 0000000000..0b1b47cff8 --- /dev/null +++ b/app/Support/Facades/FireflyConfig.php @@ -0,0 +1,33 @@ +id . $name; + if (Cache::has($fullName)) { + Cache::forget($fullName); + } + Preference::where('user_id', Auth::user()->id)->where('name', $name)->delete(); + + return true; + } + + /** + * @param $name + * @param null $default + * + * @return Configuration|null + */ + public function get($name, $default = null) + { + $fullName = 'ff-config-' . $name; + if (Cache::has($fullName)) { + return Cache::get($fullName); + } + + $config = Configuration::where('name', $name)->first(['id', 'name', 'data']); + + if ($config) { + Cache::forever($fullName, $config); + + return $config; + } + // no preference found and default is null: + if (is_null($default)) { + // return NULL + return null; + } + + return $this->set($name, $default); + + } + + /** + * @param $name + * @param string $value + * + * @return Configuration + */ + public function set($name, $value): Configuration + { + $item = $this->get($name, $value); + $item->data = $value; + $item->save(); + + Cache::forget('ff-config-' . $name); + + return $item; + + } + +} diff --git a/composer.lock b/composer.lock index 8bcb7affc5..6168be6600 100644 --- a/composer.lock +++ b/composer.lock @@ -855,16 +855,16 @@ }, { "name": "laravel/framework", - "version": "v5.2.32", + "version": "5.2.41", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "f688217113f70b01d0e127da9035195415812bef" + "reference": "29ba2e310cfeb42ab6545bcd81ff4c2ec1f6b5c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/f688217113f70b01d0e127da9035195415812bef", - "reference": "f688217113f70b01d0e127da9035195415812bef", + "url": "https://api.github.com/repos/laravel/framework/zipball/29ba2e310cfeb42ab6545bcd81ff4c2ec1f6b5c2", + "reference": "29ba2e310cfeb42ab6545bcd81ff4c2ec1f6b5c2", "shasum": "" }, "require": { @@ -921,7 +921,8 @@ "illuminate/support": "self.version", "illuminate/translation": "self.version", "illuminate/validation": "self.version", - "illuminate/view": "self.version" + "illuminate/view": "self.version", + "tightenco/collect": "self.version" }, "require-dev": { "aws/aws-sdk-php": "~3.0", @@ -980,7 +981,7 @@ "framework", "laravel" ], - "time": "2016-05-17 13:24:40" + "time": "2016-07-20 13:13:06" }, { "name": "laravelcollective/html", @@ -1038,16 +1039,16 @@ }, { "name": "league/commonmark", - "version": "0.13.3", + "version": "0.14.0", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "35816f39eb2498484fbb7b1495633a976ee1a8de" + "reference": "b73c0b7288bd0e6f9f56bd0b20d0657214b91838" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/35816f39eb2498484fbb7b1495633a976ee1a8de", - "reference": "35816f39eb2498484fbb7b1495633a976ee1a8de", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/b73c0b7288bd0e6f9f56bd0b20d0657214b91838", + "reference": "b73c0b7288bd0e6f9f56bd0b20d0657214b91838", "shasum": "" }, "require": { @@ -1076,7 +1077,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.14-dev" + "dev-master": "0.15-dev" } }, "autoload": { @@ -1103,7 +1104,7 @@ "markdown", "parser" ], - "time": "2016-05-21 18:41:30" + "time": "2016-07-02 18:48:39" }, { "name": "league/csv", @@ -1164,16 +1165,16 @@ }, { "name": "league/flysystem", - "version": "1.0.22", + "version": "1.0.25", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "bd73a91703969a2d20ab4bfbf971d6c2cbe36612" + "reference": "a76afa4035931be0c78ca8efc6abf3902362f437" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/bd73a91703969a2d20ab4bfbf971d6c2cbe36612", - "reference": "bd73a91703969a2d20ab4bfbf971d6c2cbe36612", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a76afa4035931be0c78ca8efc6abf3902362f437", + "reference": "a76afa4035931be0c78ca8efc6abf3902362f437", "shasum": "" }, "require": { @@ -1186,7 +1187,7 @@ "ext-fileinfo": "*", "mockery/mockery": "~0.9", "phpspec/phpspec": "^2.2", - "phpunit/phpunit": "~4.8 || ~5.0" + "phpunit/phpunit": "~4.8" }, "suggest": { "ext-fileinfo": "Required for MimeType", @@ -1243,20 +1244,20 @@ "sftp", "storage" ], - "time": "2016-04-28 06:53:12" + "time": "2016-07-18 12:22:57" }, { "name": "monolog/monolog", - "version": "1.19.0", + "version": "1.20.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf" + "reference": "55841909e2bcde01b5318c35f2b74f8ecc86e037" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5f56ed5212dc509c8dc8caeba2715732abb32dbf", - "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/55841909e2bcde01b5318c35f2b74f8ecc86e037", + "reference": "55841909e2bcde01b5318c35f2b74f8ecc86e037", "shasum": "" }, "require": { @@ -1275,8 +1276,8 @@ "php-console/php-console": "^3.1.3", "phpunit/phpunit": "~4.5", "phpunit/phpunit-mock-objects": "2.3.0", - "raven/raven": "^0.13", "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", "swiftmailer/swiftmailer": "~5.3" }, "suggest": { @@ -1288,9 +1289,9 @@ "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", "php-console/php-console": "Allow sending log messages to Google Chrome", - "raven/raven": "Allow sending log messages to a Sentry server", "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", "extra": { @@ -1321,7 +1322,7 @@ "logging", "psr-3" ], - "time": "2016-04-12 18:29:35" + "time": "2016-07-02 14:02:10" }, { "name": "mtdowling/cron-expression", @@ -1843,23 +1844,23 @@ }, { "name": "swiftmailer/swiftmailer", - "version": "v5.4.2", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "d8db871a54619458a805229a057ea2af33c753e8" + "reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/d8db871a54619458a805229a057ea2af33c753e8", - "reference": "d8db871a54619458a805229a057ea2af33c753e8", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/4cc92842069c2bbc1f28daaaf1d2576ec4dfe153", + "reference": "4cc92842069c2bbc1f28daaaf1d2576ec4dfe153", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "mockery/mockery": "~0.9.1,<0.9.4" + "mockery/mockery": "~0.9.1" }, "type": "library", "extra": { @@ -1892,20 +1893,20 @@ "mail", "mailer" ], - "time": "2016-05-01 08:45:47" + "time": "2016-07-08 11:51:25" }, { "name": "symfony/console", - "version": "v3.0.6", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "34a214710e0714b6efcf40ba3cd1e31373a97820" + "reference": "a7abb7153f6d1da47f87ec50274844e246b09d9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/34a214710e0714b6efcf40ba3cd1e31373a97820", - "reference": "34a214710e0714b6efcf40ba3cd1e31373a97820", + "url": "https://api.github.com/repos/symfony/console/zipball/a7abb7153f6d1da47f87ec50274844e246b09d9f", + "reference": "a7abb7153f6d1da47f87ec50274844e246b09d9f", "shasum": "" }, "require": { @@ -1952,20 +1953,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-04-28 09:48:42" + "time": "2016-06-29 07:02:21" }, { "name": "symfony/debug", - "version": "v3.0.6", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "a06d10888a45afd97534506afb058ec38d9ba35b" + "reference": "c54bc3539c3b87e86799533801e8ae0e971d78c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/a06d10888a45afd97534506afb058ec38d9ba35b", - "reference": "a06d10888a45afd97534506afb058ec38d9ba35b", + "url": "https://api.github.com/repos/symfony/debug/zipball/c54bc3539c3b87e86799533801e8ae0e971d78c2", + "reference": "c54bc3539c3b87e86799533801e8ae0e971d78c2", "shasum": "" }, "require": { @@ -2009,20 +2010,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2016-03-30 10:41:14" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.0.6", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "807dde98589f9b2b00624dca326740380d78dbbc" + "reference": "7f9839ede2070f53e7e2f0849b9bd14748c434c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/807dde98589f9b2b00624dca326740380d78dbbc", - "reference": "807dde98589f9b2b00624dca326740380d78dbbc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7f9839ede2070f53e7e2f0849b9bd14748c434c5", + "reference": "7f9839ede2070f53e7e2f0849b9bd14748c434c5", "shasum": "" }, "require": { @@ -2042,7 +2043,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -2069,20 +2070,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-05-05 06:56:13" + "time": "2016-06-29 05:41:56" }, { "name": "symfony/finder", - "version": "v3.0.6", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "c54e407b35bc098916704e9fd090da21da4c4f52" + "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c54e407b35bc098916704e9fd090da21da4c4f52", - "reference": "c54e407b35bc098916704e9fd090da21da4c4f52", + "url": "https://api.github.com/repos/symfony/finder/zipball/3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", + "reference": "3eb4e64c6145ef8b92adefb618a74ebdde9e3fe9", "shasum": "" }, "require": { @@ -2118,20 +2119,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2016-03-10 11:13:05" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/http-foundation", - "version": "v3.0.6", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "18b24bc32d2495ae79d76e777368786a6536fe31" + "reference": "1341139f906d295baa4f4abd55293d07e25a065a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/18b24bc32d2495ae79d76e777368786a6536fe31", - "reference": "18b24bc32d2495ae79d76e777368786a6536fe31", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/1341139f906d295baa4f4abd55293d07e25a065a", + "reference": "1341139f906d295baa4f4abd55293d07e25a065a", "shasum": "" }, "require": { @@ -2171,20 +2172,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2016-04-12 18:09:53" + "time": "2016-06-29 07:02:21" }, { "name": "symfony/http-kernel", - "version": "v3.0.6", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "6a5010978edf0a9646342232531e53bfc7abbcd3" + "reference": "177b63b2d50b63fa6d82ea41359ed9928cc7a1fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6a5010978edf0a9646342232531e53bfc7abbcd3", - "reference": "6a5010978edf0a9646342232531e53bfc7abbcd3", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/177b63b2d50b63fa6d82ea41359ed9928cc7a1fb", + "reference": "177b63b2d50b63fa6d82ea41359ed9928cc7a1fb", "shasum": "" }, "require": { @@ -2192,7 +2193,7 @@ "psr/log": "~1.0", "symfony/debug": "~2.8|~3.0", "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/http-foundation": "~2.8|~3.0" + "symfony/http-foundation": "~2.8.8|~3.0.8|~3.1.2|~3.2" }, "conflict": { "symfony/config": "<2.8" @@ -2253,7 +2254,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2016-05-09 22:13:13" + "time": "2016-06-30 16:30:17" }, { "name": "symfony/polyfill-mbstring", @@ -2424,16 +2425,16 @@ }, { "name": "symfony/process", - "version": "v3.0.6", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "53f9407c0bb1c5a79127db8f7bfe12f0f6f3dcdb" + "reference": "d7cde1f9d94d87060204f863779389b61c382eeb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/53f9407c0bb1c5a79127db8f7bfe12f0f6f3dcdb", - "reference": "53f9407c0bb1c5a79127db8f7bfe12f0f6f3dcdb", + "url": "https://api.github.com/repos/symfony/process/zipball/d7cde1f9d94d87060204f863779389b61c382eeb", + "reference": "d7cde1f9d94d87060204f863779389b61c382eeb", "shasum": "" }, "require": { @@ -2469,20 +2470,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-04-14 15:30:28" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/routing", - "version": "v3.0.6", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "a6cd168310066176599442aa21f5da86c3f8e0b3" + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/a6cd168310066176599442aa21f5da86c3f8e0b3", - "reference": "a6cd168310066176599442aa21f5da86c3f8e0b3", + "url": "https://api.github.com/repos/symfony/routing/zipball/9038984bd9c05ab07280121e9e10f61a7231457b", + "reference": "9038984bd9c05ab07280121e9e10f61a7231457b", "shasum": "" }, "require": { @@ -2544,20 +2545,20 @@ "uri", "url" ], - "time": "2016-05-03 12:23:49" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/translation", - "version": "v3.0.6", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "f7a07af51ea067745a521dab1e3152044a2fb1f2" + "reference": "6bf844e1ee3c820c012386c10427a5c67bbefec8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f7a07af51ea067745a521dab1e3152044a2fb1f2", - "reference": "f7a07af51ea067745a521dab1e3152044a2fb1f2", + "url": "https://api.github.com/repos/symfony/translation/zipball/6bf844e1ee3c820c012386c10427a5c67bbefec8", + "reference": "6bf844e1ee3c820c012386c10427a5c67bbefec8", "shasum": "" }, "require": { @@ -2608,20 +2609,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2016-03-25 01:41:20" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/var-dumper", - "version": "v3.0.6", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "0e918c269093ba4c77fca14e9424fa74ed16f1a6" + "reference": "2f046e9a9d571f22cc8b26783564876713b06579" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0e918c269093ba4c77fca14e9424fa74ed16f1a6", - "reference": "0e918c269093ba4c77fca14e9424fa74ed16f1a6", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2f046e9a9d571f22cc8b26783564876713b06579", + "reference": "2f046e9a9d571f22cc8b26783564876713b06579", "shasum": "" }, "require": { @@ -2671,20 +2672,20 @@ "debug", "dump" ], - "time": "2016-04-25 11:17:47" + "time": "2016-06-29 05:40:00" }, { "name": "twig/twig", - "version": "v1.24.0", + "version": "v1.24.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8" + "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8", - "reference": "3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/3566d311a92aae4deec6e48682dc5a4528c4a512", + "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512", "shasum": "" }, "require": { @@ -2732,20 +2733,20 @@ "keywords": [ "templating" ], - "time": "2016-01-25 21:22:18" + "time": "2016-05-30 09:11:59" }, { "name": "vlucas/phpdotenv", - "version": "v2.2.1", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "63f37b9395e8041cd4313129c08ece896d06ca8e" + "reference": "9ca5644c536654e9509b9d257f53c58630eb2a6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/63f37b9395e8041cd4313129c08ece896d06ca8e", - "reference": "63f37b9395e8041cd4313129c08ece896d06ca8e", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/9ca5644c536654e9509b9d257f53c58630eb2a6a", + "reference": "9ca5644c536654e9509b9d257f53c58630eb2a6a", "shasum": "" }, "require": { @@ -2757,7 +2758,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -2782,7 +2783,7 @@ "env", "environment" ], - "time": "2016-04-15 10:48:49" + "time": "2016-06-14 14:14:52" }, { "name": "watson/validating", @@ -2897,28 +2898,31 @@ }, { "name": "barryvdh/laravel-ide-helper", - "version": "v2.1.4", + "version": "v2.2.1", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "f1ebd847aac9a4545325d35108cafc285fe1605f" + "reference": "28af7cd19ca41cc0c63dd1de2b46c2b84d31c463" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/f1ebd847aac9a4545325d35108cafc285fe1605f", - "reference": "f1ebd847aac9a4545325d35108cafc285fe1605f", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/28af7cd19ca41cc0c63dd1de2b46c2b84d31c463", + "reference": "28af7cd19ca41cc0c63dd1de2b46c2b84d31c463", "shasum": "" }, "require": { - "illuminate/console": "5.0.x|5.1.x|5.2.x", - "illuminate/filesystem": "5.0.x|5.1.x|5.2.x", - "illuminate/support": "5.0.x|5.1.x|5.2.x", + "barryvdh/reflection-docblock": "^2.0.4", + "illuminate/console": "^5.0,<5.4", + "illuminate/filesystem": "^5.0,<5.4", + "illuminate/support": "^5.0,<5.4", "php": ">=5.4.0", - "phpdocumentor/reflection-docblock": "^2.0.4", - "symfony/class-loader": "~2.3|~3.0" + "symfony/class-loader": "^2.3|^3.0" }, "require-dev": { - "doctrine/dbal": "~2.3" + "doctrine/dbal": "~2.3", + "phpunit/phpunit": "4.*", + "scrutinizer/ocular": "~1.1", + "squizlabs/php_codesniffer": "~2.3" }, "suggest": { "doctrine/dbal": "Load information from the database about models for phpdocs (~2.3)" @@ -2926,7 +2930,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.2-dev" } }, "autoload": { @@ -2956,7 +2960,56 @@ "phpstorm", "sublime" ], - "time": "2016-03-03 08:45:00" + "time": "2016-07-04 11:52:48" + }, + { + "name": "barryvdh/reflection-docblock", + "version": "v2.0.4", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/ReflectionDocBlock.git", + "reference": "3dcbd98b5d9384a5357266efba8fd29884458e5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/ReflectionDocBlock/zipball/3dcbd98b5d9384a5357266efba8fd29884458e5c", + "reference": "3dcbd98b5d9384a5357266efba8fd29884458e5c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0,<4.5" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Barryvdh": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2016-06-13 19:28:20" }, { "name": "doctrine/instantiator", @@ -3066,12 +3119,12 @@ "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "8bfb4013724c1f62dc267af0e998207ac3fdc226" + "reference": "b7a5e18824117d8b65942e9aa77425d9b7dd7ff8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8bfb4013724c1f62dc267af0e998207ac3fdc226", - "reference": "8bfb4013724c1f62dc267af0e998207ac3fdc226", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b7a5e18824117d8b65942e9aa77425d9b7dd7ff8", + "reference": "b7a5e18824117d8b65942e9aa77425d9b7dd7ff8", "shasum": "" }, "require": { @@ -3106,7 +3159,7 @@ "keywords": [ "test" ], - "time": "2016-04-21 19:47:43" + "time": "2016-07-22 14:03:17" }, { "name": "maximebf/debugbar", @@ -3175,12 +3228,12 @@ "source": { "type": "git", "url": "https://github.com/padraic/mockery.git", - "reference": "ad31ff997d983e0d5d60ac80cfcedcbb4e6c4461" + "reference": "ee06e7b564ea4dc9b90605d894c2626f87df334d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/ad31ff997d983e0d5d60ac80cfcedcbb4e6c4461", - "reference": "ad31ff997d983e0d5d60ac80cfcedcbb4e6c4461", + "url": "https://api.github.com/repos/padraic/mockery/zipball/ee06e7b564ea4dc9b90605d894c2626f87df334d", + "reference": "ee06e7b564ea4dc9b90605d894c2626f87df334d", "shasum": "" }, "require": { @@ -3232,41 +3285,90 @@ "test double", "testing" ], - "time": "2016-05-03 10:17:25" + "time": "2016-07-06 09:05:19" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "name": "phpdocumentor/reflection-common", + "version": "1.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "phpunit/phpunit": "^4.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ "src/" ] } @@ -3278,39 +3380,87 @@ "authors": [ { "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "email": "me@mikevanriel.com" } ], - "time": "2015-02-03 12:10:50" + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-06-10 09:48:41" }, { - "name": "phpspec/prophecy", - "version": "v1.6.0", + "name": "phpdocumentor/type-resolver", + "version": "0.2", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2016-06-10 07:14:17" + }, + { + "name": "phpspec/prophecy", + "version": "v1.6.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", - "sebastian/recursion-context": "~1.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "^2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -3343,7 +3493,7 @@ "spy", "stub" ], - "time": "2016-02-15 07:46:21" + "time": "2016-06-07 08:13:47" }, { "name": "phpunit/php-code-coverage", @@ -3590,16 +3740,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.26", + "version": "4.8.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74" + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74", - "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90", + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90", "shasum": "" }, "require": { @@ -3658,7 +3808,7 @@ "testing", "xunit" ], - "time": "2016-05-17 03:09:28" + "time": "2016-07-21 06:48:14" }, { "name": "phpunit/phpunit-mock-objects", @@ -3884,16 +4034,16 @@ }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -3901,12 +4051,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -3946,7 +4097,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", @@ -4089,16 +4240,16 @@ }, { "name": "symfony/class-loader", - "version": "v3.0.6", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "cbb7e6a9c0213a0cffa5d9065ee8214ca4e83877" + "reference": "0d0ac77c336eb73f35bebdf3e1f3695ac741bbc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/cbb7e6a9c0213a0cffa5d9065ee8214ca4e83877", - "reference": "cbb7e6a9c0213a0cffa5d9065ee8214ca4e83877", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/0d0ac77c336eb73f35bebdf3e1f3695ac741bbc9", + "reference": "0d0ac77c336eb73f35bebdf3e1f3695ac741bbc9", "shasum": "" }, "require": { @@ -4114,7 +4265,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -4141,20 +4292,20 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2016-03-30 10:41:14" + "time": "2016-06-29 05:41:56" }, { "name": "symfony/css-selector", - "version": "v3.0.6", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0" + "reference": "b8999c1f33c224b2b66b38253f5e3a838d0d0115" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/65e764f404685f2dc20c057e889b3ad04b2e2db0", - "reference": "65e764f404685f2dc20c057e889b3ad04b2e2db0", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b8999c1f33c224b2b66b38253f5e3a838d0d0115", + "reference": "b8999c1f33c224b2b66b38253f5e3a838d0d0115", "shasum": "" }, "require": { @@ -4194,20 +4345,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/dom-crawler", - "version": "v3.0.6", + "version": "v3.0.8", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "49b588841225b205700e5122fa01911cabada857" + "reference": "62769e3409006b937bb333b29da8df9a8b262975" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/49b588841225b205700e5122fa01911cabada857", - "reference": "49b588841225b205700e5122fa01911cabada857", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/62769e3409006b937bb333b29da8df9a8b262975", + "reference": "62769e3409006b937bb333b29da8df9a8b262975", "shasum": "" }, "require": { @@ -4250,20 +4401,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2016-04-12 18:09:53" + "time": "2016-06-29 05:40:00" }, { "name": "symfony/yaml", - "version": "v3.0.6", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "0047c8366744a16de7516622c5b7355336afae96" + "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96", - "reference": "0047c8366744a16de7516622c5b7355336afae96", + "url": "https://api.github.com/repos/symfony/yaml/zipball/2884c26ce4c1d61aebf423a8b912950fe7c764de", + "reference": "2884c26ce4c1d61aebf423a8b912950fe7c764de", "shasum": "" }, "require": { @@ -4272,7 +4423,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -4299,7 +4450,56 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" + "time": "2016-06-29 05:41:56" + }, + { + "name": "webmozart/assert", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2015-08-24 13:29:44" } ], "aliases": [], diff --git a/config/app.php b/config/app.php index 7e3766d118..8b47da3aeb 100644 --- a/config/app.php +++ b/config/app.php @@ -152,8 +152,6 @@ return [ Collective\Html\HtmlServiceProvider::class, - - /* * Application Service Providers... */ @@ -165,8 +163,8 @@ return [ // own stuff: -// Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class, -// Barryvdh\Debugbar\ServiceProvider::class, + Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class, + Barryvdh\Debugbar\ServiceProvider::class, 'DaveJamesMiller\Breadcrumbs\ServiceProvider', 'TwigBridge\ServiceProvider', 'PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider', @@ -204,48 +202,49 @@ return [ 'aliases' => [ - 'App' => Illuminate\Support\Facades\App::class, - 'Artisan' => Illuminate\Support\Facades\Artisan::class, - 'Auth' => Illuminate\Support\Facades\Auth::class, - 'Blade' => Illuminate\Support\Facades\Blade::class, - 'Cache' => Illuminate\Support\Facades\Cache::class, - 'Config' => Illuminate\Support\Facades\Config::class, - 'Cookie' => Illuminate\Support\Facades\Cookie::class, - 'Crypt' => Illuminate\Support\Facades\Crypt::class, - 'DB' => Illuminate\Support\Facades\DB::class, - 'Eloquent' => Illuminate\Database\Eloquent\Model::class, - 'Event' => Illuminate\Support\Facades\Event::class, - 'File' => Illuminate\Support\Facades\File::class, - 'Gate' => Illuminate\Support\Facades\Gate::class, - 'Hash' => Illuminate\Support\Facades\Hash::class, - 'Lang' => Illuminate\Support\Facades\Lang::class, - 'Log' => Illuminate\Support\Facades\Log::class, - 'Mail' => Illuminate\Support\Facades\Mail::class, - 'Password' => Illuminate\Support\Facades\Password::class, - 'Queue' => Illuminate\Support\Facades\Queue::class, - 'Redirect' => Illuminate\Support\Facades\Redirect::class, - 'Redis' => Illuminate\Support\Facades\Redis::class, - 'Request' => Illuminate\Support\Facades\Request::class, - 'Response' => Illuminate\Support\Facades\Response::class, - 'Route' => Illuminate\Support\Facades\Route::class, - 'Schema' => Illuminate\Support\Facades\Schema::class, - 'Session' => Illuminate\Support\Facades\Session::class, - 'Storage' => Illuminate\Support\Facades\Storage::class, - 'URL' => Illuminate\Support\Facades\URL::class, - 'Validator' => Illuminate\Support\Facades\Validator::class, - 'View' => Illuminate\Support\Facades\View::class, - 'Twig' => 'TwigBridge\Facade\Twig', - 'Form' => Collective\Html\FormFacade::class, - 'Html' => Collective\Html\HtmlFacade::class, - 'Breadcrumbs' => 'DaveJamesMiller\Breadcrumbs\Facade', - 'Preferences' => 'FireflyIII\Support\Facades\Preferences', - 'Navigation' => 'FireflyIII\Support\Facades\Navigation', - 'Amount' => 'FireflyIII\Support\Facades\Amount', - 'Steam' => 'FireflyIII\Support\Facades\Steam', - 'ExpandedForm' => 'FireflyIII\Support\Facades\ExpandedForm', - 'Entrust' => 'Zizaco\Entrust\EntrustFacade', - 'Input' => 'Illuminate\Support\Facades\Input', - 'Google2FA' => 'PragmaRX\Google2FA\Vendor\Laravel\Facade', + 'App' => Illuminate\Support\Facades\App::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + 'File' => Illuminate\Support\Facades\File::class, + 'Gate' => Illuminate\Support\Facades\Gate::class, + 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Lang' => Illuminate\Support\Facades\Lang::class, + 'Log' => Illuminate\Support\Facades\Log::class, + 'Mail' => Illuminate\Support\Facades\Mail::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'URL' => Illuminate\Support\Facades\URL::class, + 'Validator' => Illuminate\Support\Facades\Validator::class, + 'View' => Illuminate\Support\Facades\View::class, + 'Twig' => 'TwigBridge\Facade\Twig', + 'Form' => Collective\Html\FormFacade::class, + 'Html' => Collective\Html\HtmlFacade::class, + 'Breadcrumbs' => 'DaveJamesMiller\Breadcrumbs\Facade', + 'Preferences' => 'FireflyIII\Support\Facades\Preferences', + 'FireflyConfig' => 'FireflyIII\Support\Facades\FireflyConfig', + 'Navigation' => 'FireflyIII\Support\Facades\Navigation', + 'Amount' => 'FireflyIII\Support\Facades\Amount', + 'Steam' => 'FireflyIII\Support\Facades\Steam', + 'ExpandedForm' => 'FireflyIII\Support\Facades\ExpandedForm', + 'Entrust' => 'Zizaco\Entrust\EntrustFacade', + 'Input' => 'Illuminate\Support\Facades\Input', + 'Google2FA' => 'PragmaRX\Google2FA\Vendor\Laravel\Facade', ], diff --git a/config/csv.php b/config/csv.php index 915b8f724b..f5bab29465 100644 --- a/config/csv.php +++ b/config/csv.php @@ -60,7 +60,7 @@ return [ ], 'bill-id' => [ - 'mappable' => false, + 'mappable' => true, 'pre-process-map' => false, 'field' => 'bill', 'converter' => 'BillId', @@ -179,7 +179,7 @@ return [ 'mappable' => true, 'pre-process-map' => false, 'field' => 'asset-account-id', - 'converter' => 'AssetAccountId', + 'converter' => 'AccountId', 'mapper' => 'AssetAccounts', ], 'account-name' => [ @@ -208,7 +208,7 @@ return [ 'mappable' => true, 'pre-process-map' => false, 'field' => 'opposing-account-id', - 'converter' => 'OpposingAccountId', + 'converter' => 'AccountId', 'mapper' => 'OpposingAccounts', ], 'opposing-name' => [ diff --git a/database/migrations/2016_06_16_000000_create_support_tables.php b/database/migrations/2016_06_16_000000_create_support_tables.php index 2e3fd98741..a379310090 100644 --- a/database/migrations/2016_06_16_000000_create_support_tables.php +++ b/database/migrations/2016_06_16_000000_create_support_tables.php @@ -25,6 +25,7 @@ class CreateSupportTables extends Migration Schema::drop('permissions'); Schema::drop('roles'); Schema::drop('sessions'); + Schema::drop('configuration'); } @@ -79,6 +80,8 @@ class CreateSupportTables extends Migration */ $this->createSessionsTable(); + $this->createConfigurationTable(); + } /** @@ -123,6 +126,23 @@ class CreateSupportTables extends Migration } } + private function createConfigurationTable() + { + if (!Schema::hasTable('configuration')) { + Schema::create( + 'configuration', function (Blueprint $table) { + + $table->increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->string('name', 50); + $table->text('data'); + $table->unique(['name']); + } + ); + } + } + /** * */ @@ -176,7 +196,7 @@ class CreateSupportTables extends Migration 'permission_role', function (Blueprint $table) { $table->integer('permission_id')->unsigned(); $table->integer('role_id')->unsigned(); - + $table->foreign('permission_id')->references('id')->on('permissions')->onUpdate('cascade')->onDelete('cascade'); $table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade'); diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 1861ae752b..ee4fee636f 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -718,6 +718,18 @@ return [ 'user_administration' => 'User administration', 'list_all_users' => 'All users', 'all_users' => 'All users', + 'all_blocked_domains' => 'All blocked domains', + 'blocked_domains' => 'Blocked domains', + 'no_domains_banned' => 'No domains blocked', + 'all_user_domains' => 'All user email address domains', + 'all_domains_is_filtered' => 'This list does not include already blocked domains.', + 'domain_now_blocked' => 'Domain :domain is now blocked', + 'domain_now_unblocked' => 'Domain :domain is now unblocked', + 'manual_block_domain' => 'Block a domain by hand', + 'block_domain' => 'Block domain', + 'no_domain_filled_in' => 'No domain filled in', + 'domain_already_blocked' => 'Domain :domain is already blocked', + 'domain_is_now_blocked' => 'Domain :domain is now blocked', // split a transaction: 'transaction_meta_data' => 'Transaction meta-data', diff --git a/resources/lang/en_US/form.php b/resources/lang/en_US/form.php index 0caec98f1c..fa1f42a199 100644 --- a/resources/lang/en_US/form.php +++ b/resources/lang/en_US/form.php @@ -131,6 +131,9 @@ return [ 'category_keep_transactions' => 'The only transaction connected to this category will not be deleted.|All :count transactions connected to this category will spared deletion.', 'tag_keep_transactions' => 'The only transaction connected to this tag will not be deleted.|All :count transactions connected to this tag will spared deletion.', + // admin + 'domain' => 'Domain', + // import 'import_file' => 'Import file', 'configuration_file' => 'Configuration file', diff --git a/resources/lang/en_US/list.php b/resources/lang/en_US/list.php index 8a69fced9e..e66b2afcda 100644 --- a/resources/lang/en_US/list.php +++ b/resources/lang/en_US/list.php @@ -8,54 +8,56 @@ */ return [ - 'buttons' => 'Buttons', - 'icon' => 'Icon', - 'create_date' => 'Created at', - 'update_date' => 'Updated at', - 'balance_before' => 'Balance before', - 'balance_after' => 'Balance after', - 'name' => 'Name', - 'role' => 'Role', - 'currentBalance' => 'Current balance', - 'active' => 'Is active?', - 'lastActivity' => 'Last activity', - 'balanceDiff' => 'Balance difference between :start and :end', - 'matchedOn' => 'Matched on', - 'matchesOn' => 'Matched on', - 'account_type' => 'Account type', - 'new_balance' => 'New balance', - 'account' => 'Account', - 'matchingAmount' => 'Amount', - 'lastMatch' => 'Last match', - 'split_number' => 'Split #', - 'destination' => 'Destination', - 'expectedMatch' => 'Expected match', - 'automatch' => 'Auto match?', - 'repeat_freq' => 'Repeats', - 'description' => 'Description', - 'amount' => 'Amount', - 'date' => 'Date', - 'interest_date' => 'Interest date', - 'book_date' => 'Book date', - 'process_date' => 'Processing date', - 'from' => 'From', - 'piggy_bank' => 'Piggy bank', - 'to' => 'To', - 'budget' => 'Budget', - 'category' => 'Category', - 'bill' => 'Bill', - 'withdrawal' => 'Withdrawal', - 'deposit' => 'Deposit', - 'transfer' => 'Transfer', - 'type' => 'Type', - 'completed' => 'Completed', - 'iban' => 'IBAN', - 'paid_current_period' => 'Paid this period', - 'email' => 'Email', - 'registered_at' => 'Registered at', - 'is_activated' => 'Is activated', - 'is_blocked' => 'Is blocked', - 'is_admin' => 'Is admin', - 'has_two_factor' => 'Has 2FA', - 'blocked_code' => 'Block code', + 'buttons' => 'Buttons', + 'icon' => 'Icon', + 'create_date' => 'Created at', + 'update_date' => 'Updated at', + 'balance_before' => 'Balance before', + 'balance_after' => 'Balance after', + 'name' => 'Name', + 'role' => 'Role', + 'currentBalance' => 'Current balance', + 'active' => 'Is active?', + 'lastActivity' => 'Last activity', + 'balanceDiff' => 'Balance difference between :start and :end', + 'matchedOn' => 'Matched on', + 'matchesOn' => 'Matched on', + 'account_type' => 'Account type', + 'new_balance' => 'New balance', + 'account' => 'Account', + 'matchingAmount' => 'Amount', + 'lastMatch' => 'Last match', + 'split_number' => 'Split #', + 'destination' => 'Destination', + 'expectedMatch' => 'Expected match', + 'automatch' => 'Auto match?', + 'repeat_freq' => 'Repeats', + 'description' => 'Description', + 'amount' => 'Amount', + 'date' => 'Date', + 'interest_date' => 'Interest date', + 'book_date' => 'Book date', + 'process_date' => 'Processing date', + 'from' => 'From', + 'piggy_bank' => 'Piggy bank', + 'to' => 'To', + 'budget' => 'Budget', + 'category' => 'Category', + 'bill' => 'Bill', + 'withdrawal' => 'Withdrawal', + 'deposit' => 'Deposit', + 'transfer' => 'Transfer', + 'type' => 'Type', + 'completed' => 'Completed', + 'iban' => 'IBAN', + 'paid_current_period' => 'Paid this period', + 'email' => 'Email', + 'registered_at' => 'Registered at', + 'is_activated' => 'Is activated', + 'is_blocked' => 'Is blocked', + 'is_admin' => 'Is admin', + 'has_two_factor' => 'Has 2FA', + 'blocked_code' => 'Block code', + 'domain' => 'Domain', + 'registration_attempts' => 'Registration attempts', ]; diff --git a/resources/views/admin/index.twig b/resources/views/admin/index.twig index 55c45db3d5..ea8a12b066 100644 --- a/resources/views/admin/index.twig +++ b/resources/views/admin/index.twig @@ -13,6 +13,7 @@
diff --git a/resources/views/admin/users/domains.twig b/resources/views/admin/users/domains.twig new file mode 100644 index 0000000000..2da0fe9ad2 --- /dev/null +++ b/resources/views/admin/users/domains.twig @@ -0,0 +1,120 @@ +{% extends "./layout/default.twig" %} + +{% block breadcrumbs %} + {{ Breadcrumbs.renderIfExists }} +{% endblock %} +{% block content %} ++ | {{ trans('list.domain') }} | +{{ trans('list.is_blocked') }} | +
---|---|---|
+ unblock + | +{{ domain }} | ++ + | +
+ {{ 'no_domains_banned'|_ }} +
+ {% endif %} ++ {{ 'all_domains_is_filtered'|_ }} + +
++ | {{ trans('list.domain') }} | +
---|---|
block | +{{ domain }} | + +
+ {{ 'no_domains_banned'|_ }} +
+ {% endif %} +