From 29f763d4e4779dd1b3264477c89ffc113705b91e Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:20:23 +0100 Subject: [PATCH 01/30] Update composer files. --- composer.json | 4 +- composer.lock | 688 ++++++++++++++++---------------------------------- 2 files changed, 214 insertions(+), 478 deletions(-) diff --git a/composer.json b/composer.json index 6f7bea2597..5c6784f143 100755 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ "require": { "php": ">=7.0.0", "ext-intl": "*", - "laravel/framework": "5.3.29", + "laravel/framework": "5.4.*", "davejamesmiller/laravel-breadcrumbs": "^3.0", "watson/validating": "3.*", "doctrine/dbal": "^2.5", @@ -56,7 +56,7 @@ "twig/twig": "1.30.0", "rcrowe/twigbridge": "0.9.*", "league/csv": "8.*", - "laravelcollective/html": "^5.3", + "laravelcollective/html": "^5.4", "rmccue/requests": "1.*", "pragmarx/google2fa": "1.*", "bacon/bacon-qr-code": "1.*" diff --git a/composer.lock b/composer.lock index ae477e0989..0d10a81094 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": "db26ae145d3656fe05d8a222fc21e263", + "content-hash": "3baa1b043873285dc937f9dad0083506", "packages": [ { "name": "bacon/bacon-qr-code", @@ -102,60 +102,6 @@ ], "time": "2016-05-05T11:49:03+00:00" }, - { - "name": "classpreloader/classpreloader", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/ClassPreloader/ClassPreloader.git", - "reference": "bc7206aa892b5a33f4680421b69b191efd32b096" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ClassPreloader/ClassPreloader/zipball/bc7206aa892b5a33f4680421b69b191efd32b096", - "reference": "bc7206aa892b5a33f4680421b69b191efd32b096", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^1.0|^2.0|^3.0", - "php": ">=5.5.9" - }, - "require-dev": { - "phpunit/phpunit": "^4.8|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "psr-4": { - "ClassPreloader\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com" - }, - { - "name": "Graham Campbell", - "email": "graham@alt-three.com" - } - ], - "description": "Helps class loading performance by generating a single PHP file containing all of the autoloaded files for a specific use case", - "keywords": [ - "autoload", - "class", - "preload" - ], - "time": "2016-09-16T12:50:15+00:00" - }, { "name": "davejamesmiller/laravel-breadcrumbs", "version": "3.0.1", @@ -205,39 +151,6 @@ ], "time": "2016-08-28T16:57:03+00:00" }, - { - "name": "dnoegel/php-xdg-base-dir", - "version": "0.1", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "@stable" - }, - "type": "project", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php", - "time": "2014-10-24T07:27:01+00:00" - }, { "name": "doctrine/annotations", "version": "v1.3.1", @@ -709,77 +622,26 @@ "time": "2014-09-09T13:34:57+00:00" }, { - "name": "jakub-onderka/php-console-color", - "version": "0.1", + "name": "erusev/parsedown", + "version": "1.6.1", "source": { "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", - "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1" + "url": "https://github.com/erusev/parsedown.git", + "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1", - "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1", + "url": "https://api.github.com/repos/erusev/parsedown/zipball/20ff8bbb57205368b4b42d094642a3e52dac85fb", + "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb", "shasum": "" }, "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "jakub-onderka/php-code-style": "1.0", - "jakub-onderka/php-parallel-lint": "0.*", - "jakub-onderka/php-var-dump-check": "0.*", - "phpunit/phpunit": "3.7.*", - "squizlabs/php_codesniffer": "1.*" - }, - "type": "library", - "autoload": { - "psr-0": { - "JakubOnderka\\PhpConsoleColor": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Jakub Onderka", - "email": "jakub.onderka@gmail.com", - "homepage": "http://www.acci.cz" - } - ], - "time": "2014-04-08T15:00:19+00:00" - }, - { - "name": "jakub-onderka/php-console-highlighter", - "version": "v0.3.2", - "source": { - "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", - "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5", - "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5", - "shasum": "" - }, - "require": { - "jakub-onderka/php-console-color": "~0.1", "php": ">=5.3.0" }, - "require-dev": { - "jakub-onderka/php-code-style": "~1.0", - "jakub-onderka/php-parallel-lint": "~0.5", - "jakub-onderka/php-var-dump-check": "~0.1", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.5" - }, "type": "library", "autoload": { "psr-0": { - "JakubOnderka\\PhpConsoleHighlighter": "src/" + "Parsedown": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -788,109 +650,55 @@ ], "authors": [ { - "name": "Jakub Onderka", - "email": "acci@acci.cz", - "homepage": "http://www.acci.cz/" + "name": "Emanuil Rusev", + "email": "hello@erusev.com", + "homepage": "http://erusev.com" } ], - "time": "2015-04-20T18:58:01+00:00" - }, - { - "name": "jeremeamia/SuperClosure", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/jeremeamia/super_closure.git", - "reference": "443c3df3207f176a1b41576ee2a66968a507b3db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/443c3df3207f176a1b41576ee2a66968a507b3db", - "reference": "443c3df3207f176a1b41576ee2a66968a507b3db", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^1.2|^2.0|^3.0", - "php": ">=5.4", - "symfony/polyfill-php56": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "SuperClosure\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jeremy Lindblom", - "email": "jeremeamia@gmail.com", - "homepage": "https://github.com/jeremeamia", - "role": "Developer" - } - ], - "description": "Serialize Closure objects, including their context and binding", - "homepage": "https://github.com/jeremeamia/super_closure", + "description": "Parser for Markdown.", + "homepage": "http://parsedown.org", "keywords": [ - "closure", - "function", - "lambda", - "parser", - "serializable", - "serialize", - "tokenizer" + "markdown", + "parser" ], - "time": "2016-12-07T09:37:55+00:00" + "time": "2016-11-02T15:56:58+00:00" }, { "name": "laravel/framework", - "version": "v5.3.29", + "version": "v5.4.6", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "6fd76dec90466dc3f703d8df72e38130f2ee6a32" + "reference": "5913b960656d7f978605ff9c1513ffbfd190c173" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/6fd76dec90466dc3f703d8df72e38130f2ee6a32", - "reference": "6fd76dec90466dc3f703d8df72e38130f2ee6a32", + "url": "https://api.github.com/repos/laravel/framework/zipball/5913b960656d7f978605ff9c1513ffbfd190c173", + "reference": "5913b960656d7f978605ff9c1513ffbfd190c173", "shasum": "" }, "require": { - "classpreloader/classpreloader": "~3.0", "doctrine/inflector": "~1.0", + "erusev/parsedown": "~1.6", "ext-mbstring": "*", "ext-openssl": "*", - "jeremeamia/superclosure": "~2.2", "league/flysystem": "~1.0", "monolog/monolog": "~1.11", "mtdowling/cron-expression": "~1.0", "nesbot/carbon": "~1.20", "paragonie/random_compat": "~1.4|~2.0", "php": ">=5.6.4", - "psy/psysh": "0.7.*|0.8.*", "ramsey/uuid": "~3.0", "swiftmailer/swiftmailer": "~5.4", - "symfony/console": "3.1.*", - "symfony/debug": "3.1.*", - "symfony/finder": "3.1.*", - "symfony/http-foundation": "3.1.*", - "symfony/http-kernel": "3.1.*", - "symfony/process": "3.1.*", - "symfony/routing": "3.1.*", - "symfony/translation": "3.1.*", - "symfony/var-dumper": "3.1.*", + "symfony/console": "~3.2", + "symfony/debug": "~3.2", + "symfony/finder": "~3.2", + "symfony/http-foundation": "~3.2", + "symfony/http-kernel": "~3.2", + "symfony/process": "~3.2", + "symfony/routing": "~3.2", + "symfony/var-dumper": "~3.2", + "tijsverkoyen/css-to-inline-styles": "~2.2", "vlucas/phpdotenv": "~2.2" }, "replace": { @@ -927,31 +735,34 @@ }, "require-dev": { "aws/aws-sdk-php": "~3.0", + "doctrine/dbal": "~2.5", "mockery/mockery": "~0.9.4", "pda/pheanstalk": "~3.0", - "phpunit/phpunit": "~5.4", + "phpunit/phpunit": "~5.7", "predis/predis": "~1.0", - "symfony/css-selector": "3.1.*", - "symfony/dom-crawler": "3.1.*" + "symfony/css-selector": "~3.2", + "symfony/dom-crawler": "~3.2" }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~3.0).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.5).", "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", - "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~5.3|~6.0).", + "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~6.0).", + "laravel/tinker": "Required to use the tinker console command (~1.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", + "nexmo/client": "Required to use the Nexmo transport (~1.0).", "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).", "predis/predis": "Required to use the redis cache and queue drivers (~1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (~2.0).", - "symfony/css-selector": "Required to use some of the crawler integration testing tools (3.1.*).", - "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (3.1.*).", - "symfony/psr-http-message-bridge": "Required to use psr7 bridging features (0.2.*)." + "symfony/css-selector": "Required to use some of the crawler integration testing tools (~3.2).", + "symfony/dom-crawler": "Required to use most of the crawler integration testing tools (~3.2).", + "symfony/psr-http-message-bridge": "Required to psr7 bridging features (0.2.*)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -979,32 +790,32 @@ "framework", "laravel" ], - "time": "2017-01-06T14:33:56+00:00" + "time": "2017-01-27T19:27:15+00:00" }, { "name": "laravelcollective/html", - "version": "v5.3.1", + "version": "v5.4.1", "source": { "type": "git", "url": "https://github.com/LaravelCollective/html.git", - "reference": "2f7f2e127c6fed47f269ea29ab5efeb8f65e9d35" + "reference": "7570f25d58a00fd6909c0563808590f9cdb14d47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LaravelCollective/html/zipball/2f7f2e127c6fed47f269ea29ab5efeb8f65e9d35", - "reference": "2f7f2e127c6fed47f269ea29ab5efeb8f65e9d35", + "url": "https://api.github.com/repos/LaravelCollective/html/zipball/7570f25d58a00fd6909c0563808590f9cdb14d47", + "reference": "7570f25d58a00fd6909c0563808590f9cdb14d47", "shasum": "" }, "require": { - "illuminate/http": "5.3.*", - "illuminate/routing": "5.3.*", - "illuminate/session": "5.3.*", - "illuminate/support": "5.3.*", - "illuminate/view": "5.3.*", + "illuminate/http": "5.4.*", + "illuminate/routing": "5.4.*", + "illuminate/session": "5.4.*", + "illuminate/support": "5.4.*", + "illuminate/view": "5.4.*", "php": ">=5.6.4" }, "require-dev": { - "illuminate/database": "5.3.*", + "illuminate/database": "5.4.*", "mockery/mockery": "~0.9.4", "phpunit/phpunit": "~5.4" }, @@ -1033,7 +844,7 @@ ], "description": "HTML and Form Builders for the Laravel Framework", "homepage": "http://laravelcollective.com", - "time": "2016-12-13T14:23:36+00:00" + "time": "2017-01-26T19:27:05+00:00" }, { "name": "league/commonmark", @@ -1419,57 +1230,6 @@ ], "time": "2017-01-16T07:55:07+00:00" }, - { - "name": "nikic/php-parser", - "version": "v3.0.2", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "adf44419c0fc014a0f191db6f89d3e55d4211744" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/adf44419c0fc014a0f191db6f89d3e55d4211744", - "reference": "adf44419c0fc014a0f191db6f89d3e55d4211744", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2016-12-06T11:30:35+00:00" - }, { "name": "paragonie/random_compat", "version": "v2.0.4", @@ -1626,79 +1386,6 @@ ], "time": "2016-10-10T12:19:37+00:00" }, - { - "name": "psy/psysh", - "version": "v0.8.1", - "source": { - "type": "git", - "url": "https://github.com/bobthecow/psysh.git", - "reference": "701e8a1cc426ee170f1296f5d9f6b8a26ad25c4a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/701e8a1cc426ee170f1296f5d9f6b8a26ad25c4a", - "reference": "701e8a1cc426ee170f1296f5d9f6b8a26ad25c4a", - "shasum": "" - }, - "require": { - "dnoegel/php-xdg-base-dir": "0.1", - "jakub-onderka/php-console-highlighter": "0.3.*", - "nikic/php-parser": "~1.3|~2.0|~3.0", - "php": ">=5.3.9", - "symfony/console": "~2.3.10|^2.4.2|~3.0", - "symfony/var-dumper": "~2.7|~3.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~1.11", - "hoa/console": "~3.16|~1.14", - "phpunit/phpunit": "~4.4|~5.0", - "symfony/finder": "~2.1|~3.0" - }, - "suggest": { - "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", - "ext-pdo-sqlite": "The doc command requires SQLite to work.", - "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", - "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", - "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." - }, - "bin": [ - "bin/psysh" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.9.x-dev" - } - }, - "autoload": { - "files": [ - "src/Psy/functions.php" - ], - "psr-4": { - "Psy\\": "src/Psy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" - } - ], - "description": "An interactive shell for modern PHP.", - "homepage": "http://psysh.org", - "keywords": [ - "REPL", - "console", - "interactive", - "shell" - ], - "time": "2017-01-15T17:54:13+00:00" - }, { "name": "ramsey/uuid", "version": "3.5.2", @@ -1950,16 +1637,16 @@ }, { "name": "symfony/console", - "version": "v3.1.10", + "version": "v3.2.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "047f16485d68c083bd5d9b73ff16f9cb9c1a9f52" + "reference": "4f9e449e76996adf310498a8ca955c6deebe29dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/047f16485d68c083bd5d9b73ff16f9cb9c1a9f52", - "reference": "047f16485d68c083bd5d9b73ff16f9cb9c1a9f52", + "url": "https://api.github.com/repos/symfony/console/zipball/4f9e449e76996adf310498a8ca955c6deebe29dd", + "reference": "4f9e449e76996adf310498a8ca955c6deebe29dd", "shasum": "" }, "require": { @@ -1970,17 +1657,19 @@ "require-dev": { "psr/log": "~1.0", "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", "symfony/process": "~2.8|~3.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", + "symfony/filesystem": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2007,20 +1696,73 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-01-08T20:43:43+00:00" + "time": "2017-01-08T20:47:33+00:00" }, { - "name": "symfony/debug", + "name": "symfony/css-selector", "version": "v3.1.10", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "c6661361626b3cf5cf2089df98b3b5006a197e85" + "url": "https://github.com/symfony/css-selector.git", + "reference": "722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/c6661361626b3cf5cf2089df98b3b5006a197e85", - "reference": "c6661361626b3cf5cf2089df98b3b5006a197e85", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d", + "reference": "722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony CssSelector Component", + "homepage": "https://symfony.com", + "time": "2017-01-02T20:31:54+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.2.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "810ba5c1c5352a4ddb15d4719e8936751dff0b05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/810ba5c1c5352a4ddb15d4719e8936751dff0b05", + "reference": "810ba5c1c5352a4ddb15d4719e8936751dff0b05", "shasum": "" }, "require": { @@ -2037,7 +1779,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2064,7 +1806,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-01-28T00:04:57+00:00" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/event-dispatcher", @@ -2128,16 +1870,16 @@ }, { "name": "symfony/finder", - "version": "v3.1.10", + "version": "v3.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "59687a255d1562f2c17b012418273862083d85f7" + "reference": "8c71141cae8e2957946b403cc71a67213c0380d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/59687a255d1562f2c17b012418273862083d85f7", - "reference": "59687a255d1562f2c17b012418273862083d85f7", + "url": "https://api.github.com/repos/symfony/finder/zipball/8c71141cae8e2957946b403cc71a67213c0380d6", + "reference": "8c71141cae8e2957946b403cc71a67213c0380d6", "shasum": "" }, "require": { @@ -2146,7 +1888,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2173,20 +1915,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-01-02T20:31:54+00:00" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/http-foundation", - "version": "v3.1.10", + "version": "v3.2.2", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "cef0ad49a2e90455cfc649522025b5a2929648c0" + "reference": "33eb76bf1d833c705433e5361a646c164696394b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cef0ad49a2e90455cfc649522025b5a2929648c0", - "reference": "cef0ad49a2e90455cfc649522025b5a2929648c0", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/33eb76bf1d833c705433e5361a646c164696394b", + "reference": "33eb76bf1d833c705433e5361a646c164696394b", "shasum": "" }, "require": { @@ -2199,7 +1941,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2226,20 +1968,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-01-08T20:43:43+00:00" + "time": "2017-01-08T20:47:33+00:00" }, { "name": "symfony/http-kernel", - "version": "v3.1.10", + "version": "v3.2.2", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "c830387dec1b48c100473d10a6a356c3c3ae2a13" + "reference": "8a898e340a89022246645b1288d295f49c9381e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c830387dec1b48c100473d10a6a356c3c3ae2a13", - "reference": "c830387dec1b48c100473d10a6a356c3c3ae2a13", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8a898e340a89022246645b1288d295f49c9381e4", + "reference": "8a898e340a89022246645b1288d295f49c9381e4", "shasum": "" }, "require": { @@ -2267,7 +2009,7 @@ "symfony/stopwatch": "~2.8|~3.0", "symfony/templating": "~2.8|~3.0", "symfony/translation": "~2.8|~3.0", - "symfony/var-dumper": "~2.8|~3.0" + "symfony/var-dumper": "~3.2" }, "suggest": { "symfony/browser-kit": "", @@ -2281,7 +2023,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2308,7 +2050,7 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2017-01-28T02:53:17+00:00" + "time": "2017-01-12T21:36:33+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -2479,16 +2221,16 @@ }, { "name": "symfony/process", - "version": "v3.1.10", + "version": "v3.2.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "2605753c5f8c531623d24d002825ebb1d6a22248" + "reference": "350e810019fc52dd06ae844b6a6d382f8a0e8893" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2605753c5f8c531623d24d002825ebb1d6a22248", - "reference": "2605753c5f8c531623d24d002825ebb1d6a22248", + "url": "https://api.github.com/repos/symfony/process/zipball/350e810019fc52dd06ae844b6a6d382f8a0e8893", + "reference": "350e810019fc52dd06ae844b6a6d382f8a0e8893", "shasum": "" }, "require": { @@ -2497,7 +2239,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2524,20 +2266,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-01-21T17:13:55+00:00" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/routing", - "version": "v3.1.10", + "version": "v3.2.2", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "f25581d4eb0a82962c291917f826166f0dcd8a9a" + "reference": "fda2c67d47ec801726ca888c95d701d31b27b444" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/f25581d4eb0a82962c291917f826166f0dcd8a9a", - "reference": "f25581d4eb0a82962c291917f826166f0dcd8a9a", + "url": "https://api.github.com/repos/symfony/routing/zipball/fda2c67d47ec801726ca888c95d701d31b27b444", + "reference": "fda2c67d47ec801726ca888c95d701d31b27b444", "shasum": "" }, "require": { @@ -2566,7 +2308,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2599,20 +2341,20 @@ "uri", "url" ], - "time": "2017-01-28T00:04:57+00:00" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/translation", - "version": "v3.1.10", + "version": "v3.2.2", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "d5a20fab5f63f44c233c69b3041c3cb1d4945e45" + "reference": "6520f3d4cce604d9dd1e86cac7af954984dd9bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/d5a20fab5f63f44c233c69b3041c3cb1d4945e45", - "reference": "d5a20fab5f63f44c233c69b3041c3cb1d4945e45", + "url": "https://api.github.com/repos/symfony/translation/zipball/6520f3d4cce604d9dd1e86cac7af954984dd9bda", + "reference": "6520f3d4cce604d9dd1e86cac7af954984dd9bda", "shasum": "" }, "require": { @@ -2636,7 +2378,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2663,20 +2405,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-01-21T17:01:39+00:00" + "time": "2017-01-02T20:32:22+00:00" }, { "name": "symfony/var-dumper", - "version": "v3.1.10", + "version": "v3.2.2", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "16df11647e5b992d687cb4eeeb9a882d5f5c26b9" + "reference": "b54b23f9a19b465e76fdaac0f6732410467c83b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/16df11647e5b992d687cb4eeeb9a882d5f5c26b9", - "reference": "16df11647e5b992d687cb4eeeb9a882d5f5c26b9", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/b54b23f9a19b465e76fdaac0f6732410467c83b2", + "reference": "b54b23f9a19b465e76fdaac0f6732410467c83b2", "shasum": "" }, "require": { @@ -2692,7 +2434,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2726,7 +2468,54 @@ "debug", "dump" ], - "time": "2017-01-24T13:02:38+00:00" + "time": "2017-01-03T08:53:57+00:00" + }, + { + "name": "tijsverkoyen/css-to-inline-styles", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", + "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b", + "reference": "ab03919dfd85a74ae0372f8baf9f3c7d5c03b04b", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7", + "symfony/css-selector": "^2.7|~3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8|5.1.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "TijsVerkoyen\\CssToInlineStyles\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Tijs Verkoyen", + "email": "css_to_inline_styles@verkoyen.eu", + "role": "Developer" + } + ], + "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", + "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", + "time": "2016-09-20T12:50:39+00:00" }, { "name": "twig/twig", @@ -4588,59 +4377,6 @@ "homepage": "https://symfony.com", "time": "2017-01-10T14:14:38+00:00" }, - { - "name": "symfony/css-selector", - "version": "v3.1.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d", - "reference": "722a87478a72d95dc2a3bcf41dc9c2d13fd4cb2d", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2017-01-02T20:31:54+00:00" - }, { "name": "symfony/dom-crawler", "version": "v3.1.10", From 395aaad9c6b5668f8e2d0259ab6c9ac4e4a55ef9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:21:01 +0100 Subject: [PATCH 02/30] New class name. --- app/Console/Kernel.php | 2 +- app/Http/Kernel.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 8ea0f88014..f7c14fc8f3 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -39,7 +39,7 @@ class Kernel extends ConsoleKernel */ protected $bootstrappers = [ - 'Illuminate\Foundation\Bootstrap\DetectEnvironment', + 'Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'FireflyIII\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index e8dc229028..394ad35826 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -48,7 +48,7 @@ class Kernel extends HttpKernel */ protected $bootstrappers = [ - 'Illuminate\Foundation\Bootstrap\DetectEnvironment', + 'Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'FireflyIII\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', From b79dcd7f2398e31782069ae9f4595b24dd28986b Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:27:33 +0100 Subject: [PATCH 03/30] Disable ConfigureLogging class. --- app/Console/Kernel.php | 2 +- app/Http/Kernel.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index f7c14fc8f3..f4a1e32559 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -41,7 +41,7 @@ class Kernel extends ConsoleKernel = [ 'Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', - 'FireflyIII\Bootstrap\ConfigureLogging', + //'FireflyIII\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\SetRequestForConsole', diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 394ad35826..c552a552ee 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -50,7 +50,7 @@ class Kernel extends HttpKernel = [ 'Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', - 'FireflyIII\Bootstrap\ConfigureLogging', + //'FireflyIII\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', From 14971cf2498ae3d2b5d36e4a2a24ff9d25d5b131 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:30:35 +0100 Subject: [PATCH 04/30] Overrule logging. --- app/Providers/LogServiceProvider.php | 53 ++++++++++++++++++++++++++++ config/app.php | 10 +++--- 2 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 app/Providers/LogServiceProvider.php diff --git a/app/Providers/LogServiceProvider.php b/app/Providers/LogServiceProvider.php new file mode 100644 index 0000000000..86bf30481f --- /dev/null +++ b/app/Providers/LogServiceProvider.php @@ -0,0 +1,53 @@ +useDailyFiles( + $this->app->storagePath() . '/logs/firefly-iii.log', $this->maxFiles(), + $this->logLevel() + ); + } + + /** + * Configure the Monolog handlers for the application. + * + * @param \Illuminate\Log\Writer $log + * + * @return void + */ + protected function configureSingleHandler(Writer $log) + { + $log->useFiles( + $this->app->storagePath() . '/logs/firefly-iii.log', + $this->logLevel() + ); + } +} \ No newline at end of file diff --git a/config/app.php b/config/app.php index 4933ad1c8c..125ec35093 100755 --- a/config/app.php +++ b/config/app.php @@ -26,8 +26,8 @@ return [ 'providers' => [ /* - * Laravel Framework Service Providers... - */ + * Laravel Framework Service Providers... + */ Illuminate\Auth\AuthServiceProvider::class, Illuminate\Broadcasting\BroadcastServiceProvider::class, Illuminate\Bus\BusServiceProvider::class, @@ -50,12 +50,11 @@ return [ Illuminate\Translation\TranslationServiceProvider::class, Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, - Collective\Html\HtmlServiceProvider::class, - /* * Application Service Providers... */ + FireflyIII\Providers\LogServiceProvider::class, FireflyIII\Providers\AppServiceProvider::class, FireflyIII\Providers\AuthServiceProvider::class, // FireflyIII\Providers\BroadcastServiceProvider::class, @@ -92,11 +91,12 @@ 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, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, 'Cache' => Illuminate\Support\Facades\Cache::class, 'Config' => Illuminate\Support\Facades\Config::class, 'Cookie' => Illuminate\Support\Facades\Cookie::class, From e80298f81554b67ca60cd1907113ec6378cb91f3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:31:41 +0100 Subject: [PATCH 05/30] Include laravel bread crumbs and custom repository. --- composer.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 5c6784f143..4c1764d3c0 100755 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "financials", "financial", "budgets", - "administration", + "administration", "tool", "tooling", "help", @@ -49,7 +49,7 @@ "php": ">=7.0.0", "ext-intl": "*", "laravel/framework": "5.4.*", - "davejamesmiller/laravel-breadcrumbs": "^3.0", + "davejamesmiller/laravel-breadcrumbs": "3.1", "watson/validating": "3.*", "doctrine/dbal": "^2.5", "league/commonmark": "0.15.*", @@ -106,5 +106,11 @@ }, "config": { "preferred-install": "dist" - } + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/firefly-iii/laravel-breadcrumbs.git" + } + ] } From 4bc3af717641173cc28d2a3c6551688d9b1d7e6f Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:35:31 +0100 Subject: [PATCH 06/30] Updated composer.lock file for change to bread crumbs. --- composer.lock | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index 0d10a81094..46a59ecc21 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": "3baa1b043873285dc937f9dad0083506", + "content-hash": "485d633a8ac40b245a597a33fae7abf4", "packages": [ { "name": "bacon/bacon-qr-code", @@ -104,16 +104,16 @@ }, { "name": "davejamesmiller/laravel-breadcrumbs", - "version": "3.0.1", + "version": "3.1", "source": { "type": "git", - "url": "https://github.com/davejamesmiller/laravel-breadcrumbs.git", - "reference": "460bf79e83ff9e3db1e3f1c40169d8893893f8ff" + "url": "https://github.com/firefly-iii/laravel-breadcrumbs.git", + "reference": "afebafc321432188b10dafc7b4c072501687f3d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/davejamesmiller/laravel-breadcrumbs/zipball/460bf79e83ff9e3db1e3f1c40169d8893893f8ff", - "reference": "460bf79e83ff9e3db1e3f1c40169d8893893f8ff", + "url": "https://api.github.com/repos/firefly-iii/laravel-breadcrumbs/zipball/afebafc321432188b10dafc7b4c072501687f3d0", + "reference": "afebafc321432188b10dafc7b4c072501687f3d0", "shasum": "" }, "require": { @@ -133,7 +133,6 @@ "DaveJamesMiller\\Breadcrumbs\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT License" ], @@ -141,15 +140,18 @@ { "name": "Dave James Miller", "email": "dave@davejamesmiller.com", - "homepage": "http://davejamesmiller.com/" + "homepage": "https://davejamesmiller.com/" } ], "description": "A simple Laravel-style way to create breadcrumbs in Laravel 4+.", - "homepage": "http://laravel-breadcrumbs.davejamesmiller.com", + "homepage": "https://laravel-breadcrumbs.readthedocs.io/", "keywords": [ "laravel" ], - "time": "2016-08-28T16:57:03+00:00" + "support": { + "source": "https://github.com/firefly-iii/laravel-breadcrumbs/tree/3.1" + }, + "time": "2017-01-30T07:52:50+00:00" }, { "name": "doctrine/annotations", From 4cad2eb0c4bde7c6ff24ced0393e8631f6ce0ea3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:35:41 +0100 Subject: [PATCH 07/30] Upgraded validator --- app/Validation/FireflyValidator.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 61590816b4..f38a164993 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -27,9 +27,9 @@ use FireflyIII\Rules\Triggers\TriggerInterface; use FireflyIII\User; use Google2FA; use Illuminate\Contracts\Encryption\DecryptException; +use Illuminate\Contracts\Translation\Translator; use Illuminate\Validation\Validator; use Session; -use Symfony\Component\Translation\TranslatorInterface; /** * Class FireflyValidator @@ -40,14 +40,14 @@ class FireflyValidator extends Validator { /** - * @param TranslatorInterface $translator - * @param array $data - * @param array $rules - * @param array $messages - * @param array $customAttributes + * @param Translator $translator + * @param array $data + * @param array $rules + * @param array $messages + * @param array $customAttributes * */ - public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = []) + public function __construct(Translator $translator, array $data, array $rules, array $messages = [], array $customAttributes = []) { parent::__construct($translator, $data, $rules, $messages, $customAttributes); } @@ -158,6 +158,7 @@ class FireflyValidator extends Validator public function validateMore($attribute, $value, $parameters): bool { $compare = $parameters[0] ?? '0'; + return bccomp($value, $compare) > 0; } From 84e380e4d06f8056f09cc549dcbff125d5565153 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:40:49 +0100 Subject: [PATCH 08/30] Give all repositories a new setUser function. --- app/Repositories/Account/AccountRepositoryInterface.php | 6 ++++++ app/Repositories/Account/AccountTaskerInterface.php | 5 +++++ .../Attachment/AttachmentRepositoryInterface.php | 6 ++++++ app/Repositories/Bill/BillRepositoryInterface.php | 5 +++++ app/Repositories/Budget/BudgetRepositoryInterface.php | 5 +++++ app/Repositories/Category/CategoryRepositoryInterface.php | 6 ++++++ app/Repositories/Currency/CurrencyRepositoryInterface.php | 6 ++++++ app/Repositories/ExportJob/ExportJobRepositoryInterface.php | 6 ++++++ app/Repositories/ImportJob/ImportJobRepositoryInterface.php | 6 ++++++ app/Repositories/Journal/JournalRepositoryInterface.php | 6 +++++- app/Repositories/Journal/JournalTaskerInterface.php | 5 +++++ app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php | 5 +++++ app/Repositories/Rule/RuleRepositoryInterface.php | 6 +++++- app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php | 6 +++++- app/Repositories/Tag/TagRepositoryInterface.php | 6 ++++++ app/Repositories/User/UserRepositoryInterface.php | 1 + 16 files changed, 83 insertions(+), 3 deletions(-) diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index 428e48144d..d19ba94d52 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -16,6 +16,7 @@ namespace FireflyIII\Repositories\Account; use Carbon\Carbon; use FireflyIII\Models\Account; use FireflyIII\Models\TransactionJournal; +use FireflyIII\User; use Illuminate\Support\Collection; /** @@ -26,6 +27,11 @@ use Illuminate\Support\Collection; interface AccountRepositoryInterface { + /** + * @param User $user + */ + public function setUser(User $user); + /** * Moved here from account CRUD. * diff --git a/app/Repositories/Account/AccountTaskerInterface.php b/app/Repositories/Account/AccountTaskerInterface.php index 57fbebaa79..81ef432b9e 100644 --- a/app/Repositories/Account/AccountTaskerInterface.php +++ b/app/Repositories/Account/AccountTaskerInterface.php @@ -14,6 +14,7 @@ declare(strict_types = 1); namespace FireflyIII\Repositories\Account; use Carbon\Carbon; +use FireflyIII\User; use Illuminate\Support\Collection; /** @@ -23,6 +24,10 @@ use Illuminate\Support\Collection; */ interface AccountTaskerInterface { + /** + * @param User $user + */ + public function setUser(User $user); /** * @param Collection $accounts diff --git a/app/Repositories/Attachment/AttachmentRepositoryInterface.php b/app/Repositories/Attachment/AttachmentRepositoryInterface.php index 9e12092c70..25dc72ff38 100644 --- a/app/Repositories/Attachment/AttachmentRepositoryInterface.php +++ b/app/Repositories/Attachment/AttachmentRepositoryInterface.php @@ -15,6 +15,7 @@ namespace FireflyIII\Repositories\Attachment; use Carbon\Carbon; use FireflyIII\Models\Attachment; +use FireflyIII\User; use Illuminate\Support\Collection; /** @@ -25,6 +26,11 @@ use Illuminate\Support\Collection; interface AttachmentRepositoryInterface { + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param Attachment $attachment * diff --git a/app/Repositories/Bill/BillRepositoryInterface.php b/app/Repositories/Bill/BillRepositoryInterface.php index c2c6cd223d..af6dd36dab 100644 --- a/app/Repositories/Bill/BillRepositoryInterface.php +++ b/app/Repositories/Bill/BillRepositoryInterface.php @@ -16,6 +16,7 @@ namespace FireflyIII\Repositories\Bill; use Carbon\Carbon; use FireflyIII\Models\Bill; use FireflyIII\Models\TransactionJournal; +use FireflyIII\User; use Illuminate\Support\Collection; /** @@ -25,6 +26,10 @@ use Illuminate\Support\Collection; */ interface BillRepositoryInterface { + /** + * @param User $user + */ + public function setUser(User $user); /** * @param Bill $bill diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index ee9eba1641..3eefa19b01 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -17,6 +17,7 @@ use Carbon\Carbon; use FireflyIII\Models\Budget; use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\TransactionCurrency; +use FireflyIII\User; use Illuminate\Support\Collection; /** @@ -26,6 +27,10 @@ use Illuminate\Support\Collection; */ interface BudgetRepositoryInterface { + /** + * @param User $user + */ + public function setUser(User $user); /** * @return bool diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php index 1194fbbf74..80b42d6852 100644 --- a/app/Repositories/Category/CategoryRepositoryInterface.php +++ b/app/Repositories/Category/CategoryRepositoryInterface.php @@ -15,6 +15,7 @@ namespace FireflyIII\Repositories\Category; use Carbon\Carbon; use FireflyIII\Models\Category; +use FireflyIII\User; use Illuminate\Support\Collection; /** @@ -24,6 +25,11 @@ use Illuminate\Support\Collection; */ interface CategoryRepositoryInterface { + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param Category $category * diff --git a/app/Repositories/Currency/CurrencyRepositoryInterface.php b/app/Repositories/Currency/CurrencyRepositoryInterface.php index 4ccebe40b0..9c63c1fbfc 100644 --- a/app/Repositories/Currency/CurrencyRepositoryInterface.php +++ b/app/Repositories/Currency/CurrencyRepositoryInterface.php @@ -16,6 +16,7 @@ namespace FireflyIII\Repositories\Currency; use FireflyIII\Models\Preference; use FireflyIII\Models\TransactionCurrency; +use FireflyIII\User; use Illuminate\Support\Collection; /** @@ -25,6 +26,11 @@ use Illuminate\Support\Collection; */ interface CurrencyRepositoryInterface { + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param TransactionCurrency $currency * diff --git a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php index 6f3c7a30b1..484e8496b5 100644 --- a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php +++ b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php @@ -14,6 +14,7 @@ declare(strict_types = 1); namespace FireflyIII\Repositories\ExportJob; use FireflyIII\Models\ExportJob; +use FireflyIII\User; /** * Interface ExportJobRepositoryInterface @@ -22,6 +23,11 @@ use FireflyIII\Models\ExportJob; */ interface ExportJobRepositoryInterface { + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param ExportJob $job * @param string $status diff --git a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php index a17d9ca62c..b58468f1af 100644 --- a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php +++ b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php @@ -14,6 +14,7 @@ declare(strict_types = 1); namespace FireflyIII\Repositories\ImportJob; use FireflyIII\Models\ImportJob; +use FireflyIII\User; /** * Interface ImportJobRepositoryInterface @@ -22,6 +23,11 @@ use FireflyIII\Models\ImportJob; */ interface ImportJobRepositoryInterface { + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param string $fileType * diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php index 0b62a5729a..446d21c184 100644 --- a/app/Repositories/Journal/JournalRepositoryInterface.php +++ b/app/Repositories/Journal/JournalRepositoryInterface.php @@ -16,6 +16,7 @@ namespace FireflyIII\Repositories\Journal; use FireflyIII\Models\Account; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; +use FireflyIII\User; use Illuminate\Support\Collection; use Illuminate\Support\MessageBag; @@ -26,7 +27,10 @@ use Illuminate\Support\MessageBag; */ interface JournalRepositoryInterface { - + /** + * @param User $user + */ + public function setUser(User $user); /** * @param TransactionJournal $journal * @param TransactionType $type diff --git a/app/Repositories/Journal/JournalTaskerInterface.php b/app/Repositories/Journal/JournalTaskerInterface.php index 058bc63733..e5c007c1e7 100644 --- a/app/Repositories/Journal/JournalTaskerInterface.php +++ b/app/Repositories/Journal/JournalTaskerInterface.php @@ -15,6 +15,7 @@ namespace FireflyIII\Repositories\Journal; use FireflyIII\Models\TransactionJournal; +use FireflyIII\User; use Illuminate\Support\Collection; /** @@ -24,6 +25,10 @@ use Illuminate\Support\Collection; */ interface JournalTaskerInterface { + /** + * @param User $user + */ + public function setUser(User $user); /** * @param TransactionJournal $journal diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php index aae01702d7..a2da326d86 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php +++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php @@ -15,6 +15,7 @@ namespace FireflyIII\Repositories\PiggyBank; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBankEvent; +use FireflyIII\User; use Illuminate\Support\Collection; /** @@ -98,6 +99,10 @@ interface PiggyBankRepositoryInterface */ public function setOrder(int $piggyBankId, int $order): bool; + /** + * @param User $user + */ + public function setUser(User $user); /** * Store new piggy bank. diff --git a/app/Repositories/Rule/RuleRepositoryInterface.php b/app/Repositories/Rule/RuleRepositoryInterface.php index 518417d94a..887bb20d79 100644 --- a/app/Repositories/Rule/RuleRepositoryInterface.php +++ b/app/Repositories/Rule/RuleRepositoryInterface.php @@ -17,6 +17,7 @@ use FireflyIII\Models\Rule; use FireflyIII\Models\RuleAction; use FireflyIII\Models\RuleGroup; use FireflyIII\Models\RuleTrigger; +use FireflyIII\User; /** * Interface RuleRepositoryInterface @@ -25,7 +26,10 @@ use FireflyIII\Models\RuleTrigger; */ interface RuleRepositoryInterface { - + /** + * @param User $user + */ + public function setUser(User $user); /** * @return int */ diff --git a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php index 985a121b92..c365fca704 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php +++ b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php @@ -26,7 +26,6 @@ use Illuminate\Support\Collection; interface RuleGroupRepositoryInterface { - /** * * @@ -92,6 +91,11 @@ interface RuleGroupRepositoryInterface */ public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool; + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param array $data * diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php index 64bf47c44e..c813a238da 100644 --- a/app/Repositories/Tag/TagRepositoryInterface.php +++ b/app/Repositories/Tag/TagRepositoryInterface.php @@ -16,6 +16,7 @@ namespace FireflyIII\Repositories\Tag; use Carbon\Carbon; use FireflyIII\Models\Tag; use FireflyIII\Models\TransactionJournal; +use FireflyIII\User; use Illuminate\Support\Collection; @@ -26,6 +27,11 @@ use Illuminate\Support\Collection; */ interface TagRepositoryInterface { + /** + * @param User $user + */ + public function setUser(User $user); + /** * This method will connect a journal with a tag. * diff --git a/app/Repositories/User/UserRepositoryInterface.php b/app/Repositories/User/UserRepositoryInterface.php index 93e34a7a14..9e2bb096b3 100644 --- a/app/Repositories/User/UserRepositoryInterface.php +++ b/app/Repositories/User/UserRepositoryInterface.php @@ -24,6 +24,7 @@ use Illuminate\Support\Collection; */ interface UserRepositoryInterface { + /** * Returns a collection of all users. * From 311c1a3c844f2d3ea9bb06d0c74a217fbd015f54 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:42:58 +0100 Subject: [PATCH 09/30] Implement all setUser methods. --- app/Repositories/Account/AccountRepository.php | 8 ++++++++ .../Account/AccountRepositoryInterface.php | 10 +++++----- app/Repositories/Account/AccountTasker.php | 12 ++++++++++-- app/Repositories/Account/AccountTaskerInterface.php | 10 +++++----- app/Repositories/Attachment/AttachmentRepository.php | 8 +++++++- app/Repositories/Bill/BillRepository.php | 8 +++++++- app/Repositories/Budget/BudgetRepository.php | 8 +++++++- app/Repositories/Category/CategoryRepository.php | 8 +++++++- app/Repositories/Currency/CurrencyRepository.php | 8 +++++++- app/Repositories/ExportJob/ExportJobRepository.php | 8 +++++++- app/Repositories/ImportJob/ImportJobRepository.php | 8 +++++++- app/Repositories/Journal/JournalRepository.php | 8 +++++++- app/Repositories/Journal/JournalTasker.php | 8 ++++++++ app/Repositories/PiggyBank/PiggyBankRepository.php | 8 +++++++- app/Repositories/Rule/RuleRepository.php | 8 +++++++- app/Repositories/RuleGroup/RuleGroupRepository.php | 8 +++++++- app/Repositories/Tag/TagRepository.php | 8 +++++++- 17 files changed, 120 insertions(+), 24 deletions(-) diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index d740291f68..631157d62c 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -323,6 +323,14 @@ class AccountRepository implements AccountRepositoryInterface return $journal->date; } + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } + /** * @param array $data * diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index d19ba94d52..b0ab9b738b 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -27,11 +27,6 @@ use Illuminate\Support\Collection; interface AccountRepositoryInterface { - /** - * @param User $user - */ - public function setUser(User $user); - /** * Moved here from account CRUD. * @@ -130,6 +125,11 @@ interface AccountRepositoryInterface */ public function oldestJournalDate(Account $account): Carbon; + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param array $data * diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php index 126d084e8d..874ceb7a30 100644 --- a/app/Repositories/Account/AccountTasker.php +++ b/app/Repositories/Account/AccountTasker.php @@ -108,8 +108,8 @@ class AccountTasker implements AccountTaskerInterface */ public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array { - $ids = $accounts->pluck('id')->toArray(); - $yesterday = clone $start; + $ids = $accounts->pluck('id')->toArray(); + $yesterday = clone $start; $yesterday->subDay(); $startSet = Steam::balancesById($ids, $yesterday); $endSet = Steam::balancesById($ids, $end); @@ -155,6 +155,14 @@ class AccountTasker implements AccountTaskerInterface return $return; } + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } + /** * Will return how much money has been going out (ie. spent) by the given account(s). * Alternatively, will return how much money has been coming in (ie. earned) by the given accounts. diff --git a/app/Repositories/Account/AccountTaskerInterface.php b/app/Repositories/Account/AccountTaskerInterface.php index 81ef432b9e..4ea5be74ef 100644 --- a/app/Repositories/Account/AccountTaskerInterface.php +++ b/app/Repositories/Account/AccountTaskerInterface.php @@ -24,11 +24,6 @@ use Illuminate\Support\Collection; */ interface AccountTaskerInterface { - /** - * @param User $user - */ - public function setUser(User $user); - /** * @param Collection $accounts * @param Collection $excluded @@ -62,4 +57,9 @@ interface AccountTaskerInterface */ public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array; + /** + * @param User $user + */ + public function setUser(User $user); + } diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php index 1bc9401624..4ee2b458c6 100644 --- a/app/Repositories/Attachment/AttachmentRepository.php +++ b/app/Repositories/Attachment/AttachmentRepository.php @@ -30,7 +30,13 @@ class AttachmentRepository implements AttachmentRepositoryInterface { /** @var User */ private $user; - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * AttachmentRepository constructor. * diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index d3bfa01572..4955145877 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -36,7 +36,13 @@ class BillRepository implements BillRepositoryInterface /** @var User */ private $user; - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * BillRepository constructor. * diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 7c8d2f6391..8d6cde13a8 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -47,7 +47,13 @@ class BudgetRepository implements BudgetRepositoryInterface { $this->user = $user; } - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * @return bool */ diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 32c2eb2135..7d88329dbe 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -43,7 +43,13 @@ class CategoryRepository implements CategoryRepositoryInterface { $this->user = $user; } - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * @param Category $category * diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index d2eaed1c30..d299bbf4f2 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -39,7 +39,13 @@ class CurrencyRepository implements CurrencyRepositoryInterface { $this->user = $user; } - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * @param TransactionCurrency $currency * diff --git a/app/Repositories/ExportJob/ExportJobRepository.php b/app/Repositories/ExportJob/ExportJobRepository.php index b83818284a..afbdab9248 100644 --- a/app/Repositories/ExportJob/ExportJobRepository.php +++ b/app/Repositories/ExportJob/ExportJobRepository.php @@ -38,7 +38,13 @@ class ExportJobRepository implements ExportJobRepositoryInterface { $this->user = $user; } - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * @param ExportJob $job * @param string $status diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.php index d7f4ac30cf..88d54f4a81 100644 --- a/app/Repositories/ImportJob/ImportJobRepository.php +++ b/app/Repositories/ImportJob/ImportJobRepository.php @@ -37,7 +37,13 @@ class ImportJobRepository implements ImportJobRepositoryInterface { $this->user = $user; } - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * @param string $fileType * diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index 9ee336cddf..aa28551d4c 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -52,7 +52,13 @@ class JournalRepository implements JournalRepositoryInterface { $this->user = $user; } - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * @param TransactionJournal $journal * @param TransactionType $type diff --git a/app/Repositories/Journal/JournalTasker.php b/app/Repositories/Journal/JournalTasker.php index eb77c77e6f..5f9f610ca1 100644 --- a/app/Repositories/Journal/JournalTasker.php +++ b/app/Repositories/Journal/JournalTasker.php @@ -152,6 +152,14 @@ class JournalTasker implements JournalTaskerInterface return $transactions; } + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } + /** * Collect the balance of an account before the given transaction has hit. This is tricky, because * the balance does not depend on the transaction itself but the journal it's part of. And of course diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index 5a9f07704c..fad4b0f4fa 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -41,7 +41,13 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface { $this->user = $user; } - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * @param PiggyBank $piggyBank * @param string $amount diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index 4b7ce00433..05849acd5d 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -39,7 +39,13 @@ class RuleRepository implements RuleRepositoryInterface { $this->user = $user; } - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * @return int */ diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php index b294e19937..7a6afa6f0e 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepository.php +++ b/app/Repositories/RuleGroup/RuleGroupRepository.php @@ -39,7 +39,13 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface { $this->user = $user; } - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * @return int */ diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 8145be1151..a344da412a 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -43,7 +43,13 @@ class TagRepository implements TagRepositoryInterface { $this->user = $user; } - + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } /** * * @param TransactionJournal $journal From 1e947870a613dfc2903eebbbcca94c04a51a40a0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:46:30 +0100 Subject: [PATCH 10/30] Remove all constructors. --- .../Account/AccountRepository.php | 10 ------- app/Repositories/Account/AccountTasker.php | 10 ------- .../Attachment/AttachmentRepository.php | 26 +++++++------------ .../AttachmentRepositoryInterface.php | 10 +++---- app/Repositories/Bill/BillRepository.php | 24 ++++++----------- .../Bill/BillRepositoryInterface.php | 10 +++---- app/Repositories/Budget/BudgetRepository.php | 24 ++++++----------- .../Budget/BudgetRepositoryInterface.php | 10 +++---- .../Category/CategoryRepository.php | 24 ++++++----------- .../Category/CategoryRepositoryInterface.php | 10 +++---- .../Currency/CurrencyRepository.php | 10 +------ .../Currency/CurrencyRepositoryInterface.php | 10 +++---- .../ExportJob/ExportJobRepository.php | 24 ++++++----------- .../ExportJobRepositoryInterface.php | 10 +++---- .../ImportJob/ImportJobRepository.php | 24 ++++++----------- .../ImportJobRepositoryInterface.php | 10 +++---- .../Journal/JournalRepository.php | 10 +------ .../Journal/JournalRepositoryInterface.php | 18 ++++++------- app/Repositories/Journal/JournalTasker.php | 9 ------- .../Journal/JournalTaskerInterface.php | 10 +++---- .../PiggyBank/PiggyBankRepository.php | 24 ++++++----------- app/Repositories/Rule/RuleRepository.php | 24 ++++++----------- .../Rule/RuleRepositoryInterface.php | 9 ++++--- .../RuleGroup/RuleGroupRepository.php | 10 +------ app/Repositories/Tag/TagRepository.php | 10 +------ .../Tag/TagRepositoryInterface.php | 10 +++---- 26 files changed, 128 insertions(+), 252 deletions(-) diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 631157d62c..26ba26b6ea 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -43,16 +43,6 @@ class AccountRepository implements AccountRepositoryInterface /** @var array */ private $validFields = ['accountRole', 'ccMonthlyPaymentDate', 'ccType', 'accountNumber', 'currency_id', 'BIC']; - /** - * AttachmentRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } - /** * Moved here from account CRUD * diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php index 874ceb7a30..d43902e094 100644 --- a/app/Repositories/Account/AccountTasker.php +++ b/app/Repositories/Account/AccountTasker.php @@ -31,16 +31,6 @@ class AccountTasker implements AccountTaskerInterface /** @var User */ private $user; - /** - * AttachmentRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } - /** * @see self::amountInPeriod * diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php index 4ee2b458c6..79a481e4ab 100644 --- a/app/Repositories/Attachment/AttachmentRepository.php +++ b/app/Repositories/Attachment/AttachmentRepository.php @@ -14,12 +14,12 @@ declare(strict_types = 1); namespace FireflyIII\Repositories\Attachment; use Carbon\Carbon; +use Crypt; use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; use FireflyIII\Models\Attachment; use FireflyIII\User; use Illuminate\Support\Collection; use Storage; -use Crypt; /** * Class AttachmentRepository @@ -30,22 +30,6 @@ class AttachmentRepository implements AttachmentRepositoryInterface { /** @var User */ private $user; - /** - * @param User $user - */ - public function setUser(User $user) - { - $this->user = $user; - } - /** - * AttachmentRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } /** * @param Attachment $attachment @@ -123,6 +107,14 @@ class AttachmentRepository implements AttachmentRepositoryInterface return ''; } + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } + /** * @param Attachment $attachment * @param array $data diff --git a/app/Repositories/Attachment/AttachmentRepositoryInterface.php b/app/Repositories/Attachment/AttachmentRepositoryInterface.php index 25dc72ff38..cc7cb887f8 100644 --- a/app/Repositories/Attachment/AttachmentRepositoryInterface.php +++ b/app/Repositories/Attachment/AttachmentRepositoryInterface.php @@ -26,11 +26,6 @@ use Illuminate\Support\Collection; interface AttachmentRepositoryInterface { - /** - * @param User $user - */ - public function setUser(User $user); - /** * @param Attachment $attachment * @@ -65,6 +60,11 @@ interface AttachmentRepositoryInterface */ public function getContent(Attachment $attachment): string; + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param Attachment $attachment * @param array $attachmentData diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 4955145877..545a29fb96 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -36,22 +36,6 @@ class BillRepository implements BillRepositoryInterface /** @var User */ private $user; - /** - * @param User $user - */ - public function setUser(User $user) - { - $this->user = $user; - } - /** - * BillRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } /** * @param Bill $bill @@ -526,6 +510,14 @@ class BillRepository implements BillRepositoryInterface } + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } + /** * @param array $data * diff --git a/app/Repositories/Bill/BillRepositoryInterface.php b/app/Repositories/Bill/BillRepositoryInterface.php index af6dd36dab..2e07d12d93 100644 --- a/app/Repositories/Bill/BillRepositoryInterface.php +++ b/app/Repositories/Bill/BillRepositoryInterface.php @@ -26,11 +26,6 @@ use Illuminate\Support\Collection; */ interface BillRepositoryInterface { - /** - * @param User $user - */ - public function setUser(User $user); - /** * @param Bill $bill * @@ -164,6 +159,11 @@ interface BillRepositoryInterface */ public function scan(Bill $bill, TransactionJournal $journal): bool; + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param array $data * diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 8d6cde13a8..8f0588dc1a 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -38,22 +38,6 @@ class BudgetRepository implements BudgetRepositoryInterface /** @var User */ private $user; - /** - * BudgetRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } - /** - * @param User $user - */ - public function setUser(User $user) - { - $this->user = $user; - } /** * @return bool */ @@ -439,6 +423,14 @@ class BudgetRepository implements BudgetRepositoryInterface return true; } + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } + /** * @param Collection $budgets * @param Collection $accounts diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index 3eefa19b01..906a4827ae 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -27,11 +27,6 @@ use Illuminate\Support\Collection; */ interface BudgetRepositoryInterface { - /** - * @param User $user - */ - public function setUser(User $user); - /** * @return bool */ @@ -154,6 +149,11 @@ interface BudgetRepositoryInterface */ public function setAvailableBudget(TransactionCurrency $currency, Carbon $start, Carbon $end, string $amount): bool; + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param Collection $budgets * @param Collection $accounts diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 7d88329dbe..fb366c0812 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -34,22 +34,6 @@ class CategoryRepository implements CategoryRepositoryInterface /** @var User */ private $user; - /** - * CategoryRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } - /** - * @param User $user - */ - public function setUser(User $user) - { - $this->user = $user; - } /** * @param Category $category * @@ -390,6 +374,14 @@ class CategoryRepository implements CategoryRepositoryInterface return $result; } + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } + /** * @param Collection $categories * @param Collection $accounts diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php index 80b42d6852..9e89a78f50 100644 --- a/app/Repositories/Category/CategoryRepositoryInterface.php +++ b/app/Repositories/Category/CategoryRepositoryInterface.php @@ -25,11 +25,6 @@ use Illuminate\Support\Collection; */ interface CategoryRepositoryInterface { - /** - * @param User $user - */ - public function setUser(User $user); - /** * @param Category $category * @@ -127,6 +122,11 @@ interface CategoryRepositoryInterface */ public function periodIncomeNoCategory(Collection $accounts, Carbon $start, Carbon $end): array; + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param Collection $categories * @param Collection $accounts diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index d299bbf4f2..bb1444d73c 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -30,15 +30,6 @@ class CurrencyRepository implements CurrencyRepositoryInterface /** @var User */ private $user; - /** - * CategoryRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } /** * @param User $user */ @@ -46,6 +37,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface { $this->user = $user; } + /** * @param TransactionCurrency $currency * diff --git a/app/Repositories/Currency/CurrencyRepositoryInterface.php b/app/Repositories/Currency/CurrencyRepositoryInterface.php index 9c63c1fbfc..63eb9bf0b5 100644 --- a/app/Repositories/Currency/CurrencyRepositoryInterface.php +++ b/app/Repositories/Currency/CurrencyRepositoryInterface.php @@ -26,11 +26,6 @@ use Illuminate\Support\Collection; */ interface CurrencyRepositoryInterface { - /** - * @param User $user - */ - public function setUser(User $user); - /** * @param TransactionCurrency $currency * @@ -100,6 +95,11 @@ interface CurrencyRepositoryInterface */ public function getCurrencyByPreference(Preference $preference): TransactionCurrency; + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param array $data * diff --git a/app/Repositories/ExportJob/ExportJobRepository.php b/app/Repositories/ExportJob/ExportJobRepository.php index afbdab9248..aa956f901e 100644 --- a/app/Repositories/ExportJob/ExportJobRepository.php +++ b/app/Repositories/ExportJob/ExportJobRepository.php @@ -29,22 +29,6 @@ class ExportJobRepository implements ExportJobRepositoryInterface /** @var User */ private $user; - /** - * ExportJobRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } - /** - * @param User $user - */ - public function setUser(User $user) - { - $this->user = $user; - } /** * @param ExportJob $job * @param string $status @@ -155,4 +139,12 @@ class ExportJobRepository implements ExportJobRepositoryInterface return $content; } + + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } } diff --git a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php index 484e8496b5..7e93663ea5 100644 --- a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php +++ b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php @@ -23,11 +23,6 @@ use FireflyIII\User; */ interface ExportJobRepositoryInterface { - /** - * @param User $user - */ - public function setUser(User $user); - /** * @param ExportJob $job * @param string $status @@ -67,4 +62,9 @@ interface ExportJobRepositoryInterface */ public function getContent(ExportJob $job): string; + /** + * @param User $user + */ + public function setUser(User $user); + } diff --git a/app/Repositories/ImportJob/ImportJobRepository.php b/app/Repositories/ImportJob/ImportJobRepository.php index 88d54f4a81..0eec759e5b 100644 --- a/app/Repositories/ImportJob/ImportJobRepository.php +++ b/app/Repositories/ImportJob/ImportJobRepository.php @@ -28,22 +28,6 @@ class ImportJobRepository implements ImportJobRepositoryInterface /** @var User */ private $user; - /** - * ExportJobRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } - /** - * @param User $user - */ - public function setUser(User $user) - { - $this->user = $user; - } /** * @param string $fileType * @@ -101,4 +85,12 @@ class ImportJobRepository implements ImportJobRepositoryInterface return $result; } + + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } } diff --git a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php index b58468f1af..5bb2149fbe 100644 --- a/app/Repositories/ImportJob/ImportJobRepositoryInterface.php +++ b/app/Repositories/ImportJob/ImportJobRepositoryInterface.php @@ -23,11 +23,6 @@ use FireflyIII\User; */ interface ImportJobRepositoryInterface { - /** - * @param User $user - */ - public function setUser(User $user); - /** * @param string $fileType * @@ -41,4 +36,9 @@ interface ImportJobRepositoryInterface * @return ImportJob */ public function findByKey(string $key): ImportJob; + + /** + * @param User $user + */ + public function setUser(User $user); } diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index aa28551d4c..12ce898ff1 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -43,15 +43,6 @@ class JournalRepository implements JournalRepositoryInterface /** @var array */ private $validMetaFields = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date', 'internal_reference', 'notes']; - /** - * JournalRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } /** * @param User $user */ @@ -59,6 +50,7 @@ class JournalRepository implements JournalRepositoryInterface { $this->user = $user; } + /** * @param TransactionJournal $journal * @param TransactionType $type diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php index 446d21c184..f1f5438ad4 100644 --- a/app/Repositories/Journal/JournalRepositoryInterface.php +++ b/app/Repositories/Journal/JournalRepositoryInterface.php @@ -27,10 +27,6 @@ use Illuminate\Support\MessageBag; */ interface JournalRepositoryInterface { - /** - * @param User $user - */ - public function setUser(User $user); /** * @param TransactionJournal $journal * @param TransactionType $type @@ -41,11 +37,6 @@ interface JournalRepositoryInterface */ public function convert(TransactionJournal $journal, TransactionType $type, Account $source, Account $destination): MessageBag; - /** - * @return Collection - */ - public function getTransactionTypes(): Collection; - /** * Deletes a journal. * @@ -71,6 +62,15 @@ interface JournalRepositoryInterface */ public function first(): TransactionJournal; + /** + * @return Collection + */ + public function getTransactionTypes(): Collection; + + /** + * @param User $user + */ + public function setUser(User $user); /** * @param array $data diff --git a/app/Repositories/Journal/JournalTasker.php b/app/Repositories/Journal/JournalTasker.php index 5f9f610ca1..c0424242c8 100644 --- a/app/Repositories/Journal/JournalTasker.php +++ b/app/Repositories/Journal/JournalTasker.php @@ -35,15 +35,6 @@ class JournalTasker implements JournalTaskerInterface /** @var User */ private $user; - /** - * JournalRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } /** * @param TransactionJournal $journal diff --git a/app/Repositories/Journal/JournalTaskerInterface.php b/app/Repositories/Journal/JournalTaskerInterface.php index e5c007c1e7..1273f69c3a 100644 --- a/app/Repositories/Journal/JournalTaskerInterface.php +++ b/app/Repositories/Journal/JournalTaskerInterface.php @@ -25,11 +25,6 @@ use Illuminate\Support\Collection; */ interface JournalTaskerInterface { - /** - * @param User $user - */ - public function setUser(User $user); - /** * @param TransactionJournal $journal * @@ -46,4 +41,9 @@ interface JournalTaskerInterface * @return array */ public function getTransactionsOverview(TransactionJournal $journal): array; + + /** + * @param User $user + */ + public function setUser(User $user); } diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index fad4b0f4fa..1f14467a5b 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -32,22 +32,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface /** @var User */ private $user; - /** - * PiggyBankRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } - /** - * @param User $user - */ - public function setUser(User $user) - { - $this->user = $user; - } /** * @param PiggyBank $piggyBank * @param string $amount @@ -173,6 +157,14 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface return true; } + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } + /** * @param array $data * diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index 05849acd5d..7e0487be63 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -30,22 +30,6 @@ class RuleRepository implements RuleRepositoryInterface /** @var User */ private $user; - /** - * BillRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } - /** - * @param User $user - */ - public function setUser(User $user) - { - $this->user = $user; - } /** * @return int */ @@ -224,6 +208,14 @@ class RuleRepository implements RuleRepositoryInterface } + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } + /** * @param array $data * diff --git a/app/Repositories/Rule/RuleRepositoryInterface.php b/app/Repositories/Rule/RuleRepositoryInterface.php index 887bb20d79..6ca1456214 100644 --- a/app/Repositories/Rule/RuleRepositoryInterface.php +++ b/app/Repositories/Rule/RuleRepositoryInterface.php @@ -26,10 +26,6 @@ use FireflyIII\User; */ interface RuleRepositoryInterface { - /** - * @param User $user - */ - public function setUser(User $user); /** * @return int */ @@ -98,6 +94,11 @@ interface RuleRepositoryInterface */ public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool; + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param array $data * diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php index 7a6afa6f0e..e413987334 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepository.php +++ b/app/Repositories/RuleGroup/RuleGroupRepository.php @@ -30,15 +30,6 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface /** @var User */ private $user; - /** - * BillRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } /** * @param User $user */ @@ -46,6 +37,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface { $this->user = $user; } + /** * @return int */ diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index a344da412a..1b0950467f 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -34,15 +34,6 @@ class TagRepository implements TagRepositoryInterface /** @var User */ private $user; - /** - * TagRepository constructor. - * - * @param User $user - */ - public function __construct(User $user) - { - $this->user = $user; - } /** * @param User $user */ @@ -50,6 +41,7 @@ class TagRepository implements TagRepositoryInterface { $this->user = $user; } + /** * * @param TransactionJournal $journal diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php index c813a238da..b360e7d436 100644 --- a/app/Repositories/Tag/TagRepositoryInterface.php +++ b/app/Repositories/Tag/TagRepositoryInterface.php @@ -27,11 +27,6 @@ use Illuminate\Support\Collection; */ interface TagRepositoryInterface { - /** - * @param User $user - */ - public function setUser(User $user); - /** * This method will connect a journal with a tag. * @@ -95,6 +90,11 @@ interface TagRepositoryInterface */ public function lastUseDate(Tag $tag): Carbon; + /** + * @param User $user + */ + public function setUser(User $user); + /** * @param Tag $tag * @param Carbon $start From c7341c9194def617df53f35aca61c6d1fbd1512c Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:57:00 +0100 Subject: [PATCH 11/30] Also extend collector. --- app/Helpers/Collector/JournalCollector.php | 15 ++++++++++----- .../Collector/JournalCollectorInterface.php | 4 +++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/Helpers/Collector/JournalCollector.php b/app/Helpers/Collector/JournalCollector.php index c198da7764..f706508183 100644 --- a/app/Helpers/Collector/JournalCollector.php +++ b/app/Helpers/Collector/JournalCollector.php @@ -98,12 +98,9 @@ class JournalCollector implements JournalCollectorInterface /** * JournalCollector constructor. - * - * @param User $user */ - public function __construct(User $user) + public function __construct() { - $this->user = $user; $this->query = $this->startQuery(); } @@ -168,7 +165,7 @@ class JournalCollector implements JournalCollectorInterface { $this->run = true; /** @var Collection $set */ - $set = $this->query->get(array_values($this->fields)); + $set = $this->query->get(array_values($this->fields)); Log::debug(sprintf('Count of set is %d', $set->count())); $set = $this->filterTransfers($set); Log::debug(sprintf('Count of set after filterTransfers() is %d', $set->count())); @@ -456,6 +453,14 @@ class JournalCollector implements JournalCollectorInterface return $this; } + /** + * @param User $user + */ + public function setUser(User $user) + { + $this->user = $user; + } + /** * @return JournalCollectorInterface */ diff --git a/app/Helpers/Collector/JournalCollectorInterface.php b/app/Helpers/Collector/JournalCollectorInterface.php index b3307ebac0..5b19faeaa3 100644 --- a/app/Helpers/Collector/JournalCollectorInterface.php +++ b/app/Helpers/Collector/JournalCollectorInterface.php @@ -17,6 +17,7 @@ use Carbon\Carbon; use FireflyIII\Models\Budget; use FireflyIII\Models\Category; use FireflyIII\Models\Tag; +use FireflyIII\User; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; @@ -84,7 +85,6 @@ interface JournalCollectorInterface */ public function setBudget(Budget $budget): JournalCollectorInterface; - /** * @param Collection $budgets * @@ -149,6 +149,8 @@ interface JournalCollectorInterface */ public function setTypes(array $types): JournalCollectorInterface; + public function setUser(User $user); + /** * @return JournalCollectorInterface */ From 01468c2663cdf3ebb7d5c77bb5dca4036d22389d Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:58:10 +0100 Subject: [PATCH 12/30] Rewrote journal service provider --- app/Providers/JournalServiceProvider.php | 55 +++++++++++++----------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/app/Providers/JournalServiceProvider.php b/app/Providers/JournalServiceProvider.php index 2ac7f61f64..6f22587325 100644 --- a/app/Providers/JournalServiceProvider.php +++ b/app/Providers/JournalServiceProvider.php @@ -14,7 +14,12 @@ declare(strict_types = 1); namespace FireflyIII\Providers; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Helpers\Collector\JournalCollector; +use FireflyIII\Helpers\Collector\JournalCollectorInterface; +use FireflyIII\Repositories\Journal\JournalRepository; +use FireflyIII\Repositories\Journal\JournalRepositoryInterface; +use FireflyIII\Repositories\Journal\JournalTasker; +use FireflyIII\Repositories\Journal\JournalTaskerInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; @@ -50,16 +55,16 @@ class JournalServiceProvider extends ServiceProvider private function registerCollector() { $this->app->bind( - 'FireflyIII\Helpers\Collector\JournalCollectorInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Helpers\Collector\JournalCollector', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + JournalCollectorInterface::class, + function (Application $app) { + /** @var JournalCollectorInterface $collector */ + $collector = app(JournalCollector::class); + + if ($app->auth->check()) { + $collector->setUser(auth()->user()); } - return app('FireflyIII\Helpers\Collector\JournalCollector', $arguments); + return $collector; } ); } @@ -67,16 +72,16 @@ class JournalServiceProvider extends ServiceProvider private function registerRepository() { $this->app->bind( - 'FireflyIII\Repositories\Journal\JournalRepositoryInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\Journal\JournalRepository', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + JournalRepositoryInterface::class, + function (Application $app) { + /** @var JournalRepositoryInterface $repository */ + $repository = app(JournalRepository::class); + if ($app->auth->check()) { + + $repository->setUser(auth()->user()); } - return app('FireflyIII\Repositories\Journal\JournalRepository', $arguments); + return $repository; } ); } @@ -84,16 +89,16 @@ class JournalServiceProvider extends ServiceProvider private function registerTasker() { $this->app->bind( - 'FireflyIII\Repositories\Journal\JournalTaskerInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\Journal\JournalTasker', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + JournalTaskerInterface::class, + function (Application $app) { + /** @var JournalTaskerInterface $tasker */ + $tasker = app(JournalTasker::class); + + if ($app->auth->check()) { + $tasker->setUser(auth()->user()); } - return app('FireflyIII\Repositories\Journal\JournalTasker', $arguments); + return $tasker; } ); } From 355baa7fef65a8e52803dc393f2743aeaefa0242 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 16:59:55 +0100 Subject: [PATCH 13/30] Rewrote account service provider. --- app/Providers/AccountServiceProvider.php | 39 ++++++++++++------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/app/Providers/AccountServiceProvider.php b/app/Providers/AccountServiceProvider.php index 0ce5a90329..3035731adb 100644 --- a/app/Providers/AccountServiceProvider.php +++ b/app/Providers/AccountServiceProvider.php @@ -14,7 +14,10 @@ declare(strict_types = 1); namespace FireflyIII\Providers; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Repositories\Account\AccountRepository; +use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use FireflyIII\Repositories\Account\AccountTasker; +use FireflyIII\Repositories\Account\AccountTaskerInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; @@ -44,8 +47,6 @@ class AccountServiceProvider extends ServiceProvider { $this->registerRepository(); $this->registerTasker(); - - } /** @@ -54,16 +55,16 @@ class AccountServiceProvider extends ServiceProvider private function registerRepository() { $this->app->bind( - 'FireflyIII\Repositories\Account\AccountRepositoryInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\Account\AccountRepository', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + AccountRepositoryInterface::class, + function (Application $app) { + /** @var AccountRepositoryInterface $repository */ + $repository = app(AccountRepository::class); + + if ($app->auth->check()) { + $repository->setUser(auth()->user()); } - return app('FireflyIII\Repositories\Account\AccountRepository', $arguments); + return $repository; } ); } @@ -74,16 +75,16 @@ class AccountServiceProvider extends ServiceProvider private function registerTasker() { $this->app->bind( - 'FireflyIII\Repositories\Account\AccountTaskerInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\Account\AccountTasker', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + AccountTaskerInterface::class, + function (Application $app) { + /** @var AccountTaskerInterface $tasker */ + $tasker = app(AccountTasker::class); + + if ($app->auth->check()) { + $tasker->setUser(auth()->user()); } - return app('FireflyIII\Repositories\Account\AccountTasker', $arguments); + return $tasker; } ); } From 2c786e6a3831d3333d2130f5fadd302b379c7aae Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 17:09:44 +0100 Subject: [PATCH 14/30] Small fixes to collector because constructor is gone. --- app/Helpers/Collector/JournalCollector.php | 54 ++++++++----------- .../Collector/JournalCollectorInterface.php | 6 ++- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/app/Helpers/Collector/JournalCollector.php b/app/Helpers/Collector/JournalCollector.php index f706508183..7952ed2e2f 100644 --- a/app/Helpers/Collector/JournalCollector.php +++ b/app/Helpers/Collector/JournalCollector.php @@ -96,14 +96,6 @@ class JournalCollector implements JournalCollectorInterface /** @var User */ private $user; - /** - * JournalCollector constructor. - */ - public function __construct() - { - $this->query = $this->startQuery(); - } - /** * @return int * @throws FireflyException @@ -461,6 +453,29 @@ class JournalCollector implements JournalCollectorInterface $this->user = $user; } + /** + * + */ + public function startQuery() + { + /** @var EloquentBuilder $query */ + $query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') + ->leftJoin('transaction_currencies', 'transaction_currencies.id', 'transaction_journals.transaction_currency_id') + ->leftJoin('transaction_types', 'transaction_types.id', 'transaction_journals.transaction_type_id') + ->leftJoin('bills', 'bills.id', 'transaction_journals.bill_id') + ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') + ->leftJoin('account_types', 'accounts.account_type_id', 'account_types.id') + ->whereNull('transactions.deleted_at') + ->whereNull('transaction_journals.deleted_at') + ->where('transaction_journals.user_id', $this->user->id) + ->orderBy('transaction_journals.date', 'DESC') + ->orderBy('transaction_journals.order', 'ASC') + ->orderBy('transaction_journals.id', 'DESC'); + + $this->query = $query; + + } + /** * @return JournalCollectorInterface */ @@ -734,27 +749,4 @@ class JournalCollector implements JournalCollectorInterface $this->query->leftJoin('tag_transaction_journal', 'tag_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id'); } } - - /** - * @return EloquentBuilder - */ - private function startQuery(): EloquentBuilder - { - /** @var EloquentBuilder $query */ - $query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id') - ->leftJoin('transaction_currencies', 'transaction_currencies.id', 'transaction_journals.transaction_currency_id') - ->leftJoin('transaction_types', 'transaction_types.id', 'transaction_journals.transaction_type_id') - ->leftJoin('bills', 'bills.id', 'transaction_journals.bill_id') - ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') - ->leftJoin('account_types', 'accounts.account_type_id', 'account_types.id') - ->whereNull('transactions.deleted_at') - ->whereNull('transaction_journals.deleted_at') - ->where('transaction_journals.user_id', $this->user->id) - ->orderBy('transaction_journals.date', 'DESC') - ->orderBy('transaction_journals.order', 'ASC') - ->orderBy('transaction_journals.id', 'DESC'); - - return $query; - - } } diff --git a/app/Helpers/Collector/JournalCollectorInterface.php b/app/Helpers/Collector/JournalCollectorInterface.php index 5b19faeaa3..80e41eb781 100644 --- a/app/Helpers/Collector/JournalCollectorInterface.php +++ b/app/Helpers/Collector/JournalCollectorInterface.php @@ -28,7 +28,6 @@ use Illuminate\Support\Collection; */ interface JournalCollectorInterface { - /** * @return int */ @@ -151,6 +150,11 @@ interface JournalCollectorInterface public function setUser(User $user); + /** + * + */ + public function startQuery(); + /** * @return JournalCollectorInterface */ From 3aaf356054456c8d4fd7e82461f8295154ae4772 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 17:10:08 +0100 Subject: [PATCH 15/30] Rewrote bill service provider --- app/Providers/BillServiceProvider.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/Providers/BillServiceProvider.php b/app/Providers/BillServiceProvider.php index 7275348a8d..a07e8e37ff 100644 --- a/app/Providers/BillServiceProvider.php +++ b/app/Providers/BillServiceProvider.php @@ -14,7 +14,8 @@ declare(strict_types = 1); namespace FireflyIII\Providers; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Repositories\Bill\BillRepository; +use FireflyIII\Repositories\Bill\BillRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; @@ -43,16 +44,16 @@ class BillServiceProvider extends ServiceProvider public function register() { $this->app->bind( - 'FireflyIII\Repositories\Bill\BillRepositoryInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\Bill\BillRepository', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + BillRepositoryInterface::class, + function (Application $app) { + /** @var BillRepositoryInterface $repository */ + $repository = app(BillRepository::class); + + if ($app->auth->check()) { + $repository->setUser(auth()->user()); } - return app('FireflyIII\Repositories\Bill\BillRepository', $arguments); + return $repository; } ); } From ac54032f558da08a777771dc68cc1426ff2a0734 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 17:10:23 +0100 Subject: [PATCH 16/30] Need to call everything from collector to work. --- app/Providers/JournalServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Providers/JournalServiceProvider.php b/app/Providers/JournalServiceProvider.php index 6f22587325..b44c11b760 100644 --- a/app/Providers/JournalServiceProvider.php +++ b/app/Providers/JournalServiceProvider.php @@ -59,10 +59,10 @@ class JournalServiceProvider extends ServiceProvider function (Application $app) { /** @var JournalCollectorInterface $collector */ $collector = app(JournalCollector::class); - if ($app->auth->check()) { $collector->setUser(auth()->user()); } + $collector->startQuery(); return $collector; } From 646ed0d4dd309578e540ff92cb4bc71d0cf351d9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 17:19:51 +0100 Subject: [PATCH 17/30] Rewrote attachment, budget and category service providers. --- app/Providers/AttachmentServiceProvider.php | 18 +++++++++--------- app/Providers/BudgetServiceProvider.php | 18 +++++++++--------- app/Providers/CategoryServiceProvider.php | 18 +++++++++--------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/app/Providers/AttachmentServiceProvider.php b/app/Providers/AttachmentServiceProvider.php index 77debb7354..c9f3a9d48d 100644 --- a/app/Providers/AttachmentServiceProvider.php +++ b/app/Providers/AttachmentServiceProvider.php @@ -14,7 +14,8 @@ declare(strict_types = 1); namespace FireflyIII\Providers; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Repositories\Attachment\AttachmentRepository; +use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; @@ -43,16 +44,15 @@ class AttachmentServiceProvider extends ServiceProvider public function register() { $this->app->bind( - 'FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\Attachment\AttachmentRepository', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + AttachmentRepositoryInterface::class, + function (Application $app) { + /** @var AttachmentRepositoryInterface $repository */ + $repository = app(AttachmentRepository::class); + if ($app->auth->check()) { + $repository->setUser(auth()->user()); } - return app('FireflyIII\Repositories\Attachment\AttachmentRepository', $arguments); + return $repository; } ); } diff --git a/app/Providers/BudgetServiceProvider.php b/app/Providers/BudgetServiceProvider.php index 51408c5098..df87739ea6 100644 --- a/app/Providers/BudgetServiceProvider.php +++ b/app/Providers/BudgetServiceProvider.php @@ -14,7 +14,8 @@ declare(strict_types = 1); namespace FireflyIII\Providers; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Repositories\Budget\BudgetRepository; +use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; @@ -43,16 +44,15 @@ class BudgetServiceProvider extends ServiceProvider public function register() { $this->app->bind( - 'FireflyIII\Repositories\Budget\BudgetRepositoryInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\Budget\BudgetRepository', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + BudgetRepositoryInterface::class, + function (Application $app) { + /** @var BudgetRepositoryInterface $repository */ + $repository = app(BudgetRepository::class); + if ($app->auth->check()) { + $repository->setUser(auth()->user()); } - return app('FireflyIII\Repositories\Budget\BudgetRepository', $arguments); + return $repository; } ); } diff --git a/app/Providers/CategoryServiceProvider.php b/app/Providers/CategoryServiceProvider.php index a3deb55f30..bdac9c91f1 100644 --- a/app/Providers/CategoryServiceProvider.php +++ b/app/Providers/CategoryServiceProvider.php @@ -14,7 +14,8 @@ declare(strict_types = 1); namespace FireflyIII\Providers; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Repositories\Category\CategoryRepository; +use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; @@ -43,16 +44,15 @@ class CategoryServiceProvider extends ServiceProvider public function register() { $this->app->bind( - 'FireflyIII\Repositories\Category\CategoryRepositoryInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\Category\CategoryRepository', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + CategoryRepositoryInterface::class, + function (Application $app) { + /** @var CategoryRepository $repository */ + $repository = app(CategoryRepository::class); + if ($app->auth->check()) { + $repository->setUser(auth()->user()); } - return app('FireflyIII\Repositories\Category\CategoryRepository', $arguments); + return $repository; } ); From eeae4d215dc256417e498180903441050cf39e21 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 17:20:00 +0100 Subject: [PATCH 18/30] Removed old service provider. --- app/Providers/CrudServiceProvider.php | 64 --------------------------- 1 file changed, 64 deletions(-) delete mode 100644 app/Providers/CrudServiceProvider.php diff --git a/app/Providers/CrudServiceProvider.php b/app/Providers/CrudServiceProvider.php deleted file mode 100644 index 93acfa1412..0000000000 --- a/app/Providers/CrudServiceProvider.php +++ /dev/null @@ -1,64 +0,0 @@ -registerJournal(); - } - - private function registerJournal() - { - $this->app->bind( - 'FireflyIII\Crud\Split\JournalInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Crud\Split\Journal', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); - } - - return app('FireflyIII\Crud\Split\Journal', $arguments); - } - ); - - } -} From 8263fa41dd7b95f0e115ea29ee61ca35c18b37f8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 17:29:05 +0100 Subject: [PATCH 19/30] Rewrote currency and export/import job service provider --- app/Providers/CurrencyServiceProvider.php | 18 ++++++++-------- app/Providers/ExportJobServiceProvider.php | 24 +++++++++++----------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/Providers/CurrencyServiceProvider.php b/app/Providers/CurrencyServiceProvider.php index d95532e072..bfdf535c70 100644 --- a/app/Providers/CurrencyServiceProvider.php +++ b/app/Providers/CurrencyServiceProvider.php @@ -14,7 +14,8 @@ declare(strict_types = 1); namespace FireflyIII\Providers; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Repositories\Currency\CurrencyRepository; +use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; @@ -43,16 +44,15 @@ class CurrencyServiceProvider extends ServiceProvider public function register() { $this->app->bind( - 'FireflyIII\Repositories\Currency\CurrencyRepositoryInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\Currency\CurrencyRepository', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + CurrencyRepositoryInterface::class, + function (Application $app) { + /** @var CurrencyRepository $repository */ + $repository = app(CurrencyRepository::class); + if ($app->auth->check()) { + $repository->setUser(auth()->user()); } - return app('FireflyIII\Repositories\Currency\CurrencyRepository', $arguments); + return $repository; } ); } diff --git a/app/Providers/ExportJobServiceProvider.php b/app/Providers/ExportJobServiceProvider.php index 220a678623..7c12925df1 100644 --- a/app/Providers/ExportJobServiceProvider.php +++ b/app/Providers/ExportJobServiceProvider.php @@ -15,6 +15,8 @@ declare(strict_types = 1); namespace FireflyIII\Providers; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Repositories\ExportJob\ExportJobRepository; +use FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; @@ -33,8 +35,7 @@ class ExportJobServiceProvider extends ServiceProvider */ public function boot() { - $this->exportJob(); - $this->importJob(); + } @@ -45,7 +46,8 @@ class ExportJobServiceProvider extends ServiceProvider */ public function register() { - // + $this->exportJob(); + $this->importJob(); } /** @@ -53,18 +55,16 @@ class ExportJobServiceProvider extends ServiceProvider */ private function exportJob() { - $this->app->bind( - 'FireflyIII\Repositories\ExportJob\ExportJobRepositoryInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\ExportJob\ExportJobRepository', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + ExportJobRepositoryInterface::class, + function (Application $app) { + /** @var ExportJobRepository $repository */ + $repository = app(ExportJobRepository::class); + if ($app->auth->check()) { + $repository->setUser(auth()->user()); } - return app('FireflyIII\Repositories\ExportJob\ExportJobRepository', $arguments); + return $repository; } ); } From e057c4d79ccd226fb3759c34ed58e399d3c90036 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 30 Jan 2017 17:29:18 +0100 Subject: [PATCH 20/30] Removed reference to crud service provider. --- config/app.php | 1 - 1 file changed, 1 deletion(-) diff --git a/config/app.php b/config/app.php index 125ec35093..1bbf9d2452 100755 --- a/config/app.php +++ b/config/app.php @@ -73,7 +73,6 @@ return [ /* * More service providers. */ - FireflyIII\Providers\CrudServiceProvider::class, FireflyIII\Providers\AccountServiceProvider::class, FireflyIII\Providers\AttachmentServiceProvider::class, FireflyIII\Providers\BillServiceProvider::class, From 615d90c8f46ac271b1fff2eb497e577caa3553ee Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 2 Feb 2017 07:35:53 +0100 Subject: [PATCH 21/30] Update various service providers. --- app/Providers/FireflyServiceProvider.php | 44 ++++++++++++++++------ app/Providers/PiggyBankServiceProvider.php | 18 ++++----- app/Providers/RuleGroupServiceProvider.php | 16 ++++---- 3 files changed, 50 insertions(+), 28 deletions(-) diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index b798f531e0..2ef97e48d2 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -13,6 +13,28 @@ declare(strict_types = 1); namespace FireflyIII\Providers; +use FireflyIII\Export\Processor; +use FireflyIII\Export\ProcessorInterface; +use FireflyIII\Generator\Chart\Basic\ChartJsGenerator; +use FireflyIII\Generator\Chart\Basic\GeneratorInterface; +use FireflyIII\Helpers\Attachments\AttachmentHelper; +use FireflyIII\Helpers\Attachments\AttachmentHelperInterface; +use FireflyIII\Helpers\Chart\MetaPieChart; +use FireflyIII\Helpers\Chart\MetaPieChartInterface; +use FireflyIII\Helpers\FiscalHelper; +use FireflyIII\Helpers\FiscalHelperInterface; +use FireflyIII\Helpers\Help\Help; +use FireflyIII\Helpers\Help\HelpInterface; +use FireflyIII\Helpers\Report\BalanceReportHelper; +use FireflyIII\Helpers\Report\BalanceReportHelperInterface; +use FireflyIII\Helpers\Report\BudgetReportHelper; +use FireflyIII\Helpers\Report\BudgetReportHelperInterface; +use FireflyIII\Helpers\Report\ReportHelper; +use FireflyIII\Helpers\Report\ReportHelperInterface; +use FireflyIII\Import\ImportProcedure; +use FireflyIII\Import\ImportProcedureInterface; +use FireflyIII\Repositories\User\UserRepository; +use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Support\Amount; use FireflyIII\Support\ExpandedForm; use FireflyIII\Support\FireflyConfig; @@ -94,22 +116,22 @@ class FireflyServiceProvider extends ServiceProvider ); // chart generator: - $this->app->bind('FireflyIII\Generator\Chart\Basic\GeneratorInterface', 'FireflyIII\Generator\Chart\Basic\ChartJsGenerator'); + $this->app->bind(GeneratorInterface::class, ChartJsGenerator::class); // chart builder - $this->app->bind('FireflyIII\Helpers\Chart\MetaPieChartInterface', 'FireflyIII\Helpers\Chart\MetaPieChart'); + $this->app->bind(MetaPieChartInterface::class, MetaPieChart::class); // other generators - $this->app->bind('FireflyIII\Export\ProcessorInterface', 'FireflyIII\Export\Processor'); - $this->app->bind('FireflyIII\Import\ImportProcedureInterface', 'FireflyIII\Import\ImportProcedure'); - $this->app->bind('FireflyIII\Repositories\User\UserRepositoryInterface', 'FireflyIII\Repositories\User\UserRepository'); - $this->app->bind('FireflyIII\Helpers\Attachments\AttachmentHelperInterface', 'FireflyIII\Helpers\Attachments\AttachmentHelper'); + $this->app->bind(ProcessorInterface::class,Processor::class); + $this->app->bind(ImportProcedureInterface::class,ImportProcedure::class); + $this->app->bind(UserRepositoryInterface::class, UserRepository::class); + $this->app->bind(AttachmentHelperInterface::class, AttachmentHelper::class); - $this->app->bind('FireflyIII\Helpers\Help\HelpInterface', 'FireflyIII\Helpers\Help\Help'); - $this->app->bind('FireflyIII\Helpers\Report\ReportHelperInterface', 'FireflyIII\Helpers\Report\ReportHelper'); - $this->app->bind('FireflyIII\Helpers\FiscalHelperInterface', 'FireflyIII\Helpers\FiscalHelper'); - $this->app->bind('FireflyIII\Helpers\Report\BalanceReportHelperInterface', 'FireflyIII\Helpers\Report\BalanceReportHelper'); - $this->app->bind('FireflyIII\Helpers\Report\BudgetReportHelperInterface', 'FireflyIII\Helpers\Report\BudgetReportHelper'); + $this->app->bind(HelpInterface::class, Help::class); + $this->app->bind(ReportHelperInterface::class, ReportHelper::class); + $this->app->bind(FiscalHelperInterface::class,FiscalHelper::class); + $this->app->bind(BalanceReportHelperInterface::class, BalanceReportHelper::class); + $this->app->bind(BudgetReportHelperInterface::class, BudgetReportHelper::class); } } diff --git a/app/Providers/PiggyBankServiceProvider.php b/app/Providers/PiggyBankServiceProvider.php index 11ba540e3c..fb1aaf7d5f 100644 --- a/app/Providers/PiggyBankServiceProvider.php +++ b/app/Providers/PiggyBankServiceProvider.php @@ -15,6 +15,8 @@ declare(strict_types = 1); namespace FireflyIII\Providers; use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Repositories\PiggyBank\PiggyBankRepository; +use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; @@ -44,16 +46,14 @@ class PiggyBankServiceProvider extends ServiceProvider public function register() { $this->app->bind( - 'FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface', - function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\PiggyBank\PiggyBankRepository', [auth()->user()]); + PiggyBankRepositoryInterface::class, + function (Application $app) { + /** @var PiggyBankRepository $repository */ + $repository = app(PiggyBankRepository::class); + if ($app->auth->check()) { + $repository->setUser(auth()->user()); } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); - } - - return app('FireflyIII\Repositories\PiggyBank\PiggyBankRepository', $arguments); + return $repository; } ); } diff --git a/app/Providers/RuleGroupServiceProvider.php b/app/Providers/RuleGroupServiceProvider.php index bddd6a8480..c6b86c1604 100644 --- a/app/Providers/RuleGroupServiceProvider.php +++ b/app/Providers/RuleGroupServiceProvider.php @@ -14,7 +14,8 @@ declare(strict_types = 1); namespace FireflyIII\Providers; -use FireflyIII\Exceptions\FireflyException; +use FireflyIII\Repositories\RuleGroup\RuleGroupRepository; +use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; @@ -44,16 +45,15 @@ class RuleGroupServiceProvider extends ServiceProvider public function register() { $this->app->bind( - 'FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface', + RuleGroupRepositoryInterface::class, function (Application $app, array $arguments) { - if (!isset($arguments[0]) && $app->auth->check()) { - return app('FireflyIII\Repositories\RuleGroup\RuleGroupRepository', [auth()->user()]); - } - if (!isset($arguments[0]) && !$app->auth->check()) { - throw new FireflyException('There is no user present.'); + /** @var RuleGroupRepository $repository */ + $repository = app(RuleGroupRepository::class); + if ($app->auth->check()) { + $repository->setUser(auth()->user()); } - return app('FireflyIII\Repositories\RuleGroup\RuleGroupRepository', $arguments); + return $repository; } ); } From 646b65918dc8ec3307d9dfcba12220dae8899016 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 5 Feb 2017 15:41:23 +0100 Subject: [PATCH 22/30] =?UTF-8?q?Remove=20tests=20since=20they=E2=80=99ve?= =?UTF-8?q?=20been=20changed=20in=20Laravel=205.4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/ExampleTest.php | 27 -- .../Controllers/AccountControllerTest.php | 224 -------------- .../Admin/ConfigurationControllerTest.php | 75 ----- .../Controllers/Admin/HomeControllerTest.php | 44 --- .../Controllers/Admin/UserControllerTest.php | 68 ----- .../Controllers/AttachmentControllerTest.php | 121 -------- .../Controllers/Auth/LoginControllerTest.php | 64 ---- .../Auth/TwoFactorControllerTest.php | 70 ----- .../Controllers/BillControllerTest.php | 179 ----------- .../Controllers/BudgetControllerTest.php | 283 ------------------ .../Controllers/CategoryControllerTest.php | 257 ---------------- .../Chart/AccountControllerTest.php | 154 ---------- .../Controllers/Chart/BillControllerTest.php | 56 ---- .../Chart/BudgetControllerTest.php | 103 ------- .../Chart/CategoryControllerTest.php | 148 --------- .../Chart/CategoryReportControllerTest.php | 82 ----- .../Chart/PiggyBankControllerTest.php | 41 --- .../Chart/ReportControllerTest.php | 61 ---- .../Controllers/CurrencyControllerTest.php | 140 --------- .../Controllers/ExportControllerTest.php | 111 ------- .../Controllers/HelpControllerTest.php | 45 --- .../Controllers/HomeControllerTest.php | 96 ------ .../Controllers/ImportControllerTest.php | 177 ----------- .../Controllers/JsonControllerTest.php | 158 ---------- .../Controllers/NewUserControllerTest.php | 55 ---- .../Controllers/PiggyBankControllerTest.php | 241 --------------- .../Popup/ReportControllerTest.php | 149 --------- .../Controllers/PreferencesControllerTest.php | 87 ------ .../Controllers/ProfileControllerTest.php | 97 ------ .../Report/AccountControllerTest.php | 42 --- .../Report/BalanceControllerTest.php | 41 --- .../Report/BudgetControllerTest.php | 51 ---- .../Report/CategoryControllerTest.php | 61 ---- .../Report/OperationsControllerTest.php | 62 ---- .../Controllers/ReportControllerTest.php | 105 ------- .../Controllers/RuleControllerTest.php | 228 -------------- .../Controllers/RuleGroupControllerTest.php | 173 ----------- .../Controllers/SearchControllerTest.php | 49 --- .../Controllers/TagControllerTest.php | 135 --------- .../Transaction/ConvertControllerTest.php | 121 -------- .../Transaction/MassControllerTest.php | 115 ------- .../Transaction/SingleControllerTest.php | 141 --------- .../Transaction/SplitControllerTest.php | 86 ------ .../Controllers/TransactionControllerTest.php | 89 ------ tests/unit/Models/AccountTest.php | 83 ----- tests/unit/Models/TransactionTypeTest.php | 56 ---- 46 files changed, 5051 deletions(-) delete mode 100644 tests/ExampleTest.php delete mode 100644 tests/acceptance/Controllers/AccountControllerTest.php delete mode 100644 tests/acceptance/Controllers/Admin/ConfigurationControllerTest.php delete mode 100644 tests/acceptance/Controllers/Admin/HomeControllerTest.php delete mode 100644 tests/acceptance/Controllers/Admin/UserControllerTest.php delete mode 100644 tests/acceptance/Controllers/AttachmentControllerTest.php delete mode 100644 tests/acceptance/Controllers/Auth/LoginControllerTest.php delete mode 100644 tests/acceptance/Controllers/Auth/TwoFactorControllerTest.php delete mode 100644 tests/acceptance/Controllers/BillControllerTest.php delete mode 100644 tests/acceptance/Controllers/BudgetControllerTest.php delete mode 100644 tests/acceptance/Controllers/CategoryControllerTest.php delete mode 100644 tests/acceptance/Controllers/Chart/AccountControllerTest.php delete mode 100644 tests/acceptance/Controllers/Chart/BillControllerTest.php delete mode 100644 tests/acceptance/Controllers/Chart/BudgetControllerTest.php delete mode 100644 tests/acceptance/Controllers/Chart/CategoryControllerTest.php delete mode 100644 tests/acceptance/Controllers/Chart/CategoryReportControllerTest.php delete mode 100644 tests/acceptance/Controllers/Chart/PiggyBankControllerTest.php delete mode 100644 tests/acceptance/Controllers/Chart/ReportControllerTest.php delete mode 100644 tests/acceptance/Controllers/CurrencyControllerTest.php delete mode 100644 tests/acceptance/Controllers/ExportControllerTest.php delete mode 100644 tests/acceptance/Controllers/HelpControllerTest.php delete mode 100644 tests/acceptance/Controllers/HomeControllerTest.php delete mode 100644 tests/acceptance/Controllers/ImportControllerTest.php delete mode 100644 tests/acceptance/Controllers/JsonControllerTest.php delete mode 100644 tests/acceptance/Controllers/NewUserControllerTest.php delete mode 100644 tests/acceptance/Controllers/PiggyBankControllerTest.php delete mode 100644 tests/acceptance/Controllers/Popup/ReportControllerTest.php delete mode 100644 tests/acceptance/Controllers/PreferencesControllerTest.php delete mode 100644 tests/acceptance/Controllers/ProfileControllerTest.php delete mode 100644 tests/acceptance/Controllers/Report/AccountControllerTest.php delete mode 100644 tests/acceptance/Controllers/Report/BalanceControllerTest.php delete mode 100644 tests/acceptance/Controllers/Report/BudgetControllerTest.php delete mode 100644 tests/acceptance/Controllers/Report/CategoryControllerTest.php delete mode 100644 tests/acceptance/Controllers/Report/OperationsControllerTest.php delete mode 100644 tests/acceptance/Controllers/ReportControllerTest.php delete mode 100644 tests/acceptance/Controllers/RuleControllerTest.php delete mode 100644 tests/acceptance/Controllers/RuleGroupControllerTest.php delete mode 100644 tests/acceptance/Controllers/SearchControllerTest.php delete mode 100644 tests/acceptance/Controllers/TagControllerTest.php delete mode 100644 tests/acceptance/Controllers/Transaction/ConvertControllerTest.php delete mode 100644 tests/acceptance/Controllers/Transaction/MassControllerTest.php delete mode 100644 tests/acceptance/Controllers/Transaction/SingleControllerTest.php delete mode 100644 tests/acceptance/Controllers/Transaction/SplitControllerTest.php delete mode 100644 tests/acceptance/Controllers/TransactionControllerTest.php delete mode 100644 tests/unit/Models/AccountTest.php delete mode 100644 tests/unit/Models/TransactionTypeTest.php diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php deleted file mode 100644 index 74a0a460d6..0000000000 --- a/tests/ExampleTest.php +++ /dev/null @@ -1,27 +0,0 @@ -visit('/') - ->see('Firefly'); - } -} diff --git a/tests/acceptance/Controllers/AccountControllerTest.php b/tests/acceptance/Controllers/AccountControllerTest.php deleted file mode 100644 index e42a5a8d1a..0000000000 --- a/tests/acceptance/Controllers/AccountControllerTest.php +++ /dev/null @@ -1,224 +0,0 @@ -be($this->user()); - $this->call('GET', route('accounts.create', ['asset'])); - $this->assertResponseStatus(200); - // has bread crumb - $this->see('