mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-08-21 21:02:32 +00:00
Compare commits
297 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
84ac3df580 | ||
|
7f459df9e9 | ||
|
3625f3293a | ||
|
0a2308592f | ||
|
8ef3f18da7 | ||
|
e126427809 | ||
|
7b39828980 | ||
|
d03de52735 | ||
|
cabe90b2dd | ||
|
13b78bdc20 | ||
|
6f0e1c79ac | ||
|
b66daad3d3 | ||
|
9c5523252d | ||
|
bc8bcf7a1a | ||
|
85d655d3e2 | ||
|
ac419e01d3 | ||
|
5d4467a6c0 | ||
|
81da7f3667 | ||
|
9734196eb9 | ||
|
7e0f9b9b8e | ||
|
bb25132865 | ||
|
28bcff99f6 | ||
|
246cb36836 | ||
|
9a0c0f6d21 | ||
|
a9dd8eb9e7 | ||
|
9026c9d6f1 | ||
|
d5f7430723 | ||
|
5a53249fbb | ||
|
d2848cf569 | ||
|
71f39f55f2 | ||
|
490c817fc1 | ||
|
2e1a777811 | ||
|
48357d1cc9 | ||
|
846df21764 | ||
|
f78b8f9267 | ||
|
798d9ee876 | ||
|
1eea81e9dd | ||
|
4fcdfd41fa | ||
|
36a5f17af2 | ||
|
8032684ad0 | ||
|
f7d3d4a010 | ||
|
9975e0b3f3 | ||
|
ea484a7787 | ||
|
c2e8a67330 | ||
|
8f3e4a2dee | ||
|
07768a43c8 | ||
|
01c10e320c | ||
|
f16b2257c6 | ||
|
e005fe7ce1 | ||
|
c682e69ee7 | ||
|
49421f50ac | ||
|
529dd490b7 | ||
|
36329e596e | ||
|
fb75e2ef02 | ||
|
352171e339 | ||
|
592901b143 | ||
|
769b4819b2 | ||
|
77fa2bcc39 | ||
|
1129001bc6 | ||
|
8dd765ee89 | ||
|
479648e7c1 | ||
|
45cd19d1e3 | ||
|
f8718e0b7b | ||
|
dcc45631da | ||
|
c6d3a5bedc | ||
|
7cc8539298 | ||
|
900e8202e6 | ||
|
eb6ac7d1d1 | ||
|
178f917a49 | ||
|
1a8293d9ef | ||
|
ecdc00dcb7 | ||
|
147e04ecd2 | ||
|
49e48725a5 | ||
|
b3af744041 | ||
|
58a6a95d90 | ||
|
1aa9461370 | ||
|
1f78b9d4bc | ||
|
6f974fe285 | ||
|
f4f3c8798e | ||
|
ce1614f4e7 | ||
|
91494584c2 | ||
|
a85ebb49b2 | ||
|
ae273f8320 | ||
|
ef62e31b61 | ||
|
0c2c5d5344 | ||
|
11e93eac3d | ||
|
dbe17debb4 | ||
|
6c12337317 | ||
|
b2aa73b31e | ||
|
38b1fc7aa6 | ||
|
f4afcb4d50 | ||
|
4b019fe38b | ||
|
191401f32b | ||
|
62b68c6a21 | ||
|
15a22f0bfc | ||
|
926c03986c | ||
|
d8a00f4314 | ||
|
5862b832d9 | ||
|
67fa4a0fc7 | ||
|
90cf7a3bf5 | ||
|
0847040017 | ||
|
69b577048e | ||
|
3fbd2f93c8 | ||
|
8f0e36a8e4 | ||
|
7583698ee5 | ||
|
b561e79a6c | ||
|
5850ad06b1 | ||
|
e597f04b0d | ||
|
7b715925cf | ||
|
d3701837e3 | ||
|
7af10aca9e | ||
|
b54e99642b | ||
|
b1ad0668cc | ||
|
6583d0f69b | ||
|
cee6bbf134 | ||
|
43e49bf14a | ||
|
371b58a807 | ||
|
7812a1bb51 | ||
|
538e045e4c | ||
|
91fe1493a7 | ||
|
4650a2ea52 | ||
|
7cd51a7747 | ||
|
b55545b959 | ||
|
2685256c93 | ||
|
3819de4e74 | ||
|
73fee4eb6b | ||
|
609c193b88 | ||
|
03a42976b1 | ||
|
6db0efdfbc | ||
|
ebbbe1a620 | ||
|
5d1c77cb16 | ||
|
d48fb3ba55 | ||
|
8c024a1ae9 | ||
|
a3c34e6b3c | ||
|
fa7ab45a40 | ||
|
379b104778 | ||
|
d956c795a4 | ||
|
7d02d0f762 | ||
|
f96f38b172 | ||
|
4cea5d65a6 | ||
|
40d94e7a62 | ||
|
66019fdbbf | ||
|
37b02e3d5b | ||
|
093bdd6090 | ||
|
52656b25da | ||
|
1386c9d915 | ||
|
02c9441727 | ||
|
b1e926f2cb | ||
|
df9dcb395b | ||
|
ad59dad921 | ||
|
46e75968f5 | ||
|
0df5c5121d | ||
|
16f04b45ac | ||
|
5ce35a50c2 | ||
|
7110c1178a | ||
|
220f5e2913 | ||
|
9f8c75efc6 | ||
|
8f3e84df4d | ||
|
08ff3d8ad0 | ||
|
5c4d7734ac | ||
|
15f8cd49d3 | ||
|
62b3986fcd | ||
|
55b6d711f3 | ||
|
7e51d57d21 | ||
|
170d23d768 | ||
|
40266c6821 | ||
|
0a71077513 | ||
|
be5c44af61 | ||
|
720dcb0fe5 | ||
|
c86b207b1c | ||
|
413c1bc2fe | ||
|
5ca31ea3dd | ||
|
dd5d2d1616 | ||
|
5f08790f12 | ||
|
d5ef5ee5a7 | ||
|
f641c70172 | ||
|
992657b942 | ||
|
41e468b507 | ||
|
6660306ac4 | ||
|
dd9694890a | ||
|
0b8654d865 | ||
|
f07dc7bd81 | ||
|
6a6482dc7f | ||
|
3c9b7c07af | ||
|
796ab4bf2c | ||
|
55602d632d | ||
|
310ed9f504 | ||
|
dafddfa39a | ||
|
3e22c9860e | ||
|
fb0a0c3fb5 | ||
|
3b735c7533 | ||
|
1645490f5c | ||
|
aecffe10d9 | ||
|
4e69bc0e32 | ||
|
909f72e6be | ||
|
6a1d39d5f8 | ||
|
c5d4ec17c3 | ||
|
ed33a72945 | ||
|
d8c0091680 | ||
|
6419d68626 | ||
|
e2ecaf5bcf | ||
|
31146954d1 | ||
|
601ca9ec80 | ||
|
082b5ba895 | ||
|
e06361d5d7 | ||
|
552a8e130c | ||
|
40787bc29a | ||
|
6ab03bb228 | ||
|
3fdb782321 | ||
|
c8f52a1c40 | ||
|
eb63090387 | ||
|
5bc8f31c31 | ||
|
5776de7745 | ||
|
f45d0bb317 | ||
|
93aa5b7753 | ||
|
dd6a6a565f | ||
|
aba8025645 | ||
|
b12872e5de | ||
|
5a7b1ba292 | ||
|
24715c72a2 | ||
|
ed3a4e4663 | ||
|
e97283b34b | ||
|
c2dfbcba10 | ||
|
a9870b35be | ||
|
ed5cd2b9ca | ||
|
a9356ca1e2 | ||
|
cfba11e9ca | ||
|
4304a3c916 | ||
|
9e6194bfdc | ||
|
7d6c8aa9dc | ||
|
aad0864018 | ||
|
a55d18709c | ||
|
dd2f3c861b | ||
|
da1dc67e1c | ||
|
0c2b35e542 | ||
|
85dc1263ea | ||
|
c8ecb3e0ee | ||
|
ce10036a27 | ||
|
30e49846e0 | ||
|
be97dd1c57 | ||
|
648a6dca42 | ||
|
0566d0d198 | ||
|
dfc25722c9 | ||
|
a436c55c50 | ||
|
0d58530f55 | ||
|
04b2eaf535 | ||
|
ace2ed8bd0 | ||
|
dff2d716a1 | ||
|
ad18b9b81b | ||
|
eabfe0769b | ||
|
19f7027718 | ||
|
f537945351 | ||
|
d02372ab90 | ||
|
1b020c522f | ||
|
79d0450c77 | ||
|
bc32bc8831 | ||
|
f68a307eeb | ||
|
82e7479cfe | ||
|
462fe5d89f | ||
|
b0d8ac83ae | ||
|
d8ac817c91 | ||
|
5105bc6f64 | ||
|
47c9f1e9b8 | ||
|
49d0ed0c1b | ||
|
99f5151aab | ||
|
0a056ad02d | ||
|
c76b634d0b | ||
|
a81698d50f | ||
|
bae79063e1 | ||
|
fb5323c283 | ||
|
e2d1de94b7 | ||
|
7109fd8196 | ||
|
a5fd821e0c | ||
|
6c63583e49 | ||
|
dd16e1b784 | ||
|
d52d8d7970 | ||
|
f349aa47ce | ||
|
ef4018934c | ||
|
951aa9535e | ||
|
de1fe36226 | ||
|
64fd36d437 | ||
|
6f9ecc0ffa | ||
|
a97bfc92e1 | ||
|
0d72fcdf02 | ||
|
0e84ca1df5 | ||
|
b28bdda510 | ||
|
72314e2d9f | ||
|
d22fb9f438 | ||
|
04b8552d27 | ||
|
5d6f44cd91 | ||
|
afc8ad7ff5 | ||
|
ae039bf1c7 | ||
|
8fa25e9d37 | ||
|
0daab491ec | ||
|
4f825bac1a | ||
|
39c8b79ebb | ||
|
7d66c90beb |
14
.deploy/docker/entrypoint.sh
Executable file
14
.deploy/docker/entrypoint.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# make sure we own the volumes:
|
||||
chown -R www-data:www-data -R $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload $FIREFLY_PATH/storage/logs $FIREFLY_PATH/storage/cache
|
||||
chmod -R 775 $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload $FIREFLY_PATH/storage/upload $FIREFLY_PATH/storage/logs $FIREFLY_PATH/storage/cache
|
||||
|
||||
# remove any lingering files that may break upgrades:
|
||||
rm -f $FIREFLY_PATH/storage/logs/laravel.log
|
||||
|
||||
cat .env.docker | envsubst > .env && cat .env
|
||||
composer dump-autoload
|
||||
php artisan package:discover
|
||||
php artisan firefly:instructions install
|
||||
exec apache2-foreground
|
82
.deploy/kubernetes/firefly.yaml
Normal file
82
.deploy/kubernetes/firefly.yaml
Normal file
@@ -0,0 +1,82 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mysql-pv-export-claim
|
||||
labels:
|
||||
app: firefly-local
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mysql-pv-upload-claim
|
||||
labels:
|
||||
app: firefly-local
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: apps/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: firefly-local
|
||||
namespace: firefly
|
||||
labels:
|
||||
app: firefly-local
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: firefly-local
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: firefly-local
|
||||
spec:
|
||||
containers:
|
||||
- image: firefly-local
|
||||
name: firefly-local
|
||||
env:
|
||||
- name: FF_APP_ENV
|
||||
value: "local"
|
||||
- name: FF_APP_KEY
|
||||
value: "S0m3R@nd0mString0f32Ch@rsEx@ct1y"
|
||||
- name: FF_DB_HOST
|
||||
value: "172.17.0.9"
|
||||
- name: FF_DB_NAME
|
||||
value: "firefly_db"
|
||||
- name: FF_DB_USER
|
||||
value: "firefly_db"
|
||||
- name: FF_DB_PASSWORD
|
||||
value: "password"
|
||||
volumeMounts:
|
||||
- mountPath: "/var/www/firefly-iii/storage/export"
|
||||
name: mysql-persistent-export
|
||||
- mountPath: "/var/www/firefly-iii/storage/upload"
|
||||
name: mysql-persistent-upload
|
||||
imagePullPolicy: IfNotPresent
|
||||
volumes:
|
||||
- name: mysql-persistent-export
|
||||
persistentVolumeClaim:
|
||||
claimName: mysql-pv-export-claim
|
||||
- name: mysql-persistent-upload
|
||||
persistentVolumeClaim:
|
||||
claimName: mysql-pv-upload-claim
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: firefly-local
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
type: NodePort
|
||||
selector:
|
||||
app: firefly-local
|
49
.deploy/kubernetes/sql.yaml
Normal file
49
.deploy/kubernetes/sql.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: sql-pass
|
||||
type: Opaque
|
||||
data:
|
||||
password: cGFzc3dvcmQ=
|
||||
---
|
||||
apiVersion: apps/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mysql
|
||||
namespace: firefly
|
||||
labels:
|
||||
app: mysql
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mysql
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mysql
|
||||
spec:
|
||||
containers:
|
||||
- image: mysql
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: mysql
|
||||
env:
|
||||
- name: MYSQL_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: sql-pass
|
||||
key: password
|
||||
ports:
|
||||
- containerPort: 3306
|
||||
name: mysql
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mysql
|
||||
spec:
|
||||
ports:
|
||||
- port: 3306
|
||||
type: NodePort
|
||||
selector:
|
||||
app: mysql
|
||||
|
14
.env.docker
14
.env.docker
@@ -17,11 +17,14 @@ APP_KEY=${FF_APP_KEY}
|
||||
APP_URL=${APP_URL}
|
||||
TRUSTED_PROXIES=${TRUSTED_PROXIES}
|
||||
|
||||
# The log channel defines where your log entries go to.
|
||||
LOG_CHANNEL=${LOG_CHANNEL}
|
||||
|
||||
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
|
||||
# If you use SQLite, set connection to `sqlite` and remove the database, username and password settings.
|
||||
DB_CONNECTION=mysql
|
||||
DB_CONNECTION=${FF_DB_CONNECTION}
|
||||
DB_HOST=${FF_DB_HOST}
|
||||
DB_PORT=3306
|
||||
DB_PORT=${FF_DB_PORT}
|
||||
DB_DATABASE=${FF_DB_NAME}
|
||||
DB_USERNAME=${FF_DB_USER}
|
||||
DB_PASSWORD=${FF_DB_PASSWORD}
|
||||
@@ -62,6 +65,11 @@ SEND_ERROR_MESSAGE=false
|
||||
# Set a Mapbox API key here (see mapbox.com) so there might be a map available at various places.
|
||||
MAPBOX_API_KEY=${MAPBOX_API_KEY}
|
||||
|
||||
# Set a Fixer IO API key here (see https://fixer.io) to enable live currency exchange rates.
|
||||
# Please note that this will only work for paid fixer.io accounts because they severly limited
|
||||
# the free API up to the point where you might as well offer nothing.
|
||||
FIXER_API_KEY=${FIXER_API_KEY}
|
||||
|
||||
# If you wish to track your own behavior over Firefly III, set a valid analytics tracker ID here.
|
||||
ANALYTICS_ID=${ANALYTICS_ID}
|
||||
|
||||
@@ -79,7 +87,6 @@ REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
CACHE_PREFIX=firefly
|
||||
SEARCH_RESULT_LIMIT=50
|
||||
EXCHANGE_RATE_SERVICE=fixerio
|
||||
PUSHER_KEY=
|
||||
PUSHER_SECRET=
|
||||
PUSHER_ID=
|
||||
@@ -88,3 +95,4 @@ DEMO_PASSWORD=
|
||||
IS_DOCKER=true
|
||||
IS_SANDSTORM=false
|
||||
IS_HEROKU=false
|
||||
TZ=${TZ}
|
||||
|
17
.env.example
17
.env.example
@@ -13,12 +13,19 @@ SITE_OWNER=mail@example.com
|
||||
# Change it to a string of exactly 32 chars or use command `php artisan key:generate` to generate it
|
||||
APP_KEY=SomeRandomStringOf32CharsExactly
|
||||
|
||||
# Change this value to your preferred time zone.
|
||||
# Example: Europe/Amsterdam
|
||||
TZ=UTC
|
||||
|
||||
# APP_URL and TRUSTED_PROXIES are useful when using Docker and/or a reverse proxy.
|
||||
APP_URL=http://localhost
|
||||
TRUSTED_PROXIES=
|
||||
|
||||
# The log channel defines where your log entries go to.
|
||||
LOG_CHANNEL=daily
|
||||
|
||||
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
|
||||
# If you use SQLite, set connection to `sqlite` and remove the database, username and password settings.
|
||||
# For other database types, please see the FAQ: http://firefly-iii.readthedocs.io/en/latest/support/faq.html
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
@@ -47,7 +54,7 @@ COOKIE_DOMAIN=
|
||||
COOKIE_SECURE=false
|
||||
|
||||
# If you want Firefly III to mail you, update these settings
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_DRIVER=log
|
||||
MAIL_HOST=smtp.mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_FROM=changeme@example.com
|
||||
@@ -62,6 +69,11 @@ SEND_ERROR_MESSAGE=true
|
||||
# Set a Mapbox API key here (see mapbox.com) so there might be a map available at various places.
|
||||
MAPBOX_API_KEY=
|
||||
|
||||
# Set a Fixer IO API key here (see https://fixer.io) to enable live currency exchange rates.
|
||||
# Please note that this will only work for paid fixer.io accounts because they severly limited
|
||||
# the free API up to the point where you might as well offer nothing.
|
||||
FIXER_API_KEY=
|
||||
|
||||
# If you wish to track your own behavior over Firefly III, set a valid analytics tracker ID here.
|
||||
ANALYTICS_ID=
|
||||
|
||||
@@ -79,7 +91,6 @@ REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
CACHE_PREFIX=firefly
|
||||
SEARCH_RESULT_LIMIT=50
|
||||
EXCHANGE_RATE_SERVICE=fixerio
|
||||
PUSHER_KEY=
|
||||
PUSHER_SECRET=
|
||||
PUSHER_ID=
|
||||
|
15
.env.heroku
15
.env.heroku
@@ -13,10 +13,17 @@ SITE_OWNER=heroku@example.com
|
||||
# Change it to a string of exactly 32 chars or use command `php artisan key:generate` to generate it
|
||||
APP_KEY=7ahyYVPVsmxjdhsweWCauGeJfwc92NP2
|
||||
|
||||
# Change this value to your preferred time zone.
|
||||
# Example: Europe/Amsterdam
|
||||
TZ=UTC
|
||||
|
||||
# APP_URL and TRUSTED_PROXIES are useful when using Docker and/or a reverse proxy.
|
||||
APP_URL=http://localhost
|
||||
TRUSTED_PROXIES=
|
||||
|
||||
# The log channel defines where your log entries go to.
|
||||
LOG_CHANNEL=syslog
|
||||
|
||||
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
|
||||
# If you use SQLite, set connection to `sqlite` and remove the database, username and password settings.
|
||||
DB_CONNECTION=pgsql
|
||||
@@ -47,7 +54,7 @@ COOKIE_DOMAIN=
|
||||
COOKIE_SECURE=false
|
||||
|
||||
# If you want Firefly III to mail you, update these settings
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_DRIVER=log
|
||||
MAIL_HOST=smtp.mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_FROM=changeme@example.com
|
||||
@@ -62,6 +69,11 @@ SEND_ERROR_MESSAGE=true
|
||||
# Set a Mapbox API key here (see mapbox.com) so there might be a map available at various places.
|
||||
MAPBOX_API_KEY=
|
||||
|
||||
# Set a Fixer IO API key here (see https://fixer.io) to enable live currency exchange rates.
|
||||
# Please note that this will only work for paid fixer.io accounts because they severly limited
|
||||
# the free API up to the point where you might as well offer nothing.
|
||||
FIXER_API_KEY=
|
||||
|
||||
# If you wish to track your own behavior over Firefly III, set a valid analytics tracker ID here.
|
||||
ANALYTICS_ID=
|
||||
|
||||
@@ -79,7 +91,6 @@ REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
CACHE_PREFIX=firefly
|
||||
SEARCH_RESULT_LIMIT=50
|
||||
EXCHANGE_RATE_SERVICE=fixerio
|
||||
PUSHER_KEY=
|
||||
PUSHER_SECRET=
|
||||
PUSHER_ID=
|
||||
|
@@ -13,10 +13,17 @@ SITE_OWNER=sandstorm@example.com
|
||||
# Change it to a string of exactly 32 chars or use command `php artisan key:generate` to generate it
|
||||
APP_KEY=SomeRandomStringOf32CharsExactly
|
||||
|
||||
# Change this value to your preferred time zone.
|
||||
# Example: Europe/Amsterdam
|
||||
TZ=UTC
|
||||
|
||||
# APP_URL and TRUSTED_PROXIES are useful when using Docker and/or a reverse proxy.
|
||||
APP_URL=http://localhost
|
||||
TRUSTED_PROXIES=
|
||||
|
||||
# The log channel defines where your log entries go to.
|
||||
LOG_CHANNEL=syslog
|
||||
|
||||
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
|
||||
# If you use SQLite, set connection to `sqlite` and remove the database, username and password settings.
|
||||
DB_CONNECTION=mysql
|
||||
@@ -47,7 +54,7 @@ COOKIE_DOMAIN=
|
||||
COOKIE_SECURE=false
|
||||
|
||||
# If you want Firefly III to mail you, update these settings
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_DRIVER=log
|
||||
MAIL_HOST=smtp.mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_FROM=changeme@example.com
|
||||
@@ -62,6 +69,11 @@ SEND_ERROR_MESSAGE=true
|
||||
# Set a Mapbox API key here (see mapbox.com) so there might be a map available at various places.
|
||||
MAPBOX_API_KEY=
|
||||
|
||||
# Set a Fixer IO API key here (see https://fixer.io) to enable live currency exchange rates.
|
||||
# Please note that this will only work for paid fixer.io accounts because they severly limited
|
||||
# the free API up to the point where you might as well offer nothing.
|
||||
FIXER_API_KEY=
|
||||
|
||||
# If you wish to track your own behavior over Firefly III, set a valid analytics tracker ID here.
|
||||
ANALYTICS_ID=
|
||||
|
||||
@@ -79,7 +91,6 @@ REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
CACHE_PREFIX=firefly
|
||||
SEARCH_RESULT_LIMIT=50
|
||||
EXCHANGE_RATE_SERVICE=fixerio
|
||||
PUSHER_KEY=
|
||||
PUSHER_SECRET=
|
||||
PUSHER_ID=
|
||||
|
85
.env.testing
85
.env.testing
@@ -1,32 +1,54 @@
|
||||
# You can leave this on "local". If you change it to production most console commands will ask for extra confirmation.
|
||||
# Never set it to "testing".
|
||||
APP_ENV=testing
|
||||
|
||||
# Set to true if you want to see debug information in error screens.
|
||||
APP_DEBUG=true
|
||||
APP_NAME=FireflyIII
|
||||
|
||||
# This should be your email address
|
||||
SITE_OWNER=thegrumpydictator+testing@gmail.com
|
||||
|
||||
# The encryption key for your database and sessions. Keep this very secure.
|
||||
# If you generate a new one all existing data must be considered LOST.
|
||||
# Change it to a string of exactly 32 chars or use command `php artisan key:generate` to generate it
|
||||
APP_KEY=TestTestTestTestTestTestTestTest
|
||||
APP_LOG=daily
|
||||
APP_LOG_LEVEL=debug
|
||||
|
||||
# Change this value to your preferred time zone.
|
||||
# Example: Europe/Amsterdam
|
||||
TZ=Europe/Amsterdam
|
||||
|
||||
# APP_URL and TRUSTED_PROXIES are useful when using Docker and/or a reverse proxy.
|
||||
APP_URL=http://localhost
|
||||
TRUSTED_PROXIES=
|
||||
|
||||
DB_CONNECTION=sqlite
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
#DB_DATABASE=firefly
|
||||
DB_USERNAME=homestead
|
||||
DB_PASSWORD=
|
||||
# The log channel defines where your log entries go to.
|
||||
LOG_CHANNEL=dailytest
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
|
||||
# For other database types, please see the FAQ: http://firefly-iii.readthedocs.io/en/latest/support/faq.html
|
||||
DB_CONNECTION=sqlite
|
||||
|
||||
# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.
|
||||
# Several other options exist. You can use 'single' for one big fat error log (not recommended).
|
||||
# Also available are 'syslog' and 'errorlog' which will log to the system itself.
|
||||
APP_LOG=daily
|
||||
|
||||
# Log level. You can set this from least severe to most severe:
|
||||
# debug, info, notice, warning, error, critical, alert, emergency
|
||||
# If you set it to debug your logs will grow large, and fast. If you set it to emergency probably
|
||||
# nothing will get logged, ever.
|
||||
APP_LOG_LEVEL=debug
|
||||
|
||||
# If you're looking for performance improvements, you could install memcached.
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
QUEUE_DRIVER=sync
|
||||
|
||||
# Cookie settings. Should not be necessary to change these.
|
||||
COOKIE_PATH="/"
|
||||
COOKIE_DOMAIN=
|
||||
COOKIE_SECURE=false
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
# If you want Firefly III to mail you, update these settings
|
||||
MAIL_DRIVER=log
|
||||
MAIL_HOST=smtp.mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
@@ -35,26 +57,41 @@ MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
|
||||
# Firefly III can send you the following messages
|
||||
SEND_REGISTRATION_MAIL=true
|
||||
SEND_ERROR_MESSAGE=false
|
||||
|
||||
CACHE_PREFIX=firefly
|
||||
|
||||
SEARCH_RESULT_LIMIT=50
|
||||
EXCHANGE_RATE_SERVICE=fixerio
|
||||
|
||||
# Set a Mapbox API key here (see mapbox.com) so there might be a map available at various places.
|
||||
MAPBOX_API_KEY=
|
||||
ANALYTICS_ID=
|
||||
SITE_OWNER=mail@example.com
|
||||
USE_ENCRYPTION=true
|
||||
|
||||
# Set a Fixer IO API key here (see https://fixer.io) to enable live currency exchange rates.
|
||||
# Please note that this will only work for paid fixer.io accounts because they severly limited
|
||||
# the free API up to the point where you might as well offer nothing.
|
||||
FIXER_API_KEY=
|
||||
|
||||
# If you wish to track your own behavior over Firefly III, set a valid analytics tracker ID here.
|
||||
ANALYTICS_ID=
|
||||
|
||||
# Most parts of the database are encrypted by default, but you can turn this off if you want to.
|
||||
# This makes it easier to migrate your database. Not that some fields will never be decrypted.
|
||||
USE_ENCRYPTION=false
|
||||
|
||||
# Leave the following configuration vars as is.
|
||||
# Unless you like to tinker and know what you're doing.
|
||||
APP_NAME=FireflyIII
|
||||
BROADCAST_DRIVER=log
|
||||
QUEUE_DRIVER=sync
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
CACHE_PREFIX=firefly_tst
|
||||
SEARCH_RESULT_LIMIT=50
|
||||
PUSHER_KEY=
|
||||
PUSHER_SECRET=
|
||||
PUSHER_ID=
|
||||
|
||||
DEMO_USERNAME=
|
||||
DEMO_PASSWORD=
|
||||
|
||||
IS_DOCKER=false
|
||||
IS_SANDSTORM=false
|
||||
IS_HEROKU=false
|
||||
|
55
.github/stale.yml
vendored
Normal file
55
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
daysUntilStale: 30
|
||||
|
||||
# Number of days of inactivity before a stale Issue or Pull Request is closed.
|
||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
||||
daysUntilClose: 7
|
||||
|
||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
# - "[Status] Maybe Later"
|
||||
exemptLabels:
|
||||
- enhancement
|
||||
- feature
|
||||
|
||||
# Set to true to ignore issues in a project (defaults to false)
|
||||
exemptProjects: false
|
||||
|
||||
# Set to true to ignore issues in a milestone (defaults to false)
|
||||
exemptMilestones: false
|
||||
|
||||
# Label to use when marking as stale
|
||||
staleLabel: stale
|
||||
|
||||
# Comment to post when marking as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
|
||||
# Comment to post when removing the stale label.
|
||||
# unmarkComment: >
|
||||
# Your comment here.
|
||||
|
||||
# Comment to post when closing a stale Issue or Pull Request.
|
||||
# closeComment: >
|
||||
# Your comment here.
|
||||
|
||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||
limitPerRun: 30
|
||||
|
||||
# Limit to only `issues` or `pulls`
|
||||
# only: issues
|
||||
|
||||
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
|
||||
# pulls:
|
||||
# daysUntilStale: 30
|
||||
# markComment: >
|
||||
# This pull request has been automatically marked as stale because it has not had
|
||||
# recent activity. It will be closed if no further activity occurs. Thank you
|
||||
# for your contributions.
|
||||
|
||||
# issues:
|
||||
# exemptLabels:
|
||||
# - confirmed
|
@@ -1,3 +1,86 @@
|
||||
# 4.7.3
|
||||
- Currency added to API
|
||||
- Firfely III will also generate a cash wallet for new users.
|
||||
- Can now reset Spectre and bunq settings
|
||||
- Docker file has a time zone
|
||||
- Allow database connection to be configured in Docker file
|
||||
- Can now view and edit attachments in edit-screen
|
||||
- User can visit hidden `/attachments` page
|
||||
- [Issue 1356](https://github.com/firefly-iii/firefly-iii/issues/1356): Budgets will show the remaining amount per day
|
||||
- [Issue 1367](https://github.com/firefly-iii/firefly-iii/issues/1367): Rules now come in strict and non-strict mode.
|
||||
- Added a security.txt
|
||||
- More support for trusted proxies
|
||||
- Improved edit routine for split transactions.
|
||||
- Upgrade routine can handle `proc_close` being disabled.
|
||||
- Bills now use rules to match transactions, making it more flexible.
|
||||
- [Issue 1328](https://github.com/firefly-iii/firefly-iii/issues/1328): piggy banks no have a more useful chart.
|
||||
- Spectre API upgraded to v4
|
||||
- Move to MariaDB ([issue 1366](https://github.com/firefly-iii/firefly-iii/issues/1366))
|
||||
- Piggy banks take currency from parent account ([issue 1334](https://github.com/firefly-iii/firefly-iii/issues/1334))
|
||||
- [Issue 1341](https://github.com/firefly-iii/firefly-iii/issues/1341): Removed depricated command from dockerfile
|
||||
- Several issues with docker image ([issue 1320](https://github.com/firefly-iii/firefly-iii/issues/1320), [issue 1382](https://github.com/firefly-iii/firefly-iii/issues/1382)).
|
||||
- Fix giant tags and division by zero ([issue 1325](https://github.com/firefly-iii/firefly-iii/issues/1325) and others)
|
||||
- Several issues with bunq import ([issue 1352](https://github.com/firefly-iii/firefly-iii/issues/1352), [issue 1330](https://github.com/firefly-iii/firefly-iii/issues/1330), [issue 1378](https://github.com/firefly-iii/firefly-iii/issues/1378), [issue 1380](https://github.com/firefly-iii/firefly-iii/issues/1380))
|
||||
- [Issue 1246](https://github.com/firefly-iii/firefly-iii/issues/1246): date picker is internationalised
|
||||
- [Issue 1327](https://github.com/firefly-iii/firefly-iii/issues/1327): fix formattting issues in piggy banks
|
||||
- [Issue 1348](https://github.com/firefly-iii/firefly-iii/issues/1348): 500 error in API
|
||||
- [Issue 1349](https://github.com/firefly-iii/firefly-iii/issues/1349): Errors in import routine
|
||||
- Several fixes for (multi-currency) reconciliation ([issue 1336](https://github.com/firefly-iii/firefly-iii/issues/1336), [issue 1363](https://github.com/firefly-iii/firefly-iii/issues/1363))
|
||||
- [Issue 1353](https://github.com/firefly-iii/firefly-iii/issues/1353): return NULL values in range-indicator
|
||||
- Bug in split transaction edit routine
|
||||
- Piggy bank percentage was very specific.
|
||||
- Logging in Slack is easier to config.
|
||||
- [Issue 1312](https://github.com/firefly-iii/firefly-iii/issues/1312) Import broken for ING accounts
|
||||
- [Issue 1313](https://github.com/firefly-iii/firefly-iii/issues/1313) Error when creating new asset account
|
||||
- [Issue 1317](https://github.com/firefly-iii/firefly-iii/issues/1317) Forgot an include :(
|
||||
- Null pointer exception in transaction overview.
|
||||
- Installations running in subdirs were incapable of creating OAuth tokens.
|
||||
- OAuth keys were not created in all cases.
|
||||
|
||||
# 4.7.2
|
||||
- [Issue 1123](https://github.com/firefly-iii/firefly-iii/issues/1123) First browser based update routine.
|
||||
- Add support for Italian.
|
||||
- [Issue 1232](https://github.com/firefly-iii/firefly-iii/issues/1232) Allow user to specify Docker database port.
|
||||
- [Issue 1197](https://github.com/firefly-iii/firefly-iii/issues/1197) Beter account list overview
|
||||
- [Issue 1202](https://github.com/firefly-iii/firefly-iii/issues/1202) Some budgetary warnings
|
||||
- [Issue 1284](https://github.com/firefly-iii/firefly-iii/issues/1284) Experimental support for bunq import
|
||||
- [Issue 1248](https://github.com/firefly-iii/firefly-iii/issues/1248) Ability to import BIC, ability to import SEPA fields.
|
||||
- [Issue 1102](https://github.com/firefly-iii/firefly-iii/issues/1102) Summary line for bills
|
||||
- More info to debug page.
|
||||
- [Issue 1186](https://github.com/firefly-iii/firefly-iii/issues/1186) You can see the latest account balance in CRUD forms
|
||||
- Add Kubernetes YAML files, kindly created by a FF3 user.
|
||||
- [Issue 1244](https://github.com/firefly-iii/firefly-iii/issues/1244) Better line for "today" marker and add it to other chart as well ([issue 1214](https://github.com/firefly-iii/firefly-iii/issues/1214))
|
||||
- [Issue 1219](https://github.com/firefly-iii/firefly-iii/issues/1219) Languages in dropdown
|
||||
- [Issue 1189](https://github.com/firefly-iii/firefly-iii/issues/1189) Inactive accounts get removed from net worth
|
||||
- [Issue 1220](https://github.com/firefly-iii/firefly-iii/issues/1220) Attachment description and notes migrated to just "notes".
|
||||
- [Issue 1236](https://github.com/firefly-iii/firefly-iii/issues/1236) Multi currency balance box
|
||||
- [Issue 1240](https://github.com/firefly-iii/firefly-iii/issues/1240) Better overview for accounts.
|
||||
- [Issue 1292](https://github.com/firefly-iii/firefly-iii/issues/1292) Removed some charts from the "all"-overview of budgets and categories
|
||||
- [Issue 1245](https://github.com/firefly-iii/firefly-iii/issues/1245) Improved recognition of IBANs
|
||||
- Improved import routine.
|
||||
- Update notifier will wait three days before notifying users.
|
||||
- [Issue 1300](https://github.com/firefly-iii/firefly-iii/issues/1300) Virtual balance of credit cards does not count for net worth
|
||||
- [Issue 1247](https://github.com/firefly-iii/firefly-iii/issues/1247) Can now see overspent amount
|
||||
- [Issue 1221](https://github.com/firefly-iii/firefly-iii/issues/1221) Upgrade to Laravel 5.6
|
||||
- [Issue 1187](https://github.com/firefly-iii/firefly-iii/issues/1187) Updated the password verifier to use Troy Hunt's new API
|
||||
- Revenue chart is now on frontpage permanently
|
||||
- [Issue 1153](https://github.com/firefly-iii/firefly-iii/issues/1153) 2FA settings are in your profile now
|
||||
- [Issue 1227](https://github.com/firefly-iii/firefly-iii/issues/1227) Can set the timezone in config or in Docker
|
||||
- [Issue 1294](https://github.com/firefly-iii/firefly-iii/issues/1294) Ability to link a transaction to itself
|
||||
- Correct reference to journal description in split form.
|
||||
- [Issue 1234](https://github.com/firefly-iii/firefly-iii/issues/1234) Fix budget page issues in SQLite
|
||||
- [Issue 1262](https://github.com/firefly-iii/firefly-iii/issues/1262) Can now use double and epty headers in CSV files
|
||||
- [Issue 1258](https://github.com/firefly-iii/firefly-iii/issues/1258) Fixed a possible date mismatch in piggy banks
|
||||
- [Issue 1283](https://github.com/firefly-iii/firefly-iii/issues/1283) Bulk delete was broken
|
||||
- [Issue 1293](https://github.com/firefly-iii/firefly-iii/issues/1293) Layout problem with notes
|
||||
- [Issue 1257](https://github.com/firefly-iii/firefly-iii/issues/1257) Improve transaction lists query count
|
||||
- [Issue 1291](https://github.com/firefly-iii/firefly-iii/issues/1291) Fixer IO problems
|
||||
- [Issue 1239](https://github.com/firefly-iii/firefly-iii/issues/1239) Could not edit expense or revenue accounts ([issue 1298](https://github.com/firefly-iii/firefly-iii/issues/1298))
|
||||
- [Issue 1297](https://github.com/firefly-iii/firefly-iii/issues/1297) Could not convert to withdrawal
|
||||
- [Issue 1226](https://github.com/firefly-iii/firefly-iii/issues/1226) Category overview in default report shows no income.
|
||||
- Various other bugs and problems ([issue 1198](https://github.com/firefly-iii/firefly-iii/issues/1198), [issue 1213](https://github.com/firefly-iii/firefly-iii/issues/1213), [issue 1237](https://github.com/firefly-iii/firefly-iii/issues/1237), [issue 1238](https://github.com/firefly-iii/firefly-iii/issues/1238), [issue 1199](https://github.com/firefly-iii/firefly-iii/issues/1199), [issue 1200](https://github.com/firefly-iii/firefly-iii/issues/1200))
|
||||
- Fixed an issue with token validation on the command line.
|
||||
|
||||
# 4.7.1
|
||||
- A brand new API. Read about it in the [documentation](http://firefly-iii.readthedocs.io/en/latest/).
|
||||
- Add support for Spanish. [issue 1194](https://github.com/firefly-iii/firefly-iii/issues/1194)
|
||||
|
@@ -202,7 +202,6 @@ lib/x86_64-linux-gnu/libz.so.1.2.8
|
||||
lib64/ld-linux-x86-64.so.2
|
||||
opt/app/.codeclimate.yml
|
||||
opt/app/.env
|
||||
opt/app/.env.current
|
||||
opt/app/.env.docker
|
||||
opt/app/.env.example
|
||||
opt/app/.env.heroku
|
||||
@@ -341,12 +340,14 @@ opt/app/app/Helpers/Collection/Category.php
|
||||
opt/app/app/Helpers/Collector/JournalCollector.php
|
||||
opt/app/app/Helpers/Collector/JournalCollectorInterface.php
|
||||
opt/app/app/Helpers/Filter/AmountFilter.php
|
||||
opt/app/app/Helpers/Filter/CountAttachmentsFilter.php
|
||||
opt/app/app/Helpers/Filter/EmptyFilter.php
|
||||
opt/app/app/Helpers/Filter/FilterInterface.php
|
||||
opt/app/app/Helpers/Filter/InternalTransferFilter.php
|
||||
opt/app/app/Helpers/Filter/NegativeAmountFilter.php
|
||||
opt/app/app/Helpers/Filter/OpposingAccountFilter.php
|
||||
opt/app/app/Helpers/Filter/PositiveAmountFilter.php
|
||||
opt/app/app/Helpers/Filter/SplitIndicatorFilter.php
|
||||
opt/app/app/Helpers/Filter/TransferFilter.php
|
||||
opt/app/app/Helpers/FiscalHelper.php
|
||||
opt/app/app/Helpers/FiscalHelperInterface.php
|
||||
@@ -418,6 +419,7 @@ opt/app/app/Http/Controllers/ReportController.php
|
||||
opt/app/app/Http/Controllers/RuleController.php
|
||||
opt/app/app/Http/Controllers/RuleGroupController.php
|
||||
opt/app/app/Http/Controllers/SearchController.php
|
||||
opt/app/app/Http/Controllers/System/InstallController.php
|
||||
opt/app/app/Http/Controllers/TagController.php
|
||||
opt/app/app/Http/Controllers/Transaction/BulkController.php
|
||||
opt/app/app/Http/Controllers/Transaction/ConvertController.php
|
||||
@@ -431,6 +433,7 @@ opt/app/app/Http/Middleware/Authenticate.php
|
||||
opt/app/app/Http/Middleware/AuthenticateTwoFactor.php
|
||||
opt/app/app/Http/Middleware/Binder.php
|
||||
opt/app/app/Http/Middleware/EncryptCookies.php
|
||||
opt/app/app/Http/Middleware/Installer.php
|
||||
opt/app/app/Http/Middleware/IsAdmin.php
|
||||
opt/app/app/Http/Middleware/IsDemoUser.php
|
||||
opt/app/app/Http/Middleware/IsSandStormUser.php
|
||||
@@ -475,6 +478,7 @@ opt/app/app/Http/Requests/TestRuleFormRequest.php
|
||||
opt/app/app/Http/Requests/TokenFormRequest.php
|
||||
opt/app/app/Http/Requests/UserFormRequest.php
|
||||
opt/app/app/Http/Requests/UserRegistrationRequest.php
|
||||
opt/app/app/Import/Configuration/BunqConfigurator.php
|
||||
opt/app/app/Import/Configuration/ConfiguratorInterface.php
|
||||
opt/app/app/Import/Configuration/FileConfigurator.php
|
||||
opt/app/app/Import/Configuration/SpectreConfigurator.php
|
||||
@@ -510,6 +514,7 @@ opt/app/app/Import/Prerequisites/BunqPrerequisites.php
|
||||
opt/app/app/Import/Prerequisites/FilePrerequisites.php
|
||||
opt/app/app/Import/Prerequisites/PrerequisitesInterface.php
|
||||
opt/app/app/Import/Prerequisites/SpectrePrerequisites.php
|
||||
opt/app/app/Import/Routine/BunqRoutine.php
|
||||
opt/app/app/Import/Routine/FileRoutine.php
|
||||
opt/app/app/Import/Routine/RoutineInterface.php
|
||||
opt/app/app/Import/Routine/SpectreRoutine.php
|
||||
@@ -605,8 +610,6 @@ opt/app/app/Repositories/ImportJob/ImportJobRepository.php
|
||||
opt/app/app/Repositories/ImportJob/ImportJobRepositoryInterface.php
|
||||
opt/app/app/Repositories/Journal/JournalRepository.php
|
||||
opt/app/app/Repositories/Journal/JournalRepositoryInterface.php
|
||||
opt/app/app/Repositories/Journal/JournalTasker.php
|
||||
opt/app/app/Repositories/Journal/JournalTaskerInterface.php
|
||||
opt/app/app/Repositories/LinkType/LinkTypeRepository.php
|
||||
opt/app/app/Repositories/LinkType/LinkTypeRepositoryInterface.php
|
||||
opt/app/app/Repositories/PiggyBank/PiggyBankRepository.php
|
||||
@@ -633,10 +636,14 @@ opt/app/app/Services/Bunq/Object/Amount.php
|
||||
opt/app/app/Services/Bunq/Object/Avatar.php
|
||||
opt/app/app/Services/Bunq/Object/BunqObject.php
|
||||
opt/app/app/Services/Bunq/Object/DeviceServer.php
|
||||
opt/app/app/Services/Bunq/Object/Image.php
|
||||
opt/app/app/Services/Bunq/Object/LabelMonetaryAccount.php
|
||||
opt/app/app/Services/Bunq/Object/LabelUser.php
|
||||
opt/app/app/Services/Bunq/Object/MonetaryAccountBank.php
|
||||
opt/app/app/Services/Bunq/Object/MonetaryAccountProfile.php
|
||||
opt/app/app/Services/Bunq/Object/MonetaryAccountSetting.php
|
||||
opt/app/app/Services/Bunq/Object/NotificationFilter.php
|
||||
opt/app/app/Services/Bunq/Object/Payment.php
|
||||
opt/app/app/Services/Bunq/Object/ServerPublicKey.php
|
||||
opt/app/app/Services/Bunq/Object/UserCompany.php
|
||||
opt/app/app/Services/Bunq/Object/UserLight.php
|
||||
@@ -648,28 +655,36 @@ opt/app/app/Services/Bunq/Request/DeviceSessionRequest.php
|
||||
opt/app/app/Services/Bunq/Request/InstallationTokenRequest.php
|
||||
opt/app/app/Services/Bunq/Request/ListDeviceServerRequest.php
|
||||
opt/app/app/Services/Bunq/Request/ListMonetaryAccountRequest.php
|
||||
opt/app/app/Services/Bunq/Request/ListPaymentRequest.php
|
||||
opt/app/app/Services/Bunq/Request/ListUserRequest.php
|
||||
opt/app/app/Services/Bunq/Token/BunqToken.php
|
||||
opt/app/app/Services/Bunq/Token/InstallationToken.php
|
||||
opt/app/app/Services/Bunq/Token/SessionToken.php
|
||||
opt/app/app/Services/Currency/ExchangeRateInterface.php
|
||||
opt/app/app/Services/Currency/FixerIO.php
|
||||
opt/app/app/Services/Currency/FixerIOv2.php
|
||||
opt/app/app/Services/Github/Object/GithubObject.php
|
||||
opt/app/app/Services/Github/Object/Release.php
|
||||
opt/app/app/Services/Github/Request/GithubRequest.php
|
||||
opt/app/app/Services/Github/Request/UpdateRequest.php
|
||||
opt/app/app/Services/Internal/Destroy/AccountDestroyService.php
|
||||
opt/app/app/Services/Internal/Destroy/BillDestroyService.php
|
||||
opt/app/app/Services/Internal/Destroy/CategoryDestroyService.php
|
||||
opt/app/app/Services/Internal/Destroy/CurrencyDestroyService.php
|
||||
opt/app/app/Services/Internal/Destroy/JournalDestroyService.php
|
||||
opt/app/app/Services/Internal/File/EncryptService.php
|
||||
opt/app/app/Services/Internal/Support/AccountServiceTrait.php
|
||||
opt/app/app/Services/Internal/Support/BillServiceTrait.php
|
||||
opt/app/app/Services/Internal/Support/JournalServiceTrait.php
|
||||
opt/app/app/Services/Internal/Support/TransactionServiceTrait.php
|
||||
opt/app/app/Services/Internal/Update/AccountUpdateService.php
|
||||
opt/app/app/Services/Internal/Update/BillUpdateService.php
|
||||
opt/app/app/Services/Internal/Update/CategoryUpdateService.php
|
||||
opt/app/app/Services/Internal/Update/CurrencyUpdateService.php
|
||||
opt/app/app/Services/Internal/Update/JournalUpdateService.php
|
||||
opt/app/app/Services/Internal/Update/TransactionUpdateService.php
|
||||
opt/app/app/Services/Password/PwndVerifier.php
|
||||
opt/app/app/Services/Password/PwndVerifierV2.php
|
||||
opt/app/app/Services/Password/Verifier.php
|
||||
opt/app/app/Services/Spectre/Exception/DuplicatedCustomerException.php
|
||||
opt/app/app/Services/Spectre/Exception/SpectreException.php
|
||||
@@ -711,6 +726,7 @@ opt/app/app/Support/Facades/Navigation.php
|
||||
opt/app/app/Support/Facades/Preferences.php
|
||||
opt/app/app/Support/Facades/Steam.php
|
||||
opt/app/app/Support/FireflyConfig.php
|
||||
opt/app/app/Support/Import/Configuration/Bunq/HaveAccounts.php
|
||||
opt/app/app/Support/Import/Configuration/ConfigurationInterface.php
|
||||
opt/app/app/Support/Import/Configuration/File/Initial.php
|
||||
opt/app/app/Support/Import/Configuration/File/Map.php
|
||||
@@ -824,8 +840,10 @@ opt/app/config/database.php
|
||||
opt/app/config/filesystems.php
|
||||
opt/app/config/firefly.php
|
||||
opt/app/config/google2fa.php
|
||||
opt/app/config/hashing.php
|
||||
opt/app/config/import.php
|
||||
opt/app/config/intro.php
|
||||
opt/app/config/logging.php
|
||||
opt/app/config/mail.php
|
||||
opt/app/config/queue.php
|
||||
opt/app/config/services.php
|
||||
@@ -834,6 +852,7 @@ opt/app/config/twigbridge.php
|
||||
opt/app/config/upgrade.php
|
||||
opt/app/config/view.php
|
||||
opt/app/database/factories/ModelFactory.php
|
||||
opt/app/database/migrations
|
||||
opt/app/database/migrations/2016_06_16_000000_create_support_tables.php
|
||||
opt/app/database/migrations/2016_06_16_000001_create_users_table.php
|
||||
opt/app/database/migrations/2016_06_16_000002_create_main_tables.php
|
||||
@@ -853,7 +872,9 @@ opt/app/database/migrations/2018_01_01_000002_create_oauth_access_tokens_table.p
|
||||
opt/app/database/migrations/2018_01_01_000003_create_oauth_refresh_tokens_table.php
|
||||
opt/app/database/migrations/2018_01_01_000004_create_oauth_clients_table.php
|
||||
opt/app/database/migrations/2018_01_01_000005_create_oauth_personal_access_clients_table.php
|
||||
opt/app/database/migrations/2018_03_19_141348_changes_for_v472.php
|
||||
opt/app/database/seeds/AccountTypeSeeder.php
|
||||
opt/app/database/seeds/ConfigSeeder.php
|
||||
opt/app/database/seeds/DatabaseSeeder.php
|
||||
opt/app/database/seeds/LinkTypeSeeder.php
|
||||
opt/app/database/seeds/PermissionSeeder.php
|
||||
@@ -1046,6 +1067,7 @@ opt/app/public/js/ff/guest.js
|
||||
opt/app/public/js/ff/help.js
|
||||
opt/app/public/js/ff/import/status.js
|
||||
opt/app/public/js/ff/index.js
|
||||
opt/app/public/js/ff/install/index.js
|
||||
opt/app/public/js/ff/intro/intro.js
|
||||
opt/app/public/js/ff/piggy-banks/create.js
|
||||
opt/app/public/js/ff/piggy-banks/edit.js
|
||||
@@ -1085,6 +1107,7 @@ opt/app/public/js/lib/bootstrap-sortable.js
|
||||
opt/app/public/js/lib/bootstrap-tagsinput.min.js
|
||||
opt/app/public/js/lib/bootstrap-tagsinput.min.js.map
|
||||
opt/app/public/js/lib/bootstrap3-typeahead.min.js
|
||||
opt/app/public/js/lib/chartjs-plugin-annotation.min.js
|
||||
opt/app/public/js/lib/daterangepicker.js
|
||||
opt/app/public/js/lib/html5shiv.min.js
|
||||
opt/app/public/js/lib/jquery-ui.min.js
|
||||
@@ -1115,7 +1138,6 @@ opt/app/public/lib/leaflet/leaflet.js.map
|
||||
opt/app/public/manifest.json
|
||||
opt/app/public/mix-manifest.json
|
||||
opt/app/public/mstile-150x150.png
|
||||
opt/app/public/report.html
|
||||
opt/app/public/robots.txt
|
||||
opt/app/public/safari-pinned-tab.svg
|
||||
opt/app/public/web.config
|
||||
@@ -1128,7 +1150,6 @@ opt/app/resources/assets/js/components/passport/AuthorizedClients.vue
|
||||
opt/app/resources/assets/js/components/passport/Clients.vue
|
||||
opt/app/resources/assets/js/components/passport/PersonalAccessTokens.vue
|
||||
opt/app/resources/assets/js/lang.js
|
||||
opt/app/resources/assets/js/messages.js
|
||||
opt/app/resources/assets/sass/_variables.scss
|
||||
opt/app/resources/assets/sass/app.scss
|
||||
opt/app/resources/lang/de_DE/auth.php
|
||||
@@ -1208,6 +1229,21 @@ opt/app/resources/lang/id_ID/list.php
|
||||
opt/app/resources/lang/id_ID/pagination.php
|
||||
opt/app/resources/lang/id_ID/passwords.php
|
||||
opt/app/resources/lang/id_ID/validation.php
|
||||
opt/app/resources/lang/it_IT/auth.php
|
||||
opt/app/resources/lang/it_IT/bank.php
|
||||
opt/app/resources/lang/it_IT/breadcrumbs.php
|
||||
opt/app/resources/lang/it_IT/components.php
|
||||
opt/app/resources/lang/it_IT/config.php
|
||||
opt/app/resources/lang/it_IT/csv.php
|
||||
opt/app/resources/lang/it_IT/demo.php
|
||||
opt/app/resources/lang/it_IT/firefly.php
|
||||
opt/app/resources/lang/it_IT/form.php
|
||||
opt/app/resources/lang/it_IT/import.php
|
||||
opt/app/resources/lang/it_IT/intro.php
|
||||
opt/app/resources/lang/it_IT/list.php
|
||||
opt/app/resources/lang/it_IT/pagination.php
|
||||
opt/app/resources/lang/it_IT/passwords.php
|
||||
opt/app/resources/lang/it_IT/validation.php
|
||||
opt/app/resources/lang/nl_NL/auth.php
|
||||
opt/app/resources/lang/nl_NL/bank.php
|
||||
opt/app/resources/lang/nl_NL/breadcrumbs.php
|
||||
@@ -1289,7 +1325,6 @@ opt/app/resources/stubs/binary.bin
|
||||
opt/app/resources/stubs/csv.csv
|
||||
opt/app/resources/stubs/demo-configuration.json
|
||||
opt/app/resources/stubs/demo-import.csv
|
||||
opt/app/resources/tests/blns.base64.json
|
||||
opt/app/resources/views/accounts/create.twig
|
||||
opt/app/resources/views/accounts/delete.twig
|
||||
opt/app/resources/views/accounts/edit.twig
|
||||
@@ -1400,6 +1435,7 @@ opt/app/resources/views/form/tags.twig
|
||||
opt/app/resources/views/form/text.twig
|
||||
opt/app/resources/views/form/textarea.twig
|
||||
opt/app/resources/views/import/bank/form.twig
|
||||
opt/app/resources/views/import/bunq/accounts.twig
|
||||
opt/app/resources/views/import/bunq/prerequisites.twig
|
||||
opt/app/resources/views/import/file/initial.twig
|
||||
opt/app/resources/views/import/file/map.twig
|
||||
@@ -1411,6 +1447,7 @@ opt/app/resources/views/import/spectre/prerequisites.twig
|
||||
opt/app/resources/views/import/spectre/redirect.twig
|
||||
opt/app/resources/views/import/status.twig
|
||||
opt/app/resources/views/index.twig
|
||||
opt/app/resources/views/install/index.twig
|
||||
opt/app/resources/views/javascript/accounts.twig
|
||||
opt/app/resources/views/javascript/currencies.twig
|
||||
opt/app/resources/views/javascript/variables.twig
|
||||
@@ -1418,6 +1455,7 @@ opt/app/resources/views/json/piggy-banks.twig
|
||||
opt/app/resources/views/layout/default.twig
|
||||
opt/app/resources/views/layout/empty.twig
|
||||
opt/app/resources/views/layout/guest.twig
|
||||
opt/app/resources/views/layout/install.twig
|
||||
opt/app/resources/views/list/accounts.twig
|
||||
opt/app/resources/views/list/bills.twig
|
||||
opt/app/resources/views/list/categories.twig
|
||||
@@ -1451,10 +1489,10 @@ opt/app/resources/views/popup/report/budget-spent-amount.twig
|
||||
opt/app/resources/views/popup/report/category-entry.twig
|
||||
opt/app/resources/views/popup/report/expense-entry.twig
|
||||
opt/app/resources/views/popup/report/income-entry.twig
|
||||
opt/app/resources/views/preferences/code.twig
|
||||
opt/app/resources/views/preferences/index.twig
|
||||
opt/app/resources/views/profile/change-email.twig
|
||||
opt/app/resources/views/profile/change-password.twig
|
||||
opt/app/resources/views/profile/code.twig
|
||||
opt/app/resources/views/profile/delete-account.twig
|
||||
opt/app/resources/views/profile/index.twig
|
||||
opt/app/resources/views/reports/account/report.twig
|
||||
@@ -1523,6 +1561,7 @@ opt/app/routes/breadcrumbs.php
|
||||
opt/app/routes/channels.php
|
||||
opt/app/routes/console.php
|
||||
opt/app/routes/web.php
|
||||
opt/app/security.txt
|
||||
opt/app/server.php
|
||||
opt/app/storage
|
||||
opt/app/vendor/autoload.php
|
||||
@@ -1801,6 +1840,7 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ArrayStatement.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/CacheException.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/QueryCacheProfile.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/ColumnCase.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Configuration.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/ConnectionException.php
|
||||
@@ -1856,6 +1896,7 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/ServerInfoAwareConnection.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Statement.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/StatementIterator.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/ConnectionEventArgs.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Event/Listeners/MysqlSessionInit.php
|
||||
@@ -1892,6 +1933,7 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Exception/SyntaxErrorException.ph
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Exception/TableExistsException.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Exception/TableNotFoundException.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Exception/UniqueConstraintViolationException.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/FetchMode.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Id/TableGenerator.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Id/TableGeneratorSchemaVisitor.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/LockMode.php
|
||||
@@ -1899,16 +1941,20 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/DebugStack.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/EchoSQLLogger.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/LoggerChain.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Logging/SQLLogger.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/ParameterType.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DB2Platform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DateIntervalUnit.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DB2Keywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/KeywordList.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MariaDb102Keywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQL57Keywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL100Keywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL91Keywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL92Keywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/PostgreSQL94Keywords.php
|
||||
@@ -1923,9 +1969,11 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2008K
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2012Keywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLServerKeywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/SQLiteKeywords.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MariaDb1027Platform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySQL57Platform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/OraclePlatform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL100Platform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL91Platform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL92Platform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/PostgreSQL94Platform.php
|
||||
@@ -1940,6 +1988,7 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.p
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServer2012Platform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/TrimMode.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Connection.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Portability/Statement.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php
|
||||
@@ -2000,6 +2049,7 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWor
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Tools/Console/Helper/ConnectionHelper.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/TransactionIsolationLevel.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ArrayType.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BigIntType.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/BinaryType.php
|
||||
@@ -2020,6 +2070,8 @@ opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/IntegerType.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/JsonArrayType.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/JsonType.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ObjectType.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/PhpDateTimeMappingType.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/PhpIntegerMappingType.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SimpleArrayType.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/SmallIntType.php
|
||||
opt/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/StringType.php
|
||||
@@ -2039,6 +2091,28 @@ opt/app/vendor/doctrine/lexer/LICENSE
|
||||
opt/app/vendor/doctrine/lexer/README.md
|
||||
opt/app/vendor/doctrine/lexer/composer.json
|
||||
opt/app/vendor/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/.editorconfig
|
||||
opt/app/vendor/dragonmantank/cron-expression/CHANGELOG.md
|
||||
opt/app/vendor/dragonmantank/cron-expression/LICENSE
|
||||
opt/app/vendor/dragonmantank/cron-expression/README.md
|
||||
opt/app/vendor/dragonmantank/cron-expression/composer.json
|
||||
opt/app/vendor/dragonmantank/cron-expression/src/Cron/AbstractField.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/src/Cron/DayOfMonthField.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/src/Cron/DayOfWeekField.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/src/Cron/FieldFactory.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/src/Cron/FieldInterface.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/src/Cron/HoursField.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/src/Cron/MinutesField.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/src/Cron/MonthField.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/AbstractFieldTest.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/CronExpressionTest.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/DayOfMonthFieldTest.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/DayOfWeekFieldTest.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/FieldFactoryTest.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/HoursFieldTest.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/MinutesFieldTest.php
|
||||
opt/app/vendor/dragonmantank/cron-expression/tests/Cron/MonthFieldTest.php
|
||||
opt/app/vendor/egulias/email-validator/EmailValidator/EmailLexer.php
|
||||
opt/app/vendor/egulias/email-validator/EmailValidator/EmailParser.php
|
||||
opt/app/vendor/egulias/email-validator/EmailValidator/EmailValidator.php
|
||||
@@ -2323,15 +2397,17 @@ opt/app/vendor/laravel/framework/src/Illuminate/Console/Events/CommandStarting.p
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/GeneratorCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/OutputStyle.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Parser.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheMutex.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheEventMutex.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CacheSchedulingMutex.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CallbackEvent.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/CommandBuilder.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/EventMutex.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ManagesFrequencies.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Mutex.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/Schedule.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleFinishCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/ScheduleRunCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/Scheduling/SchedulingMutex.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Console/composer.json
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Container/Container.php
|
||||
@@ -2382,7 +2458,6 @@ opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Filesystem/Filesystem.
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Foundation/Application.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Hashing/Hasher.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Http/Kernel.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Logging/Log.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Mail/MailQueue.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Mail/Mailable.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Contracts/Mail/Mailer.php
|
||||
@@ -2589,6 +2664,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingChain.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingDispatch.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/ComposerScripts.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/AppNameCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ChannelMakeCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClearCompiledCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ClosureCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ConfigCacheCommand.php
|
||||
@@ -2606,7 +2682,6 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ListenerMakeC
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/MailMakeCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ModelMakeCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/NotificationMakeCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/PackageDiscoverCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/PolicyMakeCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/PresetCommand.php
|
||||
@@ -2635,7 +2710,9 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/StorageLinkCo
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/TestMakeCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/UpCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/VendorPublishCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ViewCacheCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/ViewClearCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/channel.stub
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/console.stub
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/event-handler-queued.stub
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/stubs/event-handler.stub
|
||||
@@ -2671,6 +2748,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/EnvironmentDetector.p
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Events/Dispatchable.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Events/LocaleUpdated.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/WhoopsHandler.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/404.blade.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/419.blade.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/429.blade.php
|
||||
@@ -2708,6 +2786,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/Inte
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MocksApplicationServices.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/HasInDatabase.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/SeeInOrder.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Constraints/SoftDeletedInDatabase.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseTransactions.php
|
||||
@@ -2722,7 +2801,9 @@ opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Testing/WithoutMiddle
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/Validation/ValidatesRequests.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Foundation/stubs/facade.stub
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Hashing/ArgonHasher.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Hashing/BcryptHasher.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Hashing/HashManager.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Hashing/HashServiceProvider.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Hashing/composer.json
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithContentTypes.php
|
||||
@@ -2730,17 +2811,20 @@ opt/app/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithFlash
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Concerns/InteractsWithInput.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Exceptions/HttpResponseException.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Exceptions/PostTooLargeException.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Exceptions/ThrottleRequestsException.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/File.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/FileHelpers.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/CheckResponseForModifications.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/FrameGuard.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Middleware/SetCacheHeaders.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/RedirectResponse.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Request.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/CollectsResources.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/DelegatesToResource.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/Resource.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/ResourceCollection.php
|
||||
@@ -2756,8 +2840,9 @@ opt/app/vendor/laravel/framework/src/Illuminate/Http/Testing/MimeType.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/UploadedFile.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Http/composer.json
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Log/Events/MessageLogged.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Log/LogManager.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Log/LogServiceProvider.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Log/Writer.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Log/Logger.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Log/composer.json
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSending.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Mail/Events/MessageSent.php
|
||||
@@ -2922,7 +3007,10 @@ opt/app/vendor/laravel/framework/src/Illuminate/Redis/RedisServiceProvider.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Redis/composer.json
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/ControllerMakeCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/MiddlewareMakeCommand.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.api.stub
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.model.api.stub
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.model.stub
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.nested.api.stub
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.nested.stub
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.plain.stub
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Console/stubs/controller.stub
|
||||
@@ -2932,6 +3020,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerMiddlewareOptions.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Events/RouteMatched.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/InvalidSignatureException.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Exceptions/UrlGenerationException.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/ImplicitRouteBinding.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Matching/HostValidator.php
|
||||
@@ -2942,6 +3031,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Routing/Matching/ValidatorInterf
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequestsWithRedis.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ValidateSignature.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/MiddlewareNameResolver.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/PendingResourceRegistration.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php
|
||||
@@ -3043,6 +3133,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/Notificati
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/PendingMailFake.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Support/Testing/Fakes/QueueFake.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Support/Traits/CapsuleManagerTrait.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Support/ViewErrorBag.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/Support/composer.json
|
||||
@@ -3083,6 +3174,7 @@ opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/Compiles
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesComponents.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesEchos.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesHelpers.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesIncludes.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesInjections.php
|
||||
opt/app/vendor/laravel/framework/src/Illuminate/View/Compilers/Concerns/CompilesJson.php
|
||||
@@ -3265,7 +3357,7 @@ opt/app/vendor/lcobucci/jwt/test/unit/TokenTest.php
|
||||
opt/app/vendor/lcobucci/jwt/test/unit/ValidationDataTest.php
|
||||
opt/app/vendor/league/commonmark/.styleci.yml
|
||||
opt/app/vendor/league/commonmark/CHANGELOG.md
|
||||
opt/app/vendor/league/commonmark/CONDUCT.md
|
||||
opt/app/vendor/league/commonmark/CODE_OF_CONDUCT.md
|
||||
opt/app/vendor/league/commonmark/CONTRIBUTING.md
|
||||
opt/app/vendor/league/commonmark/LICENSE
|
||||
opt/app/vendor/league/commonmark/README.md
|
||||
@@ -3378,6 +3470,7 @@ opt/app/vendor/league/commonmark/src/Util/LinkParserHelper.php
|
||||
opt/app/vendor/league/commonmark/src/Util/RegexHelper.php
|
||||
opt/app/vendor/league/commonmark/src/Util/UrlEncoder.php
|
||||
opt/app/vendor/league/commonmark/src/Util/Xml.php
|
||||
opt/app/vendor/league/csv/CHANGELOG.md
|
||||
opt/app/vendor/league/csv/LICENSE
|
||||
opt/app/vendor/league/csv/autoload.php
|
||||
opt/app/vendor/league/csv/composer.json
|
||||
@@ -3721,32 +3814,9 @@ opt/app/vendor/monolog/monolog/tests/Monolog/Processor/WebProcessorTest.php
|
||||
opt/app/vendor/monolog/monolog/tests/Monolog/PsrLogCompatTest.php
|
||||
opt/app/vendor/monolog/monolog/tests/Monolog/RegistryTest.php
|
||||
opt/app/vendor/monolog/monolog/tests/Monolog/TestCase.php
|
||||
opt/app/vendor/mtdowling/cron-expression/.editorconfig
|
||||
opt/app/vendor/mtdowling/cron-expression/CHANGELOG.md
|
||||
opt/app/vendor/mtdowling/cron-expression/LICENSE
|
||||
opt/app/vendor/mtdowling/cron-expression/README.md
|
||||
opt/app/vendor/mtdowling/cron-expression/composer.json
|
||||
opt/app/vendor/mtdowling/cron-expression/src/Cron/AbstractField.php
|
||||
opt/app/vendor/mtdowling/cron-expression/src/Cron/CronExpression.php
|
||||
opt/app/vendor/mtdowling/cron-expression/src/Cron/DayOfMonthField.php
|
||||
opt/app/vendor/mtdowling/cron-expression/src/Cron/DayOfWeekField.php
|
||||
opt/app/vendor/mtdowling/cron-expression/src/Cron/FieldFactory.php
|
||||
opt/app/vendor/mtdowling/cron-expression/src/Cron/FieldInterface.php
|
||||
opt/app/vendor/mtdowling/cron-expression/src/Cron/HoursField.php
|
||||
opt/app/vendor/mtdowling/cron-expression/src/Cron/MinutesField.php
|
||||
opt/app/vendor/mtdowling/cron-expression/src/Cron/MonthField.php
|
||||
opt/app/vendor/mtdowling/cron-expression/src/Cron/YearField.php
|
||||
opt/app/vendor/mtdowling/cron-expression/tests/Cron/AbstractFieldTest.php
|
||||
opt/app/vendor/mtdowling/cron-expression/tests/Cron/CronExpressionTest.php
|
||||
opt/app/vendor/mtdowling/cron-expression/tests/Cron/DayOfMonthFieldTest.php
|
||||
opt/app/vendor/mtdowling/cron-expression/tests/Cron/DayOfWeekFieldTest.php
|
||||
opt/app/vendor/mtdowling/cron-expression/tests/Cron/FieldFactoryTest.php
|
||||
opt/app/vendor/mtdowling/cron-expression/tests/Cron/HoursFieldTest.php
|
||||
opt/app/vendor/mtdowling/cron-expression/tests/Cron/MinutesFieldTest.php
|
||||
opt/app/vendor/mtdowling/cron-expression/tests/Cron/MonthFieldTest.php
|
||||
opt/app/vendor/mtdowling/cron-expression/tests/Cron/YearFieldTest.php
|
||||
opt/app/vendor/nesbot/carbon/.php_cs.dist
|
||||
opt/app/vendor/nesbot/carbon/LICENSE
|
||||
opt/app/vendor/nesbot/carbon/build.php
|
||||
opt/app/vendor/nesbot/carbon/composer.json
|
||||
opt/app/vendor/nesbot/carbon/readme.md
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Carbon.php
|
||||
@@ -3774,6 +3844,7 @@ opt/app/vendor/nesbot/carbon/src/Carbon/Lang/fi.php
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/fo.php
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/fr.php
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/gl.php
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/gu.php
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/he.php
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/hr.php
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/hu.php
|
||||
@@ -3815,7 +3886,7 @@ opt/app/vendor/nesbot/carbon/src/Carbon/Lang/uz.php
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/vi.php
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/zh.php
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php
|
||||
opt/app/vendor/nesbot/carbon/trigger
|
||||
opt/app/vendor/nesbot/carbon/src/Carbon/Translator.php
|
||||
opt/app/vendor/paragonie/constant_time_encoding/LICENSE.txt
|
||||
opt/app/vendor/paragonie/constant_time_encoding/README.md
|
||||
opt/app/vendor/paragonie/constant_time_encoding/composer.json
|
||||
@@ -3889,16 +3960,23 @@ opt/app/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php
|
||||
opt/app/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php
|
||||
opt/app/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php
|
||||
opt/app/vendor/phpseclib/phpseclib/phpseclib/openssl.cnf
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/CHANGELOG.md
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/LICENSE
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/changelog.md
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/README.md
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/composer.json
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/docs/middleware.jpg
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/phpspec.yml
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/readme.md
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/EmptyOneTimePasswordReceived.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/LoggedOut.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/LoginFailed.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/LoginSucceeded.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/OneTimePasswordExpired.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/OneTimePasswordRequested.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Events/OneTimePasswordRequested53.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Exceptions/InvalidOneTimePassword.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Exceptions/InvalidSecretKey.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Facade.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Google2FA.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Middleware.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/ServiceProvider.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Support/Auth.php
|
||||
@@ -3911,14 +3989,21 @@ opt/app/vendor/pragmarx/google2fa-laravel/src/Support/Request.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Support/Response.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/Support/Session.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/src/config/config.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/tests/spec/Support/AuthenticatorSpec.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/tests/Google2FaLaravelTest.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/tests/Support/User.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/tests/TestCase.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/tests/bootstrap.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/tests/views/google2fa/index.blade.php
|
||||
opt/app/vendor/pragmarx/google2fa-laravel/upgrading.md
|
||||
opt/app/vendor/pragmarx/google2fa/LICENSE
|
||||
opt/app/vendor/pragmarx/google2fa/LICENSE.md
|
||||
opt/app/vendor/pragmarx/google2fa/README.md
|
||||
opt/app/vendor/pragmarx/google2fa/RELICENSED.md
|
||||
opt/app/vendor/pragmarx/google2fa/changelog.md
|
||||
opt/app/vendor/pragmarx/google2fa/composer.json
|
||||
opt/app/vendor/pragmarx/google2fa/composer.lock
|
||||
opt/app/vendor/pragmarx/google2fa/docs/playground.jpg
|
||||
opt/app/vendor/pragmarx/google2fa/src/Exceptions/IncompatibleWithGoogleAuthenticatorException.php
|
||||
opt/app/vendor/pragmarx/google2fa/src/Exceptions/InsecureCallException.php
|
||||
opt/app/vendor/pragmarx/google2fa/src/Exceptions/InvalidCharactersException.php
|
||||
opt/app/vendor/pragmarx/google2fa/src/Exceptions/SecretKeyTooShortException.php
|
||||
opt/app/vendor/pragmarx/google2fa/src/Google2FA.php
|
||||
@@ -4503,7 +4588,6 @@ opt/app/vendor/symfony/console/Descriptor/XmlDescriptor.php
|
||||
opt/app/vendor/symfony/console/Event/ConsoleCommandEvent.php
|
||||
opt/app/vendor/symfony/console/Event/ConsoleErrorEvent.php
|
||||
opt/app/vendor/symfony/console/Event/ConsoleEvent.php
|
||||
opt/app/vendor/symfony/console/Event/ConsoleExceptionEvent.php
|
||||
opt/app/vendor/symfony/console/Event/ConsoleTerminateEvent.php
|
||||
opt/app/vendor/symfony/console/EventListener/ErrorListener.php
|
||||
opt/app/vendor/symfony/console/Exception/CommandNotFoundException.php
|
||||
@@ -4877,7 +4961,6 @@ opt/app/vendor/symfony/debug/Debug.php
|
||||
opt/app/vendor/symfony/debug/DebugClassLoader.php
|
||||
opt/app/vendor/symfony/debug/ErrorHandler.php
|
||||
opt/app/vendor/symfony/debug/Exception/ClassNotFoundException.php
|
||||
opt/app/vendor/symfony/debug/Exception/ContextErrorException.php
|
||||
opt/app/vendor/symfony/debug/Exception/FatalErrorException.php
|
||||
opt/app/vendor/symfony/debug/Exception/FatalThrowableError.php
|
||||
opt/app/vendor/symfony/debug/Exception/FlattenException.php
|
||||
@@ -4892,15 +4975,6 @@ opt/app/vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandle
|
||||
opt/app/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
|
||||
opt/app/vendor/symfony/debug/LICENSE
|
||||
opt/app/vendor/symfony/debug/README.md
|
||||
opt/app/vendor/symfony/debug/Resources/ext/README.md
|
||||
opt/app/vendor/symfony/debug/Resources/ext/config.m4
|
||||
opt/app/vendor/symfony/debug/Resources/ext/config.w32
|
||||
opt/app/vendor/symfony/debug/Resources/ext/php_symfony_debug.h
|
||||
opt/app/vendor/symfony/debug/Resources/ext/symfony_debug.c
|
||||
opt/app/vendor/symfony/debug/Resources/ext/tests/001.phpt
|
||||
opt/app/vendor/symfony/debug/Resources/ext/tests/002.phpt
|
||||
opt/app/vendor/symfony/debug/Resources/ext/tests/002_1.phpt
|
||||
opt/app/vendor/symfony/debug/Resources/ext/tests/003.phpt
|
||||
opt/app/vendor/symfony/debug/Tests/DebugClassLoaderTest.php
|
||||
opt/app/vendor/symfony/debug/Tests/ErrorHandlerTest.php
|
||||
opt/app/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php
|
||||
@@ -4963,7 +5037,6 @@ opt/app/vendor/symfony/finder/Comparator/Comparator.php
|
||||
opt/app/vendor/symfony/finder/Comparator/DateComparator.php
|
||||
opt/app/vendor/symfony/finder/Comparator/NumberComparator.php
|
||||
opt/app/vendor/symfony/finder/Exception/AccessDeniedException.php
|
||||
opt/app/vendor/symfony/finder/Exception/ExceptionInterface.php
|
||||
opt/app/vendor/symfony/finder/Finder.php
|
||||
opt/app/vendor/symfony/finder/Glob.php
|
||||
opt/app/vendor/symfony/finder/Iterator/CustomFilterIterator.php
|
||||
@@ -4973,7 +5046,6 @@ opt/app/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php
|
||||
opt/app/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php
|
||||
opt/app/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php
|
||||
opt/app/vendor/symfony/finder/Iterator/FilenameFilterIterator.php
|
||||
opt/app/vendor/symfony/finder/Iterator/FilterIterator.php
|
||||
opt/app/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php
|
||||
opt/app/vendor/symfony/finder/Iterator/PathFilterIterator.php
|
||||
opt/app/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php
|
||||
@@ -5012,7 +5084,6 @@ opt/app/vendor/symfony/finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.
|
||||
opt/app/vendor/symfony/finder/Tests/Iterator/FileTypeFilterIteratorTest.php
|
||||
opt/app/vendor/symfony/finder/Tests/Iterator/FilecontentFilterIteratorTest.php
|
||||
opt/app/vendor/symfony/finder/Tests/Iterator/FilenameFilterIteratorTest.php
|
||||
opt/app/vendor/symfony/finder/Tests/Iterator/FilterIteratorTest.php
|
||||
opt/app/vendor/symfony/finder/Tests/Iterator/Iterator.php
|
||||
opt/app/vendor/symfony/finder/Tests/Iterator/IteratorTestCase.php
|
||||
opt/app/vendor/symfony/finder/Tests/Iterator/MockFileListIterator.php
|
||||
@@ -5076,22 +5147,18 @@ opt/app/vendor/symfony/http-foundation/Session/SessionBagInterface.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/SessionBagProxy.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/SessionInterface.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/NativeSessionHandler.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Handler/WriteCheckSessionHandler.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php
|
||||
opt/app/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php
|
||||
opt/app/vendor/symfony/http-foundation/StreamedResponse.php
|
||||
@@ -5142,22 +5209,18 @@ opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/wi
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie_and_session.expected
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie_and_session.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/WriteCheckSessionHandlerTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/NativeProxyTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/StreamedResponseTest.php
|
||||
opt/app/vendor/symfony/http-foundation/Tests/schema/http-status-codes.rng
|
||||
@@ -5175,7 +5238,6 @@ opt/app/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php
|
||||
opt/app/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerInterface.php
|
||||
opt/app/vendor/symfony/http-kernel/CacheWarmer/WarmableInterface.php
|
||||
opt/app/vendor/symfony/http-kernel/Client.php
|
||||
opt/app/vendor/symfony/http-kernel/Config/EnvParametersResource.php
|
||||
opt/app/vendor/symfony/http-kernel/Config/FileLocator.php
|
||||
opt/app/vendor/symfony/http-kernel/Controller/ArgumentResolver.php
|
||||
opt/app/vendor/symfony/http-kernel/Controller/ArgumentResolver/DefaultValueResolver.php
|
||||
@@ -5208,11 +5270,9 @@ opt/app/vendor/symfony/http-kernel/DataCollector/MemoryDataCollector.php
|
||||
opt/app/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php
|
||||
opt/app/vendor/symfony/http-kernel/DataCollector/RouterDataCollector.php
|
||||
opt/app/vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php
|
||||
opt/app/vendor/symfony/http-kernel/DataCollector/Util/ValueExporter.php
|
||||
opt/app/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php
|
||||
opt/app/vendor/symfony/http-kernel/Debug/TraceableEventDispatcher.php
|
||||
opt/app/vendor/symfony/http-kernel/DependencyInjection/AddAnnotatedClassesToCachePass.php
|
||||
opt/app/vendor/symfony/http-kernel/DependencyInjection/AddClassesToCachePass.php
|
||||
opt/app/vendor/symfony/http-kernel/DependencyInjection/ConfigurableExtension.php
|
||||
opt/app/vendor/symfony/http-kernel/DependencyInjection/ControllerArgumentValueResolverPass.php
|
||||
opt/app/vendor/symfony/http-kernel/DependencyInjection/Extension.php
|
||||
@@ -5307,7 +5367,6 @@ opt/app/vendor/symfony/http-kernel/Tests/CacheClearer/Psr6CacheClearerTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/ClientTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/Config/EnvParametersResourceTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/Config/FileLocatorTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/Controller/ArgumentResolver/ServiceValueResolverTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/Controller/ArgumentResolverTest.php
|
||||
@@ -5324,7 +5383,6 @@ opt/app/vendor/symfony/http-kernel/Tests/DataCollector/LoggerDataCollectorTest.p
|
||||
opt/app/vendor/symfony/http-kernel/Tests/DataCollector/MemoryDataCollectorTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/DataCollector/RequestDataCollectorTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/DataCollector/TimeDataCollectorTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/DataCollector/Util/ValueExporterTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/Debug/FileLinkFormatterTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/Debug/TraceableEventDispatcherTest.php
|
||||
opt/app/vendor/symfony/http-kernel/Tests/DependencyInjection/AddAnnotatedClassesToCachePassTest.php
|
||||
@@ -5442,18 +5500,11 @@ opt/app/vendor/symfony/polyfill-php56/Php56.php
|
||||
opt/app/vendor/symfony/polyfill-php56/README.md
|
||||
opt/app/vendor/symfony/polyfill-php56/bootstrap.php
|
||||
opt/app/vendor/symfony/polyfill-php56/composer.json
|
||||
opt/app/vendor/symfony/polyfill-php70/LICENSE
|
||||
opt/app/vendor/symfony/polyfill-php70/Php70.php
|
||||
opt/app/vendor/symfony/polyfill-php70/README.md
|
||||
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php
|
||||
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/AssertionError.php
|
||||
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php
|
||||
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/Error.php
|
||||
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/ParseError.php
|
||||
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php
|
||||
opt/app/vendor/symfony/polyfill-php70/Resources/stubs/TypeError.php
|
||||
opt/app/vendor/symfony/polyfill-php70/bootstrap.php
|
||||
opt/app/vendor/symfony/polyfill-php70/composer.json
|
||||
opt/app/vendor/symfony/polyfill-php72/LICENSE
|
||||
opt/app/vendor/symfony/polyfill-php72/Php72.php
|
||||
opt/app/vendor/symfony/polyfill-php72/README.md
|
||||
opt/app/vendor/symfony/polyfill-php72/bootstrap.php
|
||||
opt/app/vendor/symfony/polyfill-php72/composer.json
|
||||
opt/app/vendor/symfony/polyfill-util/Binary.php
|
||||
opt/app/vendor/symfony/polyfill-util/BinaryNoFuncOverload.php
|
||||
opt/app/vendor/symfony/polyfill-util/BinaryOnFuncOverload.php
|
||||
@@ -5480,7 +5531,6 @@ opt/app/vendor/symfony/process/Pipes/PipesInterface.php
|
||||
opt/app/vendor/symfony/process/Pipes/UnixPipes.php
|
||||
opt/app/vendor/symfony/process/Pipes/WindowsPipes.php
|
||||
opt/app/vendor/symfony/process/Process.php
|
||||
opt/app/vendor/symfony/process/ProcessBuilder.php
|
||||
opt/app/vendor/symfony/process/ProcessUtils.php
|
||||
opt/app/vendor/symfony/process/README.md
|
||||
opt/app/vendor/symfony/process/Tests/ExecutableFinderTest.php
|
||||
@@ -5488,10 +5538,8 @@ opt/app/vendor/symfony/process/Tests/NonStopableProcess.php
|
||||
opt/app/vendor/symfony/process/Tests/PhpExecutableFinderTest.php
|
||||
opt/app/vendor/symfony/process/Tests/PhpProcessTest.php
|
||||
opt/app/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php
|
||||
opt/app/vendor/symfony/process/Tests/ProcessBuilderTest.php
|
||||
opt/app/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php
|
||||
opt/app/vendor/symfony/process/Tests/ProcessTest.php
|
||||
opt/app/vendor/symfony/process/Tests/ProcessUtilsTest.php
|
||||
opt/app/vendor/symfony/process/Tests/SignalListener.php
|
||||
opt/app/vendor/symfony/process/composer.json
|
||||
opt/app/vendor/symfony/process/phpunit.xml.dist
|
||||
@@ -5614,6 +5662,17 @@ opt/app/vendor/symfony/routing/Tests/Fixtures/empty.yml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/file_resource.yml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/foo.xml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/foo1.xml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/bar.xml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/bar.yml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/baz.xml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/baz.yml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.xml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.yml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/import_single.xml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/import_single.yml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/php_dsl.php
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/php_dsl_bar.php
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/glob/php_dsl_baz.php
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/incomplete.yml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/list_defaults.xml
|
||||
opt/app/vendor/symfony/routing/Tests/Fixtures/list_in_list_defaults.xml
|
||||
@@ -5863,7 +5922,6 @@ opt/app/vendor/symfony/var-dumper/Caster/EnumStub.php
|
||||
opt/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php
|
||||
opt/app/vendor/symfony/var-dumper/Caster/FrameStub.php
|
||||
opt/app/vendor/symfony/var-dumper/Caster/LinkStub.php
|
||||
opt/app/vendor/symfony/var-dumper/Caster/MongoCaster.php
|
||||
opt/app/vendor/symfony/var-dumper/Caster/PdoCaster.php
|
||||
opt/app/vendor/symfony/var-dumper/Caster/PgSqlCaster.php
|
||||
opt/app/vendor/symfony/var-dumper/Caster/RedisCaster.php
|
||||
@@ -6538,6 +6596,7 @@ opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/simple.test
|
||||
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs.test
|
||||
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/varargs_argument.test
|
||||
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/macros/with_filters.test
|
||||
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/block_names_unicity.test
|
||||
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/combined_debug_info.test
|
||||
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/empty_token.test
|
||||
opt/app/vendor/twig/twig/test/Twig/Tests/Fixtures/regression/issue_1143.test
|
||||
@@ -6776,16 +6835,6 @@ opt/app/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php
|
||||
opt/app/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php
|
||||
opt/app/vendor/vlucas/phpdotenv/src/Loader.php
|
||||
opt/app/vendor/vlucas/phpdotenv/src/Validator.php
|
||||
opt/app/vendor/watson/validating/LICENSE.txt
|
||||
opt/app/vendor/watson/validating/README.md
|
||||
opt/app/vendor/watson/validating/composer.json
|
||||
opt/app/vendor/watson/validating/src/Injectors/UniqueInjector.php
|
||||
opt/app/vendor/watson/validating/src/Injectors/UniqueWithInjector.php
|
||||
opt/app/vendor/watson/validating/src/ValidatingInterface.php
|
||||
opt/app/vendor/watson/validating/src/ValidatingModel.php
|
||||
opt/app/vendor/watson/validating/src/ValidatingObserver.php
|
||||
opt/app/vendor/watson/validating/src/ValidatingTrait.php
|
||||
opt/app/vendor/watson/validating/src/ValidationException.php
|
||||
opt/app/vendor/zendframework/zend-diactoros/.coveralls.yml
|
||||
opt/app/vendor/zendframework/zend-diactoros/CHANGELOG.md
|
||||
opt/app/vendor/zendframework/zend-diactoros/CONDUCT.md
|
||||
|
@@ -15,8 +15,8 @@ const pkgdef :Spk.PackageDefinition = (
|
||||
|
||||
manifest = (
|
||||
appTitle = (defaultText = "Firefly III"),
|
||||
appVersion = 9,
|
||||
appMarketingVersion = (defaultText = "4.7.1"),
|
||||
appVersion = 11,
|
||||
appMarketingVersion = (defaultText = "4.7.3"),
|
||||
|
||||
actions = [
|
||||
# Define your "new document" handlers here.
|
||||
|
@@ -14,12 +14,17 @@ apt-get install -y python-software-properties software-properties-common
|
||||
|
||||
# install all languages
|
||||
sed -i 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
|
||||
sed -i 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
sed -i 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
sed -i 's/# id_ID.UTF-8 UTF-8/id_ID.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
sed -i 's/# it_IT.UTF-8 UTF-8/it_IT.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
sed -i 's/# nl_NL.UTF-8 UTF-8/nl_NL.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
sed -i 's/# pl_PL.UTF-8 UTF-8/pl_PL.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
sed -i 's/# pt_BR.UTF-8 UTF-8/pt_BR.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
sed -i 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
sed -i 's/# tr_TR.UTF-8 UTF-8/tr_TR.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
|
||||
dpkg-reconfigure --frontend=noninteractive locales
|
||||
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
language: php
|
||||
php:
|
||||
- 7.1
|
||||
- 7.2
|
||||
|
||||
cache:
|
||||
directories:
|
||||
@@ -12,21 +13,19 @@ install:
|
||||
- composer update --no-scripts
|
||||
- cp .env.testing .env
|
||||
- php artisan clear-compiled
|
||||
- php artisan optimize
|
||||
- php artisan env
|
||||
- cp .env.testing .env
|
||||
- wget -q https://github.com/firefly-iii/test-data/raw/master/storage/database.sqlite -O storage/database/database.sqlite
|
||||
- mkdir -p build/logs
|
||||
|
||||
script:
|
||||
- phpunit -c phpunit.coverage.xml
|
||||
- ./vendor/bin/phpunit -c phpunit.coverage.xml
|
||||
|
||||
after_success:
|
||||
- travis_retry php vendor/bin/php-coveralls -x storage/build/clover-all.xml
|
||||
- bash <(curl -s https://codecov.io/bash) -f storage/build/clover-all.xml
|
||||
|
||||
# safelist
|
||||
branches:
|
||||
only:
|
||||
- develop
|
||||
- master
|
||||
- master
|
||||
|
@@ -28,10 +28,10 @@ RUN apt-get update -y && \
|
||||
RUN docker-php-ext-install -j$(nproc) curl gd intl json readline tidy zip bcmath xml mbstring pdo_sqlite pdo_mysql bz2 pdo_pgsql
|
||||
|
||||
# Generate locales supported by Firefly III
|
||||
RUN echo "de_DE.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nid_ID.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npl_PL.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
|
||||
RUN echo "de_DE.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nes_ES.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nid_ID.UTF-8 UTF-8\nit_IT.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npl_PL.UTF-8 UTF-8pt_BR.UTF-8 UTF-8ru_RU.UTF-8 UTF-8\ntr_TR.UTF-8 UTF-8\n\n" > /etc/locale.gen && locale-gen
|
||||
|
||||
# copy Apache config to correct spot.
|
||||
COPY ./docker/apache2.conf /etc/apache2/apache2.conf
|
||||
COPY ./.deploy/docker/apache2.conf /etc/apache2/apache2.conf
|
||||
|
||||
# Enable apache mod rewrite..
|
||||
RUN a2enmod rewrite
|
||||
@@ -46,7 +46,7 @@ VOLUME $FIREFLY_PATH/storage/export $FIREFLY_PATH/storage/upload
|
||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
# Enable default site (Firefly III)
|
||||
COPY ./docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
|
||||
COPY ./.deploy/docker/apache-firefly.conf /etc/apache2/sites-available/000-default.conf
|
||||
|
||||
# Make sure we own Firefly III directory
|
||||
RUN chown -R www-data:www-data /var/www && chmod -R 775 $FIREFLY_PATH/storage
|
||||
@@ -58,4 +58,4 @@ RUN composer install --prefer-dist --no-dev --no-scripts --no-suggest
|
||||
EXPOSE 80
|
||||
|
||||
# Run entrypoint thing
|
||||
ENTRYPOINT ["docker/entrypoint.sh"]
|
||||
ENTRYPOINT [".deploy/docker/entrypoint.sh"]
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* AboutController.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Controllers;
|
||||
|
||||
@@ -30,23 +30,11 @@ use League\Fractal\Manager;
|
||||
use League\Fractal\Resource\Item;
|
||||
use League\Fractal\Serializer\JsonApiSerializer;
|
||||
|
||||
|
||||
/**
|
||||
* Class AboutController
|
||||
*/
|
||||
class AboutController extends Controller
|
||||
{
|
||||
/**
|
||||
* AccountController constructor.
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
@@ -55,7 +43,7 @@ class AboutController extends Controller
|
||||
$search = ['~', '#'];
|
||||
$replace = ['\~', '# '];
|
||||
$phpVersion = str_replace($search, $replace, PHP_VERSION);
|
||||
$phpOs = str_replace($search, $replace, php_uname());
|
||||
$phpOs = str_replace($search, $replace, PHP_OS);
|
||||
$currentDriver = DB::getDriverName();
|
||||
$data
|
||||
= [
|
||||
@@ -64,7 +52,6 @@ class AboutController extends Controller
|
||||
'php_version' => $phpVersion,
|
||||
'os' => $phpOs,
|
||||
'driver' => $currentDriver,
|
||||
|
||||
];
|
||||
|
||||
return response()->json(['data' => $data], 200)->header('Content-Type', 'application/vnd.api+json');
|
||||
@@ -84,5 +71,4 @@ class AboutController extends Controller
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* AccountController.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Controllers;
|
||||
|
||||
@@ -43,7 +43,6 @@ use Preferences;
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
{
|
||||
|
||||
/** @var CurrencyRepositoryInterface */
|
||||
private $currencyRepository;
|
||||
/** @var AccountRepositoryInterface */
|
||||
@@ -59,7 +58,7 @@ class AccountController extends Controller
|
||||
parent::__construct();
|
||||
$this->middleware(
|
||||
function ($request, $next) {
|
||||
/** @var AccountRepositoryInterface repository */
|
||||
// @var AccountRepositoryInterface repository
|
||||
$this->repository = app(AccountRepositoryInterface::class);
|
||||
$this->repository->setUser(auth()->user());
|
||||
|
||||
@@ -74,7 +73,7 @@ class AccountController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \FireflyIII\Models\Account $account
|
||||
* @param \FireflyIII\Models\Account $account
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
@@ -95,16 +94,16 @@ class AccountController extends Controller
|
||||
public function index(Request $request)
|
||||
{
|
||||
// create some objects:
|
||||
$manager = new Manager();
|
||||
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
|
||||
$manager = new Manager();
|
||||
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
|
||||
|
||||
// read type from URI
|
||||
$type = $request->get('type') ?? 'all';
|
||||
$this->parameters->set('type', $type);
|
||||
|
||||
// types to get, page size:
|
||||
$types = $this->mapTypes($this->parameters->get('type'));
|
||||
$pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data);
|
||||
$types = $this->mapTypes($this->parameters->get('type'));
|
||||
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
|
||||
// get list of accounts. Count it and split it.
|
||||
$collection = $this->repository->getAccountsByType($types);
|
||||
@@ -153,9 +152,9 @@ class AccountController extends Controller
|
||||
{
|
||||
$data = $request->getAll();
|
||||
// if currency ID is 0, find the currency by the code:
|
||||
if ($data['currency_id'] === 0) {
|
||||
if (0 === $data['currency_id']) {
|
||||
$currency = $this->currencyRepository->findByCodeNull($data['currency_code']);
|
||||
$data['currency_id'] = is_null($currency) ? 0 : $currency->id;
|
||||
$data['currency_id'] = null === $currency ? 0 : $currency->id;
|
||||
}
|
||||
$account = $this->repository->store($data);
|
||||
$manager = new Manager();
|
||||
@@ -165,7 +164,6 @@ class AccountController extends Controller
|
||||
$resource = new Item($account, new AccountTransformer($this->parameters), 'accounts');
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,9 +178,9 @@ class AccountController extends Controller
|
||||
{
|
||||
$data = $request->getAll();
|
||||
// if currency ID is 0, find the currency by the code:
|
||||
if ($data['currency_id'] === 0) {
|
||||
if (0 === $data['currency_id']) {
|
||||
$currency = $this->currencyRepository->findByCodeNull($data['currency_code']);
|
||||
$data['currency_id'] = is_null($currency) ? 0 : $currency->id;
|
||||
$data['currency_id'] = null === $currency ? 0 : $currency->id;
|
||||
}
|
||||
// set correct type:
|
||||
$data['type'] = config('firefly.shortNamesByFullName.' . $account->accountType->type);
|
||||
@@ -260,4 +258,4 @@ class AccountController extends Controller
|
||||
|
||||
return $types['all']; // @codeCoverageIgnore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* BillController.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Controllers;
|
||||
|
||||
@@ -27,6 +27,7 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Transformers\BillTransformer;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Collection;
|
||||
use League\Fractal\Manager;
|
||||
@@ -47,7 +48,7 @@ class BillController extends Controller
|
||||
/**
|
||||
* BillController constructor.
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -66,11 +67,11 @@ class BillController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \FireflyIII\Models\Bill $bill
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function delete(Bill $bill)
|
||||
public function delete(Bill $bill): JsonResponse
|
||||
{
|
||||
$this->repository->destroy($bill);
|
||||
|
||||
@@ -82,11 +83,11 @@ class BillController extends Controller
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function index(Request $request)
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data);
|
||||
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$paginator = $this->repository->getPaginator($pageSize);
|
||||
/** @var Collection $bills */
|
||||
$bills = $paginator->getCollection();
|
||||
@@ -106,9 +107,9 @@ class BillController extends Controller
|
||||
* @param Request $request
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function show(Request $request, Bill $bill)
|
||||
public function show(Request $request, Bill $bill): JsonResponse
|
||||
{
|
||||
$manager = new Manager();
|
||||
// add include parameter:
|
||||
@@ -126,18 +127,22 @@ class BillController extends Controller
|
||||
/**
|
||||
* @param BillRequest $request
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function store(BillRequest $request)
|
||||
public function store(BillRequest $request): JsonResponse
|
||||
{
|
||||
$bill = $this->repository->store($request->getAll());
|
||||
$manager = new Manager();
|
||||
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
$bill = $this->repository->store($request->getAll());
|
||||
if (null !== $bill) {
|
||||
$manager = new Manager();
|
||||
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
|
||||
$resource = new Item($bill, new BillTransformer($this->parameters), 'bills');
|
||||
$resource = new Item($bill, new BillTransformer($this->parameters), 'bills');
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
|
||||
}
|
||||
throw new FireflyException('Could not store new bill.'); // @codeCoverageIgnore
|
||||
|
||||
}
|
||||
|
||||
@@ -146,9 +151,9 @@ class BillController extends Controller
|
||||
* @param BillRequest $request
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function update(BillRequest $request, Bill $bill)
|
||||
public function update(BillRequest $request, Bill $bill): JsonResponse
|
||||
{
|
||||
$data = $request->getAll();
|
||||
$bill = $this->repository->update($bill, $data);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* Controller.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Controllers;
|
||||
|
||||
@@ -30,10 +30,12 @@ use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Log;
|
||||
use Symfony\Component\HttpFoundation\ParameterBag;
|
||||
|
||||
/**
|
||||
* Class Controller.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Controller extends BaseController
|
||||
@@ -46,18 +48,9 @@ class Controller extends BaseController
|
||||
/**
|
||||
* Controller constructor.
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// is site a demo site?
|
||||
$isDemoSite = FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||
|
||||
// do not expose API on demo site:
|
||||
if (true === $isDemoSite) {
|
||||
throw new FireflyException('The API is not available on the demo site.');
|
||||
}
|
||||
|
||||
// get global parameters
|
||||
$this->parameters = $this->getParameters();
|
||||
}
|
||||
@@ -70,7 +63,7 @@ class Controller extends BaseController
|
||||
$return = '?';
|
||||
$params = [];
|
||||
foreach ($this->parameters as $key => $value) {
|
||||
if($key === 'page') {
|
||||
if ($key === 'page') {
|
||||
continue;
|
||||
}
|
||||
if ($value instanceof Carbon) {
|
||||
@@ -81,7 +74,7 @@ class Controller extends BaseController
|
||||
}
|
||||
}
|
||||
$return .= http_build_query($params);
|
||||
if (strlen($return) === 1) {
|
||||
if (\strlen($return) === 1) {
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -105,11 +98,12 @@ class Controller extends BaseController
|
||||
foreach ($dates as $field) {
|
||||
$date = request()->get($field);
|
||||
$obj = null;
|
||||
if (!is_null($date)) {
|
||||
if (null !== $date) {
|
||||
try {
|
||||
$obj = new Carbon($date);
|
||||
} catch (InvalidDateException $e) {
|
||||
// don't care
|
||||
Log::error(sprintf('Invalid date exception in API controller: %s', $e->getMessage()));
|
||||
}
|
||||
}
|
||||
$bag->set($field, $obj);
|
||||
|
208
app/Api/V1/Controllers/CurrencyController.php
Normal file
208
app/Api/V1/Controllers/CurrencyController.php
Normal file
@@ -0,0 +1,208 @@
|
||||
<?php
|
||||
/**
|
||||
* CurrencyController.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This file is part of Firefly III.
|
||||
*
|
||||
* Firefly III is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Firefly III is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace FireflyIII\Api\V1\Controllers;
|
||||
|
||||
use FireflyIII\Api\V1\Requests\BillRequest;
|
||||
use FireflyIII\Api\V1\Requests\CurrencyRequest;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\Transformers\CurrencyTransformer;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use League\Fractal\Manager;
|
||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use League\Fractal\Resource\Item;
|
||||
use League\Fractal\Serializer\JsonApiSerializer;
|
||||
use Preferences;
|
||||
|
||||
/**
|
||||
* Class CurrencyController
|
||||
*/
|
||||
class CurrencyController extends Controller
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface */
|
||||
private $repository;
|
||||
/** @var UserRepositoryInterface */
|
||||
private $userRepository;
|
||||
|
||||
/**
|
||||
* CurrencyRepository constructor.
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->middleware(
|
||||
function ($request, $next) {
|
||||
/** @var CurrencyRepositoryInterface repository */
|
||||
$this->repository = app(CurrencyRepositoryInterface::class);
|
||||
$this->userRepository = app(UserRepositoryInterface::class);
|
||||
$this->repository->setUser(auth()->user());
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function delete(TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
if (!$this->userRepository->hasRole(auth()->user(), 'owner')) {
|
||||
// access denied:
|
||||
throw new FireflyException('No access to method, user is not owner.'); // @codeCoverageIgnore
|
||||
}
|
||||
if (!$this->repository->canDeleteCurrency($currency)) {
|
||||
throw new FireflyException('No access to method, currency is in use.'); // @codeCoverageIgnore
|
||||
}
|
||||
$this->repository->destroy($currency);
|
||||
|
||||
return response()->json([], 204);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$collection = $this->repository->get();
|
||||
$count = $collection->count();
|
||||
// slice them:
|
||||
$currencies = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
|
||||
$paginator = new LengthAwarePaginator($currencies, $count, $pageSize, $this->parameters->get('page'));
|
||||
$paginator->setPath(route('api.v1.currencies.index') . $this->buildParams());
|
||||
|
||||
|
||||
$manager = new Manager();
|
||||
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$this->parameters->set('defaultCurrency', $defaultCurrency);
|
||||
|
||||
$resource = new FractalCollection($currencies, new CurrencyTransformer($this->parameters), 'currencies');
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function show(Request $request, TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
$manager = new Manager();
|
||||
// add include parameter:
|
||||
$include = $request->get('include') ?? '';
|
||||
$manager->parseIncludes($include);
|
||||
|
||||
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$this->parameters->set('defaultCurrency', $defaultCurrency);
|
||||
|
||||
$resource = new Item($currency, new CurrencyTransformer($this->parameters), 'currencies');
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param CurrencyRequest $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function store(CurrencyRequest $request): JsonResponse
|
||||
{
|
||||
$currency = $this->repository->store($request->getAll());
|
||||
|
||||
if ($request->boolean('default') === true) {
|
||||
Preferences::set('currencyPreference', $currency->code);
|
||||
Preferences::mark();
|
||||
}
|
||||
if (null !== $currency) {
|
||||
$manager = new Manager();
|
||||
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$this->parameters->set('defaultCurrency', $defaultCurrency);
|
||||
|
||||
$resource = new Item($currency, new CurrencyTransformer($this->parameters), 'currencies');
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
|
||||
}
|
||||
throw new FireflyException('Could not store new currency.'); // @codeCoverageIgnore
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param CurrencyRequest $request
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function update(CurrencyRequest $request, TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
$data = $request->getAll();
|
||||
$currency = $this->repository->update($currency, $data);
|
||||
|
||||
if ($request->boolean('default') === true) {
|
||||
Preferences::set('currencyPreference', $currency->code);
|
||||
Preferences::mark();
|
||||
}
|
||||
|
||||
$manager = new Manager();
|
||||
$baseUrl = $request->getSchemeAndHttpHost() . '/api/v1';
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
|
||||
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$this->parameters->set('defaultCurrency', $defaultCurrency);
|
||||
|
||||
$resource = new Item($currency, new CurrencyTransformer($this->parameters), 'currencies');
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
|
||||
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* TransactionController.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Controllers;
|
||||
|
||||
@@ -37,7 +37,6 @@ use Illuminate\Support\Collection;
|
||||
use League\Fractal\Manager;
|
||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use League\Fractal\Resource\Item;
|
||||
use League\Fractal\Serializer\JsonApiSerializer;
|
||||
use Log;
|
||||
use Preferences;
|
||||
@@ -92,7 +91,7 @@ class TransactionController extends Controller
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data);
|
||||
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
|
||||
// read type from URI
|
||||
$type = $request->get('type') ?? 'default';
|
||||
@@ -112,11 +111,11 @@ class TransactionController extends Controller
|
||||
$collector->setAllAssetAccounts();
|
||||
|
||||
// remove internal transfer filter:
|
||||
if (in_array(TransactionType::TRANSFER, $types)) {
|
||||
if (\in_array(TransactionType::TRANSFER, $types)) {
|
||||
$collector->removeFilter(InternalTransferFilter::class);
|
||||
}
|
||||
|
||||
if (!is_null($this->parameters->get('start')) && !is_null($this->parameters->get('end'))) {
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
}
|
||||
$collector->setLimit($pageSize)->setPage($this->parameters->get('page'));
|
||||
@@ -166,13 +165,15 @@ class TransactionController extends Controller
|
||||
}
|
||||
|
||||
$transactions = $collector->getJournals();
|
||||
$resource = new Item($transactions->first(), new TransactionTransformer($this->parameters), 'transactions');
|
||||
$resource = new FractalCollection($transactions, new TransactionTransformer($this->parameters), 'transactions');
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionRequest $request
|
||||
* @param TransactionRequest $request
|
||||
*
|
||||
* @param JournalRepositoryInterface $repository
|
||||
*
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
*/
|
||||
@@ -330,4 +331,4 @@ class TransactionController extends Controller
|
||||
return $types['default']; // @codeCoverageIgnore
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* UserController.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,11 +20,11 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Controllers;
|
||||
|
||||
use FireflyIII\Api\V1\Requests\UserRequest;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\Transformers\UserTransformer;
|
||||
use FireflyIII\User;
|
||||
@@ -35,7 +36,7 @@ use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use League\Fractal\Resource\Item;
|
||||
use League\Fractal\Serializer\JsonApiSerializer;
|
||||
use Preferences;
|
||||
use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException;
|
||||
|
||||
|
||||
/**
|
||||
* Class UserController
|
||||
@@ -70,6 +71,7 @@ class UserController extends Controller
|
||||
* @param \FireflyIII\User $user
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function delete(User $user)
|
||||
{
|
||||
@@ -78,7 +80,7 @@ class UserController extends Controller
|
||||
|
||||
return response()->json([], 204);
|
||||
}
|
||||
throw new AccessDeniedException(''); // @codeCoverageIgnore
|
||||
throw new FireflyException('No access to method.'); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,7 +93,7 @@ class UserController extends Controller
|
||||
public function index(Request $request)
|
||||
{
|
||||
// user preferences
|
||||
$pageSize = intval(Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data);
|
||||
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
|
||||
// make manager
|
||||
$manager = new Manager();
|
||||
@@ -189,4 +191,4 @@ class UserController extends Controller
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* AccountRequest.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Requests;
|
||||
|
||||
@@ -70,9 +70,9 @@ class AccountRequest extends Request
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$accountRoles = join(',', config('firefly.accountRoles'));
|
||||
$types = join(',', array_keys(config('firefly.subTitlesByIdentifier')));
|
||||
$ccPaymentTypes = join(',', array_keys(config('firefly.ccTypes')));
|
||||
$accountRoles = implode(',', config('firefly.accountRoles'));
|
||||
$types = implode(',', array_keys(config('firefly.subTitlesByIdentifier')));
|
||||
$ccPaymentTypes = implode(',', array_keys(config('firefly.ccTypes')));
|
||||
$rules = [
|
||||
'name' => 'required|min:1|uniqueAccountForUser',
|
||||
'opening_balance' => 'numeric|required_with:opening_balance_date|nullable',
|
||||
@@ -104,4 +104,4 @@ class AccountRequest extends Request
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* BillRequest.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Requests;
|
||||
|
||||
@@ -46,18 +46,17 @@ class BillRequest extends Request
|
||||
public function getAll(): array
|
||||
{
|
||||
$data = [
|
||||
'name' => $this->string('name'),
|
||||
'match' => $this->string('match'),
|
||||
'amount_min' => $this->string('amount_min'),
|
||||
'amount_max' => $this->string('amount_max'),
|
||||
//'currency_id' => $this->integer('currency_id'),
|
||||
//'currency_code' => $this->string('currency_code'),
|
||||
'date' => $this->date('date'),
|
||||
'repeat_freq' => $this->string('repeat_freq'),
|
||||
'skip' => $this->integer('skip'),
|
||||
'automatch' => $this->boolean('automatch'),
|
||||
'active' => $this->boolean('active'),
|
||||
'notes' => $this->string('notes'),
|
||||
'name' => $this->string('name'),
|
||||
'amount_min' => $this->string('amount_min'),
|
||||
'amount_max' => $this->string('amount_max'),
|
||||
'currency_id' => $this->integer('currency_id'),
|
||||
'currency_code' => $this->string('currency_code'),
|
||||
'date' => $this->date('date'),
|
||||
'repeat_freq' => $this->string('repeat_freq'),
|
||||
'skip' => $this->integer('skip'),
|
||||
'automatch' => $this->boolean('automatch'),
|
||||
'active' => $this->boolean('active'),
|
||||
'notes' => $this->string('notes'),
|
||||
];
|
||||
|
||||
return $data;
|
||||
@@ -69,18 +68,17 @@ class BillRequest extends Request
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|between:1,255|uniqueObjectForUser:bills,name',
|
||||
'match' => 'required|between:1,255|uniqueObjectForUser:bills,match',
|
||||
'amount_min' => 'required|numeric|more:0',
|
||||
'amount_max' => 'required|numeric|more:0',
|
||||
//'currency_id' => 'numeric|exists:transaction_currencies,id|required_without:currency_code',
|
||||
//'currency_code' => 'min:3|max:3|exists:transaction_currencies,code|required_without:currency_id',
|
||||
'date' => 'required|date',
|
||||
'repeat_freq' => 'required|in:weekly,monthly,quarterly,half-year,yearly',
|
||||
'skip' => 'required|between:0,31',
|
||||
'automatch' => 'required|boolean',
|
||||
'active' => 'required|boolean',
|
||||
'notes' => 'between:1,65536',
|
||||
'name' => 'required|between:1,255|uniqueObjectForUser:bills,name',
|
||||
'amount_min' => 'required|numeric|more:0',
|
||||
'amount_max' => 'required|numeric|more:0',
|
||||
'currency_id' => 'numeric|exists:transaction_currencies,id|required_without:currency_code',
|
||||
'currency_code' => 'min:3|max:3|exists:transaction_currencies,code|required_without:currency_id',
|
||||
'date' => 'required|date',
|
||||
'repeat_freq' => 'required|in:weekly,monthly,quarterly,half-year,yearly',
|
||||
'skip' => 'required|between:0,31',
|
||||
'automatch' => 'required|boolean',
|
||||
'active' => 'required|boolean',
|
||||
'notes' => 'between:1,65536',
|
||||
];
|
||||
switch ($this->method()) {
|
||||
default:
|
||||
@@ -89,7 +87,6 @@ class BillRequest extends Request
|
||||
case 'PATCH':
|
||||
$bill = $this->route()->parameter('bill');
|
||||
$rules['name'] .= ',' . $bill->id;
|
||||
$rules['match'] .= ',' . $bill->id;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -108,12 +105,12 @@ class BillRequest extends Request
|
||||
$validator->after(
|
||||
function (Validator $validator) {
|
||||
$data = $validator->getData();
|
||||
$min = floatval($data['amount_min'] ?? 0);
|
||||
$max = floatval($data['amount_max'] ?? 0);
|
||||
$min = (float)($data['amount_min'] ?? 0);
|
||||
$max = (float)($data['amount_max'] ?? 0);
|
||||
if ($min > $max) {
|
||||
$validator->errors()->add('amount_min', trans('validation.amount_min_over_max'));
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
83
app/Api/V1/Requests/CurrencyRequest.php
Normal file
83
app/Api/V1/Requests/CurrencyRequest.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* CurrencyRequest.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
*
|
||||
* This file is part of Firefly III.
|
||||
*
|
||||
* Firefly III is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Firefly III is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Requests;
|
||||
|
||||
|
||||
/**
|
||||
* Class CurrencyRequest
|
||||
*/
|
||||
class CurrencyRequest extends Request
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
// Only allow authenticated users
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
return [
|
||||
'name' => $this->string('name'),
|
||||
'code' => $this->string('code'),
|
||||
'symbol' => $this->string('symbol'),
|
||||
'decimal_places' => $this->integer('decimal_places'),
|
||||
'default' => $this->boolean('default'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|between:1,255|unique:transaction_currencies,name',
|
||||
'code' => 'required|between:3,3|unique:transaction_currencies,code',
|
||||
'symbol' => 'required|between:1,5|unique:transaction_currencies,symbol',
|
||||
'decimal_places' => 'required|between:0,20|numeric|min:0|max:20',
|
||||
'default' => 'in:true,false',
|
||||
];
|
||||
|
||||
switch ($this->method()) {
|
||||
default:
|
||||
break;
|
||||
case 'PUT':
|
||||
case 'PATCH':
|
||||
$currency = $this->route()->parameter('currency');
|
||||
$rules['name'] = 'required|between:1,255|unique:transaction_currencies,name,' . $currency->id;
|
||||
$rules['code'] = 'required|between:1,255|unique:transaction_currencies,code,' . $currency->id;
|
||||
$rules['symbol'] = 'required|between:1,255|unique:transaction_currencies,symbol,' . $currency->id;
|
||||
break;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* Request.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -18,11 +19,11 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Requests;
|
||||
|
||||
use FireflyIII\Http\Requests\Request as FireflyIIIRequest;
|
||||
|
||||
/**
|
||||
* Class Request.
|
||||
*/
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* TransactionRequest.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Requests;
|
||||
|
||||
@@ -80,19 +80,19 @@ class TransactionRequest extends Request
|
||||
$array = [
|
||||
'description' => $transaction['description'] ?? null,
|
||||
'amount' => $transaction['amount'],
|
||||
'currency_id' => isset($transaction['currency_id']) ? intval($transaction['currency_id']) : null,
|
||||
'currency_code' => isset($transaction['currency_code']) ? $transaction['currency_code'] : null,
|
||||
'currency_id' => isset($transaction['currency_id']) ? (int)$transaction['currency_id'] : null,
|
||||
'currency_code' => $transaction['currency_code'] ?? null,
|
||||
'foreign_amount' => $transaction['foreign_amount'] ?? null,
|
||||
'foreign_currency_id' => isset($transaction['foreign_currency_id']) ? intval($transaction['foreign_currency_id']) : null,
|
||||
'foreign_currency_id' => isset($transaction['foreign_currency_id']) ? (int)$transaction['foreign_currency_id'] : null,
|
||||
'foreign_currency_code' => $transaction['foreign_currency_code'] ?? null,
|
||||
'budget_id' => isset($transaction['budget_id']) ? intval($transaction['budget_id']) : null,
|
||||
'budget_id' => isset($transaction['budget_id']) ? (int)$transaction['budget_id'] : null,
|
||||
'budget_name' => $transaction['budget_name'] ?? null,
|
||||
'category_id' => isset($transaction['category_id']) ? intval($transaction['category_id']) : null,
|
||||
'category_id' => isset($transaction['category_id']) ? (int)$transaction['category_id'] : null,
|
||||
'category_name' => $transaction['category_name'] ?? null,
|
||||
'source_id' => isset($transaction['source_id']) ? intval($transaction['source_id']) : null,
|
||||
'source_name' => isset($transaction['source_name']) ? strval($transaction['source_name']) : null,
|
||||
'destination_id' => isset($transaction['destination_id']) ? intval($transaction['destination_id']) : null,
|
||||
'destination_name' => isset($transaction['destination_name']) ? strval($transaction['destination_name']) : null,
|
||||
'source_id' => isset($transaction['source_id']) ? (int)$transaction['source_id'] : null,
|
||||
'source_name' => isset($transaction['source_name']) ? (string)$transaction['source_name'] : null,
|
||||
'destination_id' => isset($transaction['destination_id']) ? (int)$transaction['destination_id'] : null,
|
||||
'destination_name' => isset($transaction['destination_name']) ? (string)$transaction['destination_name'] : null,
|
||||
'reconciled' => $transaction['reconciled'] ?? false,
|
||||
'identifier' => $index,
|
||||
];
|
||||
@@ -192,17 +192,19 @@ class TransactionRequest extends Request
|
||||
* @param null|string $accountName
|
||||
* @param string $idField
|
||||
* @param string $nameField
|
||||
*
|
||||
* @return null|Account
|
||||
*/
|
||||
protected function assetAccountExists(Validator $validator, ?int $accountId, ?string $accountName, string $idField, string $nameField): void
|
||||
protected function assetAccountExists(Validator $validator, ?int $accountId, ?string $accountName, string $idField, string $nameField): ?Account
|
||||
{
|
||||
|
||||
$accountId = intval($accountId);
|
||||
$accountName = strval($accountName);
|
||||
$accountId = (int)$accountId;
|
||||
$accountName = (string)$accountName;
|
||||
// both empty? hard exit.
|
||||
if ($accountId < 1 && strlen($accountName) === 0) {
|
||||
if ($accountId < 1 && \strlen($accountName) === 0) {
|
||||
$validator->errors()->add($idField, trans('validation.filled', ['attribute' => $idField]));
|
||||
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
// ID belongs to user and is asset account:
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
@@ -215,19 +217,21 @@ class TransactionRequest extends Request
|
||||
if ($first->accountType->type !== AccountType::ASSET) {
|
||||
$validator->errors()->add($idField, trans('validation.belongs_user'));
|
||||
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
// we ignore the account name at this point.
|
||||
return;
|
||||
return $first;
|
||||
}
|
||||
|
||||
$account = $repository->findByName($accountName, [AccountType::ASSET]);
|
||||
if (is_null($account)) {
|
||||
if (null === $account) {
|
||||
$validator->errors()->add($nameField, trans('validation.belongs_user'));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return;
|
||||
return $account;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,7 +244,7 @@ class TransactionRequest extends Request
|
||||
$data = $validator->getData();
|
||||
$transactions = $data['transactions'] ?? [];
|
||||
// need at least one transaction
|
||||
if (count($transactions) === 0) {
|
||||
if (\count($transactions) === 0) {
|
||||
$validator->errors()->add('description', trans('validation.at_least_one_transaction'));
|
||||
}
|
||||
}
|
||||
@@ -255,16 +259,16 @@ class TransactionRequest extends Request
|
||||
{
|
||||
$data = $validator->getData();
|
||||
$transactions = $data['transactions'] ?? [];
|
||||
$journalDescription = strval($data['description'] ?? '');
|
||||
$journalDescription = (string)($data['description'] ?? '');
|
||||
$validDescriptions = 0;
|
||||
foreach ($transactions as $index => $transaction) {
|
||||
if (strlen(strval($transaction['description'] ?? '')) > 0) {
|
||||
if (\strlen((string)($transaction['description'] ?? '')) > 0) {
|
||||
$validDescriptions++;
|
||||
}
|
||||
}
|
||||
|
||||
// no valid descriptions and empty journal description? error.
|
||||
if ($validDescriptions === 0 && strlen($journalDescription) === 0) {
|
||||
if ($validDescriptions === 0 && \strlen($journalDescription) === 0) {
|
||||
$validator->errors()->add('description', trans('validation.filled', ['attribute' => trans('validation.attributes.description')]));
|
||||
}
|
||||
|
||||
@@ -281,9 +285,9 @@ class TransactionRequest extends Request
|
||||
$data = $validator->getData();
|
||||
$transactions = $data['transactions'] ?? [];
|
||||
foreach ($transactions as $index => $transaction) {
|
||||
$description = strval($transaction['description'] ?? '');
|
||||
$description = (string)($transaction['description'] ?? '');
|
||||
// filled description is mandatory for split transactions.
|
||||
if (count($transactions) > 1 && strlen($description) === 0) {
|
||||
if (\count($transactions) > 1 && \strlen($description) === 0) {
|
||||
$validator->errors()->add(
|
||||
'transactions.' . $index . '.description',
|
||||
trans('validation.filled', ['attribute' => trans('validation.attributes.transaction_description')])
|
||||
@@ -301,9 +305,9 @@ class TransactionRequest extends Request
|
||||
{
|
||||
$data = $validator->getData();
|
||||
$transactions = $data['transactions'] ?? [];
|
||||
$journalDescription = strval($data['description'] ?? '');
|
||||
$journalDescription = (string)($data['description'] ?? '');
|
||||
foreach ($transactions as $index => $transaction) {
|
||||
$description = strval($transaction['description'] ?? '');
|
||||
$description = (string)($transaction['description'] ?? '');
|
||||
// description cannot be equal to journal description.
|
||||
if ($description === $journalDescription) {
|
||||
$validator->errors()->add('transactions.' . $index . '.description', trans('validation.equal_description'));
|
||||
@@ -342,13 +346,16 @@ class TransactionRequest extends Request
|
||||
* @param int|null $accountId
|
||||
* @param null|string $accountName
|
||||
* @param string $idField
|
||||
*
|
||||
* @return null|Account
|
||||
*/
|
||||
protected function opposingAccountExists(Validator $validator, string $type, ?int $accountId, ?string $accountName, string $idField): void {
|
||||
$accountId = intval($accountId);
|
||||
$accountName = strval($accountName);
|
||||
protected function opposingAccountExists(Validator $validator, string $type, ?int $accountId, ?string $accountName, string $idField): ?Account
|
||||
{
|
||||
$accountId = (int)$accountId;
|
||||
$accountName = (string)$accountName;
|
||||
// both empty? done!
|
||||
if ($accountId < 1 && strlen($accountName) === 0) {
|
||||
return;
|
||||
if ($accountId < 1 && \strlen($accountName) === 0) {
|
||||
return null;
|
||||
}
|
||||
if ($accountId !== 0) {
|
||||
// ID belongs to user and is $type account:
|
||||
@@ -362,16 +369,16 @@ class TransactionRequest extends Request
|
||||
if ($first->accountType->type !== $type) {
|
||||
$validator->errors()->add($idField, trans('validation.belongs_user'));
|
||||
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
// we ignore the account name at this point.
|
||||
return;
|
||||
return $first;
|
||||
}
|
||||
}
|
||||
|
||||
// not having an opposing account by this name is NOT a problem.
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -389,47 +396,55 @@ class TransactionRequest extends Request
|
||||
// the journal may exist in the request:
|
||||
/** @var Transaction $transaction */
|
||||
$transaction = $this->route()->parameter('transaction');
|
||||
if (is_null($transaction)) {
|
||||
if (null === $transaction) {
|
||||
return; // @codeCoverageIgnore
|
||||
}
|
||||
$data['type'] = strtolower($transaction->transactionJournal->transactionType->type);
|
||||
}
|
||||
foreach ($transactions as $index => $transaction) {
|
||||
$sourceId = isset($transaction['source_id']) ? intval($transaction['source_id']) : null;
|
||||
$sourceName = $transaction['source_name'] ?? null;
|
||||
$destinationId = isset($transaction['destination_id']) ? intval($transaction['destination_id']) : null;
|
||||
$destinationName = $transaction['destination_name'] ?? null;
|
||||
|
||||
$sourceId = isset($transaction['source_id']) ? (int)$transaction['source_id'] : null;
|
||||
$sourceName = $transaction['source_name'] ?? null;
|
||||
$destinationId = isset($transaction['destination_id']) ? (int)$transaction['destination_id'] : null;
|
||||
$destinationName = $transaction['destination_name'] ?? null;
|
||||
$sourceAccount = null;
|
||||
$destinationAccount = null;
|
||||
switch ($data['type']) {
|
||||
case 'withdrawal':
|
||||
$idField = 'transactions.' . $index . '.source_id';
|
||||
$nameField = 'transactions.' . $index . '.source_name';
|
||||
$this->assetAccountExists($validator, $sourceId, $sourceName, $idField, $nameField);
|
||||
|
||||
$idField = 'transactions.' . $index . '.destination_id';
|
||||
$this->opposingAccountExists($validator, AccountType::EXPENSE, $destinationId, $destinationName, $idField);
|
||||
$idField = 'transactions.' . $index . '.source_id';
|
||||
$nameField = 'transactions.' . $index . '.source_name';
|
||||
$sourceAccount = $this->assetAccountExists($validator, $sourceId, $sourceName, $idField, $nameField);
|
||||
$idField = 'transactions.' . $index . '.destination_id';
|
||||
$destinationAccount = $this->opposingAccountExists($validator, AccountType::EXPENSE, $destinationId, $destinationName, $idField);
|
||||
break;
|
||||
case 'deposit':
|
||||
$idField = 'transactions.' . $index . '.source_id';
|
||||
$this->opposingAccountExists($validator, AccountType::REVENUE, $sourceId, $sourceName, $idField);
|
||||
$idField = 'transactions.' . $index . '.source_id';
|
||||
$sourceAccount = $this->opposingAccountExists($validator, AccountType::REVENUE, $sourceId, $sourceName, $idField);
|
||||
|
||||
$idField = 'transactions.' . $index . '.destination_id';
|
||||
$nameField = 'transactions.' . $index . '.destination_name';
|
||||
$this->assetAccountExists($validator, $destinationId, $destinationName, $idField, $nameField);
|
||||
$idField = 'transactions.' . $index . '.destination_id';
|
||||
$nameField = 'transactions.' . $index . '.destination_name';
|
||||
$destinationAccount = $this->assetAccountExists($validator, $destinationId, $destinationName, $idField, $nameField);
|
||||
break;
|
||||
case 'transfer':
|
||||
$idField = 'transactions.' . $index . '.source_id';
|
||||
$nameField = 'transactions.' . $index . '.source_name';
|
||||
$this->assetAccountExists($validator, $sourceId, $sourceName, $idField, $nameField);
|
||||
$idField = 'transactions.' . $index . '.source_id';
|
||||
$nameField = 'transactions.' . $index . '.source_name';
|
||||
$sourceAccount = $this->assetAccountExists($validator, $sourceId, $sourceName, $idField, $nameField);
|
||||
|
||||
$idField = 'transactions.' . $index . '.destination_id';
|
||||
$nameField = 'transactions.' . $index . '.destination_name';
|
||||
$this->assetAccountExists($validator, $destinationId, $destinationName, $idField, $nameField);
|
||||
$idField = 'transactions.' . $index . '.destination_id';
|
||||
$nameField = 'transactions.' . $index . '.destination_name';
|
||||
$destinationAccount = $this->assetAccountExists($validator, $destinationId, $destinationName, $idField, $nameField);
|
||||
break;
|
||||
default:
|
||||
throw new FireflyException(sprintf('The validator cannot handle transaction type "%s" in validateAccountInformation().', $data['type']));
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new FireflyException(
|
||||
sprintf('The validator cannot handle transaction type "%s" in validateAccountInformation().', $data['type'])
|
||||
);
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
}
|
||||
// add some errors in case of same account submitted:
|
||||
if (null !== $sourceAccount && null !== $destinationAccount && $sourceAccount->id === $destinationAccount->id) {
|
||||
$validator->errors()->add($idField, trans('validation.source_equals_destination'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,7 +456,7 @@ class TransactionRequest extends Request
|
||||
protected function validateSplitAccounts(Validator $validator)
|
||||
{
|
||||
$data = $validator->getData();
|
||||
$count = isset($data['transactions']) ? count($data['transactions']) : 0;
|
||||
$count = isset($data['transactions']) ? \count($data['transactions']) : 0;
|
||||
if ($count < 2) {
|
||||
return;
|
||||
}
|
||||
@@ -451,7 +466,7 @@ class TransactionRequest extends Request
|
||||
// the journal may exist in the request:
|
||||
/** @var Transaction $transaction */
|
||||
$transaction = $this->route()->parameter('transaction');
|
||||
if (is_null($transaction)) {
|
||||
if (null === $transaction) {
|
||||
return;
|
||||
}
|
||||
$data['type'] = strtolower($transaction->transactionJournal->transactionType->type);
|
||||
@@ -463,25 +478,25 @@ class TransactionRequest extends Request
|
||||
$destinations = [];
|
||||
|
||||
foreach ($data['transactions'] as $transaction) {
|
||||
$sources[] = isset($transaction['source_id']) ? intval($transaction['source_id']) : 0;
|
||||
$destinations[] = isset($transaction['destination_id']) ? intval($transaction['destination_id']) : 0;
|
||||
$sources[] = isset($transaction['source_id']) ? (int)$transaction['source_id'] : 0;
|
||||
$destinations[] = isset($transaction['destination_id']) ? (int)$transaction['destination_id'] : 0;
|
||||
}
|
||||
$destinations = array_unique($destinations);
|
||||
$sources = array_unique($sources);
|
||||
// switch on type:
|
||||
switch ($data['type']) {
|
||||
case 'withdrawal':
|
||||
if (count($sources) > 1) {
|
||||
if (\count($sources) > 1) {
|
||||
$validator->errors()->add('transactions.0.source_id', trans('validation.all_accounts_equal'));
|
||||
}
|
||||
break;
|
||||
case 'deposit':
|
||||
if (count($destinations) > 1) {
|
||||
if (\count($destinations) > 1) {
|
||||
$validator->errors()->add('transactions.0.destination_id', trans('validation.all_accounts_equal'));
|
||||
}
|
||||
break;
|
||||
case 'transfer':
|
||||
if (count($sources) > 1 || count($destinations) > 1) {
|
||||
if (\count($sources) > 1 || \count($destinations) > 1) {
|
||||
$validator->errors()->add('transactions.0.source_id', trans('validation.all_accounts_equal'));
|
||||
$validator->errors()->add('transactions.0.destination_id', trans('validation.all_accounts_equal'));
|
||||
}
|
||||
@@ -493,8 +508,6 @@ class TransactionRequest extends Request
|
||||
);
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* UserRequest.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Requests;
|
||||
|
||||
@@ -86,4 +86,4 @@ class UserRequest extends Request
|
||||
return $rules;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* CreateExport.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -60,17 +60,6 @@ class CreateExport extends Command
|
||||
{--with_uploads : Include user\'s uploads?}';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five its fine.
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
@@ -80,7 +69,7 @@ class CreateExport extends Command
|
||||
if (!$this->verifyAccessToken()) {
|
||||
$this->error('Invalid access token.');
|
||||
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
$this->line('Full export is running...');
|
||||
// make repositories
|
||||
@@ -94,15 +83,15 @@ class CreateExport extends Command
|
||||
$journalRepository = app(JournalRepositoryInterface::class);
|
||||
|
||||
// set user
|
||||
$user = $userRepository->find(intval($this->option('user')));
|
||||
$user = $userRepository->findNull((int)$this->option('user'));
|
||||
$jobRepository->setUser($user);
|
||||
$journalRepository->setUser($user);
|
||||
$accountRepository->setUser($user);
|
||||
|
||||
// first date
|
||||
$firstJournal = $journalRepository->first();
|
||||
$firstJournal = $journalRepository->firstNull();
|
||||
$first = new Carbon;
|
||||
if (null !== $firstJournal->id) {
|
||||
if (null !== $firstJournal) {
|
||||
$first = $firstJournal->date;
|
||||
}
|
||||
|
||||
@@ -141,6 +130,6 @@ class CreateExport extends Command
|
||||
$this->line('The export has finished! You can find the ZIP file in this location:');
|
||||
$this->line(storage_path(sprintf('export/%s', $fileName)));
|
||||
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* CreateImport.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,20 +19,17 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
use Artisan;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Import\Logging\CommandHandler;
|
||||
use FireflyIII\Import\Routine\RoutineInterface;
|
||||
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\Services\Internal\File\EncryptService;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\MessageBag;
|
||||
use Log;
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
use Preferences;
|
||||
|
||||
/**
|
||||
@@ -61,76 +59,67 @@ class CreateImport extends Command
|
||||
{--token= : The user\'s access token.}
|
||||
{--start : Starts the job immediately.}';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the command.
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) // cannot be helped
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five exactly.
|
||||
* @noinspection MultipleReturnStatementsInspection
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): int
|
||||
{
|
||||
if (!$this->verifyAccessToken()) {
|
||||
$this->error('Invalid access token.');
|
||||
$this->errorLine('Invalid access token.');
|
||||
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
/** @var UserRepositoryInterface $userRepository */
|
||||
$userRepository = app(UserRepositoryInterface::class);
|
||||
$file = $this->argument('file');
|
||||
$configuration = $this->argument('configuration');
|
||||
$user = $userRepository->find(intval($this->option('user')));
|
||||
$user = $userRepository->findNull((int)$this->option('user'));
|
||||
$cwd = getcwd();
|
||||
$type = strtolower($this->option('type'));
|
||||
|
||||
if (!$this->validArguments()) {
|
||||
return;
|
||||
$this->errorLine('Invalid arguments.');
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
$configurationData = json_decode(file_get_contents($configuration), true);
|
||||
if (null === $configurationData) {
|
||||
$this->error(sprintf('Firefly III cannot read the contents of configuration file "%s" (working directory: "%s").', $configuration, $cwd));
|
||||
$this->errorLine(sprintf('Firefly III cannot read the contents of configuration file "%s" (working directory: "%s").', $configuration, $cwd));
|
||||
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
|
||||
$this->line(sprintf('Going to create a job to import file: %s', $file));
|
||||
$this->line(sprintf('Using configuration file: %s', $configuration));
|
||||
$this->line(sprintf('Import into user: #%d (%s)', $user->id, $user->email));
|
||||
$this->line(sprintf('Type of import: %s', $type));
|
||||
$this->infoLine(sprintf('Going to create a job to import file: %s', $file));
|
||||
$this->infoLine(sprintf('Using configuration file: %s', $configuration));
|
||||
$this->infoLine(sprintf('Import into user: #%d (%s)', $user->id, $user->email));
|
||||
$this->infoLine(sprintf('Type of import: %s', $type));
|
||||
|
||||
/** @var ImportJobRepositoryInterface $jobRepository */
|
||||
$jobRepository = app(ImportJobRepositoryInterface::class);
|
||||
$jobRepository->setUser($user);
|
||||
$job = $jobRepository->create($type);
|
||||
$this->line(sprintf('Created job "%s"', $job->key));
|
||||
$this->infoLine(sprintf('Created job "%s"', $job->key));
|
||||
|
||||
Artisan::call('firefly:encrypt-file', ['file' => $file, 'key' => $job->key]);
|
||||
$this->line('Stored import data...');
|
||||
/** @var EncryptService $service */
|
||||
$service = app(EncryptService::class);
|
||||
$service->encrypt($file, $job->key);
|
||||
|
||||
$this->infoLine('Stored import data...');
|
||||
|
||||
$jobRepository->setConfiguration($job, $configurationData);
|
||||
$jobRepository->updateStatus($job, 'configured');
|
||||
$this->line('Stored configuration...');
|
||||
$this->infoLine('Stored configuration...');
|
||||
|
||||
if (true === $this->option('start')) {
|
||||
$this->line('The import will start in a moment. This process is not visible...');
|
||||
$this->infoLine('The import will start in a moment. This process is not visible...');
|
||||
Log::debug('Go for import!');
|
||||
|
||||
// normally would refer to other firefly:start-import but that doesn't seem to work all to well...
|
||||
$monolog = Log::getMonolog();
|
||||
$handler = new CommandHandler($this);
|
||||
$formatter = new LineFormatter(null, null, false, true);
|
||||
$handler->setFormatter($formatter);
|
||||
$monolog->pushHandler($handler);
|
||||
|
||||
// start the actual routine:
|
||||
$type = 'csv' === $job->file_type ? 'file' : $job->file_type;
|
||||
@@ -147,9 +136,9 @@ class CreateImport extends Command
|
||||
// give feedback.
|
||||
/** @var MessageBag $error */
|
||||
foreach ($routine->getErrors() as $index => $error) {
|
||||
$this->error(sprintf('Error importing line #%d: %s', $index, $error));
|
||||
$this->errorLine(sprintf('Error importing line #%d: %s', $index, $error));
|
||||
}
|
||||
$this->line(
|
||||
$this->infoLine(
|
||||
sprintf(
|
||||
'The import has finished. %d transactions have been imported out of %d records.', $routine->getJournals()->count(), $routine->getLines()
|
||||
)
|
||||
@@ -159,45 +148,58 @@ class CreateImport extends Command
|
||||
// clear cache for user:
|
||||
Preferences::setForUser($user, 'lastActivity', microtime());
|
||||
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param array|null $data
|
||||
*/
|
||||
private function errorLine(string $message, array $data = null): void
|
||||
{
|
||||
Log::error($message, $data ?? []);
|
||||
$this->error($message);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param array $data
|
||||
*/
|
||||
private function infoLine(string $message, array $data = null): void
|
||||
{
|
||||
Log::info($message, $data ?? []);
|
||||
$this->line($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify user inserts correct arguments.
|
||||
*
|
||||
* @noinspection MultipleReturnStatementsInspection
|
||||
* @return bool
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five exactly.
|
||||
*/
|
||||
private function validArguments(): bool
|
||||
{
|
||||
/** @var UserRepositoryInterface $userRepository */
|
||||
$userRepository = app(UserRepositoryInterface::class);
|
||||
$file = $this->argument('file');
|
||||
$configuration = $this->argument('configuration');
|
||||
$user = $userRepository->find(intval($this->option('user')));
|
||||
$cwd = getcwd();
|
||||
$validTypes = config('import.options.file.import_formats');
|
||||
$type = strtolower($this->option('type'));
|
||||
if (null === $user) {
|
||||
$this->error(sprintf('There is no user with ID %d.', $this->option('user')));
|
||||
$file = $this->argument('file');
|
||||
$configuration = $this->argument('configuration');
|
||||
$cwd = getcwd();
|
||||
$validTypes = config('import.options.file.import_formats');
|
||||
$type = strtolower($this->option('type'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!in_array($type, $validTypes)) {
|
||||
$this->error(sprintf('Cannot import file of type "%s"', $type));
|
||||
if (!\in_array($type, $validTypes, true)) {
|
||||
$this->errorLine(sprintf('Cannot import file of type "%s"', $type));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!file_exists($file)) {
|
||||
$this->error(sprintf('Firefly III cannot find file "%s" (working directory: "%s").', $file, $cwd));
|
||||
$this->errorLine(sprintf('Firefly III cannot find file "%s" (working directory: "%s").', $file, $cwd));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!file_exists($configuration)) {
|
||||
$this->error(sprintf('Firefly III cannot find configuration file "%s" (working directory: "%s").', $configuration, $cwd));
|
||||
$this->errorLine(sprintf('Firefly III cannot find configuration file "%s" (working directory: "%s").', $configuration, $cwd));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* DecryptAttachment.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -47,14 +47,6 @@ class DecryptAttachment extends Command
|
||||
= 'firefly:decrypt-attachment {id:The ID of the attachment.} {name:The file name of the attachment.}
|
||||
{directory:Where the file must be stored.}';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
@@ -65,7 +57,7 @@ class DecryptAttachment extends Command
|
||||
{
|
||||
/** @var AttachmentRepositoryInterface $repository */
|
||||
$repository = app(AttachmentRepositoryInterface::class);
|
||||
$attachmentId = intval($this->argument('id'));
|
||||
$attachmentId = (int)$this->argument('id');
|
||||
$attachment = $repository->findWithoutUser($attachmentId);
|
||||
$attachmentName = trim($this->argument('name'));
|
||||
$storagePath = realpath(trim($this->argument('directory')));
|
||||
@@ -108,6 +100,5 @@ class DecryptAttachment extends Command
|
||||
}
|
||||
$this->info(sprintf('%d bytes written. Exiting now..', $result));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* EncryptFile.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,11 +19,11 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
use Crypt;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Services\Internal\File\EncryptService;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
@@ -44,31 +45,26 @@ class EncryptFile extends Command
|
||||
*/
|
||||
protected $signature = 'firefly:encrypt-file {file} {key}';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @throws \Illuminate\Contracts\Encryption\EncryptException
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): int
|
||||
{
|
||||
$file = e(strval($this->argument('file')));
|
||||
if (!file_exists($file)) {
|
||||
$this->error(sprintf('File "%s" does not seem to exist.', $file));
|
||||
$code = 0;
|
||||
$file = (string)$this->argument('file');
|
||||
$key = (string)$this->argument('key');
|
||||
/** @var EncryptService $service */
|
||||
$service = app(EncryptService::class);
|
||||
|
||||
return;
|
||||
try {
|
||||
$service->encrypt($file, $key);
|
||||
} catch (FireflyException $e) {
|
||||
$this->error($e->getMessage());
|
||||
$code = 1;
|
||||
}
|
||||
$content = file_get_contents($file);
|
||||
$content = Crypt::encrypt($content);
|
||||
$newName = e(strval($this->argument('key'))) . '.upload';
|
||||
|
||||
$path = storage_path('upload') . '/' . $newName;
|
||||
file_put_contents($path, $content);
|
||||
$this->line(sprintf('Encrypted "%s" and put it in "%s"', $file, $path));
|
||||
return $code;
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* Import.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,12 +19,10 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Import\Logging\CommandHandler;
|
||||
use FireflyIII\Import\Routine\RoutineInterface;
|
||||
use FireflyIII\Models\ImportJob;
|
||||
use Illuminate\Console\Command;
|
||||
@@ -49,14 +48,6 @@ class Import extends Command
|
||||
*/
|
||||
protected $signature = 'firefly:start-import {key}';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the import routine.
|
||||
*
|
||||
@@ -68,21 +59,17 @@ class Import extends Command
|
||||
$jobKey = $this->argument('key');
|
||||
$job = ImportJob::where('key', $jobKey)->first();
|
||||
if (null === $job) {
|
||||
$this->error(sprintf('No job found with key "%s"', $jobKey));
|
||||
$this->errorLine(sprintf('No job found with key "%s"', $jobKey));
|
||||
|
||||
return;
|
||||
}
|
||||
if (!$this->isValid($job)) {
|
||||
Log::error('Job is not valid for some reason. Exit.');
|
||||
$this->errorLine('Job is not valid for some reason. Exit.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->line(sprintf('Going to import job with key "%s" of type "%s"', $job->key, $job->file_type));
|
||||
|
||||
$monolog = Log::getMonolog();
|
||||
$handler = new CommandHandler($this);
|
||||
$monolog->pushHandler($handler);
|
||||
$this->infoLine(sprintf('Going to import job with key "%s" of type "%s"', $job->key, $job->file_type));
|
||||
|
||||
// actually start job:
|
||||
$type = 'csv' === $job->file_type ? 'file' : $job->file_type;
|
||||
@@ -99,14 +86,34 @@ class Import extends Command
|
||||
|
||||
/** @var MessageBag $error */
|
||||
foreach ($routine->getErrors() as $index => $error) {
|
||||
$this->error(sprintf('Error importing line #%d: %s', $index, $error));
|
||||
$this->errorLine(sprintf('Error importing line #%d: %s', $index, $error));
|
||||
}
|
||||
|
||||
$this->line(
|
||||
$this->infoLine(
|
||||
sprintf('The import has finished. %d transactions have been imported out of %d records.', $routine->getJournals()->count(), $routine->getLines())
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param array|null $data
|
||||
*/
|
||||
private function errorLine(string $message, array $data = null): void
|
||||
{
|
||||
Log::error($message, $data ?? []);
|
||||
$this->error($message);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param array $data
|
||||
*/
|
||||
private function infoLine(string $message, array $data = null): void
|
||||
{
|
||||
Log::info($message, $data ?? []);
|
||||
$this->line($message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,15 +126,14 @@ class Import extends Command
|
||||
private function isValid(ImportJob $job): bool
|
||||
{
|
||||
if (null === $job) {
|
||||
Log::error('This job does not seem to exist.');
|
||||
$this->error('This job does not seem to exist.');
|
||||
$this->errorLine('This job does not seem to exist.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ('configured' !== $job->status) {
|
||||
Log::error(sprintf('This job is not ready to be imported (status is %s).', $job->status));
|
||||
$this->error('This job is not ready to be imported.');
|
||||
$this->errorLine('This job is not ready to be imported.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* ScanAttachments.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -48,14 +48,6 @@ class ScanAttachments extends Command
|
||||
*/
|
||||
protected $signature = 'firefly:scan-attachments';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* UpgradeDatabase.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,21 +19,29 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
use DB;
|
||||
use Exception;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountMeta;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Attachment;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\Preference;
|
||||
use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\Models\RuleTrigger;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\TransactionJournalMeta;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -63,18 +72,8 @@ class UpgradeDatabase extends Command
|
||||
*/
|
||||
protected $signature = 'firefly:upgrade-database';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
@@ -86,9 +85,129 @@ class UpgradeDatabase extends Command
|
||||
$this->updateOtherCurrencies();
|
||||
$this->line('Done updating currency information..');
|
||||
$this->migrateNotes();
|
||||
$this->info('Firefly III database is up to date.');
|
||||
$this->migrateAttachmentData();
|
||||
$this->migrateBillsToRules();
|
||||
|
||||
return;
|
||||
$this->info('Firefly III database is up to date.');
|
||||
}
|
||||
|
||||
public function migrateBillsToRules()
|
||||
{
|
||||
foreach (User::get() as $user) {
|
||||
/** @var Preference $lang */
|
||||
$lang = Preferences::getForUser($user, 'language', 'en_US');
|
||||
$groupName = (string)trans('firefly.rulegroup_for_bills_title', [], $lang->data);
|
||||
$ruleGroup = $user->ruleGroups()->where('title', $groupName)->first();
|
||||
$currencyPreference = Preferences::getForUser($user, 'currencyPreference', config('firefly.default_currency', 'EUR'));
|
||||
$currency = TransactionCurrency::where('code', $currencyPreference->data)->first();
|
||||
if (null === $currency) {
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
}
|
||||
|
||||
if ($ruleGroup === null) {
|
||||
$array = RuleGroup::get(['order'])->pluck('order')->toArray();
|
||||
$order = \count($array) > 0 ? max($array) + 1 : 1;
|
||||
$ruleGroup = RuleGroup::create(
|
||||
[
|
||||
'user_id' => $user->id,
|
||||
'title' => (string)trans('firefly.rulegroup_for_bills_title', [], $lang->data),
|
||||
'description' => (string)trans('firefly.rulegroup_for_bills_description', [], $lang->data),
|
||||
'order' => $order,
|
||||
'active' => 1,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// loop bills.
|
||||
$order = 1;
|
||||
/** @var Collection $collection */
|
||||
$collection = $user->bills()->get();
|
||||
/** @var Bill $bill */
|
||||
foreach ($collection as $bill) {
|
||||
if ($bill->match !== 'MIGRATED_TO_RULES') {
|
||||
$rule = Rule::create(
|
||||
[
|
||||
'user_id' => $user->id,
|
||||
'rule_group_id' => $ruleGroup->id,
|
||||
'title' => (string)trans('firefly.rule_for_bill_title', ['name' => $bill->name], $lang->data),
|
||||
'description' => (string)trans('firefly.rule_for_bill_description', ['name' => $bill->name], $lang->data),
|
||||
'order' => $order,
|
||||
'active' => $bill->active,
|
||||
'stop_processing' => 1,
|
||||
]
|
||||
);
|
||||
// add default trigger
|
||||
RuleTrigger::create(
|
||||
[
|
||||
'rule_id' => $rule->id,
|
||||
'trigger_type' => 'user_action',
|
||||
'trigger_value' => 'store-journal',
|
||||
'active' => 1,
|
||||
'stop_processing' => 0,
|
||||
'order' => 1,
|
||||
]
|
||||
);
|
||||
// add trigger for description
|
||||
$match = implode(' ', explode(',', $bill->match));
|
||||
RuleTrigger::create(
|
||||
[
|
||||
'rule_id' => $rule->id,
|
||||
'trigger_type' => 'description_contains',
|
||||
'trigger_value' => $match,
|
||||
'active' => 1,
|
||||
'stop_processing' => 0,
|
||||
'order' => 2,
|
||||
]
|
||||
);
|
||||
|
||||
// add triggers for amounts:
|
||||
RuleTrigger::create(
|
||||
[
|
||||
'rule_id' => $rule->id,
|
||||
'trigger_type' => 'amount_less',
|
||||
'trigger_value' => round($bill->amount_max, $currency->decimal_places),
|
||||
'active' => 1,
|
||||
'stop_processing' => 0,
|
||||
'order' => 3,
|
||||
]
|
||||
);
|
||||
RuleTrigger::create(
|
||||
[
|
||||
'rule_id' => $rule->id,
|
||||
'trigger_type' => 'amount_more',
|
||||
'trigger_value' => round($bill->amount_min, $currency->decimal_places),
|
||||
'active' => 1,
|
||||
'stop_processing' => 0,
|
||||
'order' => 4,
|
||||
]
|
||||
);
|
||||
|
||||
// create action
|
||||
RuleAction::create(
|
||||
[
|
||||
'rule_id' => $rule->id,
|
||||
'action_type' => 'link_to_bill',
|
||||
'action_value' => $bill->name,
|
||||
'order' => 1,
|
||||
'active' => 1,
|
||||
'stop_processing' => 0,
|
||||
]
|
||||
);
|
||||
|
||||
$order++;
|
||||
$bill->match = 'MIGRATED_TO_RULES';
|
||||
$bill->save();
|
||||
$this->line(sprintf('Updated bill #%d ("%s") so it will use rules.', $bill->id, $bill->name));
|
||||
}
|
||||
|
||||
// give bills a currency when they dont have one.
|
||||
if (null === $bill->transaction_currency_id) {
|
||||
$this->line(sprintf('Gave bill #%d ("%s") a currency (%s).', $bill->id, $bill->name, $currency->name));
|
||||
$bill->transactionCurrency()->associate($currency);
|
||||
$bill->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,10 +237,9 @@ class UpgradeDatabase extends Command
|
||||
$journalIds = array_unique($result->pluck('id')->toArray());
|
||||
|
||||
foreach ($journalIds as $journalId) {
|
||||
$this->updateJournalidentifiers(intval($journalId));
|
||||
$this->updateJournalidentifiers((int)$journalId);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,9 +258,9 @@ class UpgradeDatabase extends Command
|
||||
// get users preference, fall back to system pref.
|
||||
$defaultCurrencyCode = Preferences::getForUser($account->user, 'currencyPreference', config('firefly.default_currency', 'EUR'))->data;
|
||||
$defaultCurrency = TransactionCurrency::where('code', $defaultCurrencyCode)->first();
|
||||
$accountCurrency = intval($account->getMeta('currency_id'));
|
||||
$accountCurrency = (int)$account->getMeta('currency_id');
|
||||
$openingBalance = $account->getOpeningBalance();
|
||||
$obCurrency = intval($openingBalance->transaction_currency_id);
|
||||
$obCurrency = (int)$openingBalance->transaction_currency_id;
|
||||
|
||||
// both 0? set to default currency:
|
||||
if (0 === $accountCurrency && 0 === $obCurrency) {
|
||||
@@ -175,7 +293,6 @@ class UpgradeDatabase extends Command
|
||||
}
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,7 +326,7 @@ class UpgradeDatabase extends Command
|
||||
}
|
||||
/** @var Account $account */
|
||||
$account = $transaction->account;
|
||||
$currency = $repository->find(intval($account->getMeta('currency_id')));
|
||||
$currency = $repository->find((int)$account->getMeta('currency_id'));
|
||||
$transactions = $journal->transactions()->get();
|
||||
$transactions->each(
|
||||
function (Transaction $transaction) use ($currency) {
|
||||
@@ -219,8 +336,8 @@ class UpgradeDatabase extends Command
|
||||
}
|
||||
|
||||
// when mismatch in transaction:
|
||||
if (!(intval($transaction->transaction_currency_id) === intval($currency->id))) {
|
||||
$transaction->foreign_currency_id = intval($transaction->transaction_currency_id);
|
||||
if (!((int)$transaction->transaction_currency_id === (int)$currency->id)) {
|
||||
$transaction->foreign_currency_id = (int)$transaction->transaction_currency_id;
|
||||
$transaction->foreign_amount = $transaction->amount;
|
||||
$transaction->transaction_currency_id = $currency->id;
|
||||
$transaction->save();
|
||||
@@ -233,7 +350,6 @@ class UpgradeDatabase extends Command
|
||||
}
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -272,19 +388,49 @@ class UpgradeDatabase extends Command
|
||||
{
|
||||
// create transaction type "Reconciliation".
|
||||
$type = TransactionType::where('type', TransactionType::RECONCILIATION)->first();
|
||||
if (is_null($type)) {
|
||||
if (null === $type) {
|
||||
TransactionType::create(['type' => TransactionType::RECONCILIATION]);
|
||||
}
|
||||
$account = AccountType::where('type', AccountType::RECONCILIATION)->first();
|
||||
if (is_null($account)) {
|
||||
if (null === $account) {
|
||||
AccountType::create(['type' => AccountType::RECONCILIATION]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Move the description of each attachment (when not NULL) to the notes or to a new note object
|
||||
* for all attachments.
|
||||
*/
|
||||
private function migrateAttachmentData(): void
|
||||
{
|
||||
$attachments = Attachment::get();
|
||||
|
||||
/** @var Attachment $att */
|
||||
foreach ($attachments as $att) {
|
||||
|
||||
// move description:
|
||||
$description = (string)$att->description;
|
||||
if (\strlen($description) > 0) {
|
||||
// find or create note:
|
||||
$note = $att->notes()->first();
|
||||
if (null === $note) {
|
||||
$note = new Note;
|
||||
$note->noteable()->associate($att);
|
||||
}
|
||||
$note->text = $description;
|
||||
$note->save();
|
||||
|
||||
// clear description:
|
||||
$att->description = '';
|
||||
$att->save();
|
||||
|
||||
Log::debug(sprintf('Migrated attachment #%s description to note #%d', $att->id, $note->id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Move all the journal_meta notes to their note object counter parts.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function migrateNotes(): void
|
||||
{
|
||||
@@ -301,7 +447,11 @@ class UpgradeDatabase extends Command
|
||||
$note->text = $meta->data;
|
||||
$note->save();
|
||||
Log::debug(sprintf('Migrated meta note #%d to Note #%d', $meta->id, $note->id));
|
||||
$meta->delete();
|
||||
try {
|
||||
$meta->delete();
|
||||
} catch (Exception $e) {
|
||||
Log::error(sprintf('Could not delete old meta entry #%d: %s', $meta->id, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,10 +464,10 @@ class UpgradeDatabase extends Command
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$currency = $repository->find(intval($transaction->account->getMeta('currency_id')));
|
||||
$currency = $repository->find((int)$transaction->account->getMeta('currency_id'));
|
||||
$journal = $transaction->transactionJournal;
|
||||
|
||||
if (!(intval($currency->id) === intval($journal->transaction_currency_id))) {
|
||||
if (!((int)$currency->id === (int)$journal->transaction_currency_id)) {
|
||||
$this->line(
|
||||
sprintf(
|
||||
'Transfer #%d ("%s") has been updated to use %s instead of %s.',
|
||||
@@ -331,7 +481,6 @@ class UpgradeDatabase extends Command
|
||||
$journal->save();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -348,7 +497,7 @@ class UpgradeDatabase extends Command
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($transactions as $transaction) {
|
||||
// find opposing:
|
||||
$amount = bcmul(strval($transaction->amount), '-1');
|
||||
$amount = bcmul((string)$transaction->amount, '-1');
|
||||
|
||||
try {
|
||||
/** @var Transaction $opposing */
|
||||
@@ -377,7 +526,6 @@ class UpgradeDatabase extends Command
|
||||
++$identifier;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -398,18 +546,24 @@ class UpgradeDatabase extends Command
|
||||
{
|
||||
/** @var CurrencyRepositoryInterface $repository */
|
||||
$repository = app(CurrencyRepositoryInterface::class);
|
||||
$currency = $repository->find(intval($transaction->account->getMeta('currency_id')));
|
||||
$currency = $repository->findNull((int)$transaction->account->getMeta('currency_id'));
|
||||
|
||||
if (null === $currency) {
|
||||
Log::error(sprintf('Account #%d ("%s") must have currency preference but has none.', $transaction->account->id, $transaction->account->name));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// has no currency ID? Must have, so fill in using account preference:
|
||||
if (null === $transaction->transaction_currency_id) {
|
||||
$transaction->transaction_currency_id = intval($currency->id);
|
||||
$transaction->transaction_currency_id = (int)$currency->id;
|
||||
Log::debug(sprintf('Transaction #%d has no currency setting, now set to %s', $transaction->id, $currency->code));
|
||||
$transaction->save();
|
||||
}
|
||||
|
||||
// does not match the source account (see above)? Can be fixed
|
||||
// when mismatch in transaction and NO foreign amount is set:
|
||||
if (!(intval($transaction->transaction_currency_id) === intval($currency->id)) && null === $transaction->foreign_amount) {
|
||||
if (!((int)$transaction->transaction_currency_id === (int)$currency->id) && null === $transaction->foreign_amount) {
|
||||
Log::debug(
|
||||
sprintf(
|
||||
'Transaction #%d has a currency setting #%d that should be #%d. Amount remains %s, currency is changed.',
|
||||
@@ -419,7 +573,7 @@ class UpgradeDatabase extends Command
|
||||
$transaction->amount
|
||||
)
|
||||
);
|
||||
$transaction->transaction_currency_id = intval($currency->id);
|
||||
$transaction->transaction_currency_id = (int)$currency->id;
|
||||
$transaction->save();
|
||||
}
|
||||
|
||||
@@ -428,16 +582,16 @@ class UpgradeDatabase extends Command
|
||||
$journal = $transaction->transactionJournal;
|
||||
/** @var Transaction $opposing */
|
||||
$opposing = $journal->transactions()->where('amount', '>', 0)->where('identifier', $transaction->identifier)->first();
|
||||
$opposingCurrency = $repository->find(intval($opposing->account->getMeta('currency_id')));
|
||||
$opposingCurrency = $repository->findNull((int)$opposing->account->getMeta('currency_id'));
|
||||
|
||||
if (null === $opposingCurrency->id) {
|
||||
if (null === $opposingCurrency) {
|
||||
Log::error(sprintf('Account #%d ("%s") must have currency preference but has none.', $opposing->account->id, $opposing->account->name));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// if the destination account currency is the same, both foreign_amount and foreign_currency_id must be NULL for both transactions:
|
||||
if (intval($opposingCurrency->id) === intval($currency->id)) {
|
||||
if ((int)$opposingCurrency->id === (int)$currency->id) {
|
||||
// update both transactions to match:
|
||||
$transaction->foreign_amount = null;
|
||||
$transaction->foreign_currency_id = null;
|
||||
@@ -446,12 +600,17 @@ class UpgradeDatabase extends Command
|
||||
$opposing->transaction_currency_id = $currency->id;
|
||||
$transaction->save();
|
||||
$opposing->save();
|
||||
Log::debug(sprintf('Cleaned up transaction #%d and #%d', $transaction->id, $opposing->id));
|
||||
Log::debug(sprintf('Currency for account "%s" is %s, and currency for account "%s" is also
|
||||
%s, so %s #%d (#%d and #%d) has been verified to be to %s exclusively.',
|
||||
$opposing->account->name, $opposingCurrency->code,
|
||||
$transaction->account->name, $transaction->transactionCurrency->code,
|
||||
$journal->transactionType->type, $journal->id,
|
||||
$transaction->id, $opposing->id, $currency->code));
|
||||
|
||||
return;
|
||||
}
|
||||
// if destination account currency is different, both transactions must have this currency as foreign currency id.
|
||||
if (!(intval($opposingCurrency->id) === intval($currency->id))) {
|
||||
if (!((int)$opposingCurrency->id === (int)$currency->id)) {
|
||||
$transaction->foreign_currency_id = $opposingCurrency->id;
|
||||
$opposing->foreign_currency_id = $opposingCurrency->id;
|
||||
$transaction->save();
|
||||
@@ -461,14 +620,14 @@ class UpgradeDatabase extends Command
|
||||
|
||||
// if foreign amount of one is null and the other is not, use this to restore:
|
||||
if (null === $transaction->foreign_amount && null !== $opposing->foreign_amount) {
|
||||
$transaction->foreign_amount = bcmul(strval($opposing->foreign_amount), '-1');
|
||||
$transaction->foreign_amount = bcmul((string)$opposing->foreign_amount, '-1');
|
||||
$transaction->save();
|
||||
Log::debug(sprintf('Restored foreign amount of transaction (1) #%d to %s', $transaction->id, $transaction->foreign_amount));
|
||||
}
|
||||
|
||||
// if foreign amount of one is null and the other is not, use this to restore (other way around)
|
||||
if (null === $opposing->foreign_amount && null !== $transaction->foreign_amount) {
|
||||
$opposing->foreign_amount = bcmul(strval($transaction->foreign_amount), '-1');
|
||||
$opposing->foreign_amount = bcmul((string)$transaction->foreign_amount, '-1');
|
||||
$opposing->save();
|
||||
Log::debug(sprintf('Restored foreign amount of transaction (2) #%d to %s', $opposing->id, $opposing->foreign_amount));
|
||||
}
|
||||
@@ -478,14 +637,14 @@ class UpgradeDatabase extends Command
|
||||
$foreignAmount = $journal->getMeta('foreign_amount');
|
||||
if (null === $foreignAmount) {
|
||||
Log::debug(sprintf('Journal #%d has missing foreign currency data, forced to do 1:1 conversion :(.', $transaction->transaction_journal_id));
|
||||
$transaction->foreign_amount = bcmul(strval($transaction->amount), '-1');
|
||||
$opposing->foreign_amount = bcmul(strval($opposing->amount), '-1');
|
||||
$transaction->foreign_amount = bcmul((string)$transaction->amount, '-1');
|
||||
$opposing->foreign_amount = bcmul((string)$opposing->amount, '-1');
|
||||
$transaction->save();
|
||||
$opposing->save();
|
||||
|
||||
return;
|
||||
}
|
||||
$foreignPositive = app('steam')->positive(strval($foreignAmount));
|
||||
$foreignPositive = app('steam')->positive((string)$foreignAmount);
|
||||
Log::debug(
|
||||
sprintf(
|
||||
'Journal #%d has missing foreign currency info, try to restore from meta-data ("%s").',
|
||||
@@ -499,7 +658,6 @@ class UpgradeDatabase extends Command
|
||||
$opposing->save();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* UpgradeFireflyInstructions.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -42,14 +42,6 @@ class UpgradeFireflyInstructions extends Command
|
||||
*/
|
||||
protected $signature = 'firefly:instructions {task}';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
@@ -100,7 +92,7 @@ class UpgradeFireflyInstructions extends Command
|
||||
$text = '';
|
||||
foreach (array_keys($config) as $compare) {
|
||||
// if string starts with:
|
||||
$len = strlen($compare);
|
||||
$len = \strlen($compare);
|
||||
if (substr($version, 0, $len) === $compare) {
|
||||
$text = $config[$compare];
|
||||
}
|
||||
@@ -147,7 +139,7 @@ class UpgradeFireflyInstructions extends Command
|
||||
$text = '';
|
||||
foreach (array_keys($config) as $compare) {
|
||||
// if string starts with:
|
||||
$len = strlen($compare);
|
||||
$len = \strlen($compare);
|
||||
if (substr($version, 0, $len) === $compare) {
|
||||
$text = $config[$compare];
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* UseEncryption.php
|
||||
@@ -19,7 +20,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -44,14 +44,6 @@ class UseEncryption extends Command
|
||||
*/
|
||||
protected $signature = 'firefly:use-encryption';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* VerifiesAccessToken.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -49,11 +49,11 @@ trait VerifiesAccessToken
|
||||
*/
|
||||
protected function verifyAccessToken(): bool
|
||||
{
|
||||
$userId = intval($this->option('user'));
|
||||
$token = strval($this->option('token'));
|
||||
$userId = (int)$this->option('user');
|
||||
$token = (string)$this->option('token');
|
||||
/** @var UserRepositoryInterface $repository */
|
||||
$repository = app(UserRepositoryInterface::class);
|
||||
$user = $repository->find($userId);
|
||||
$user = $repository->findNull($userId);
|
||||
|
||||
if (null === $user) {
|
||||
Log::error(sprintf('verifyAccessToken(): no such user for input "%d"', $userId));
|
||||
@@ -68,7 +68,7 @@ trait VerifiesAccessToken
|
||||
}
|
||||
if (!($accessToken->data === $token)) {
|
||||
Log::error(sprintf('Invalid access token for user #%d.', $userId));
|
||||
Log::error(sprintf('Token given is "%s", expected "%s".', $token, $accessToken->data));
|
||||
Log::error(sprintf('Token given is "%s", expected something else.', $token));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* VerifyDatabase.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
@@ -61,14 +61,6 @@ class VerifyDatabase extends Command
|
||||
*/
|
||||
protected $signature = 'firefly:verify';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
@@ -95,12 +87,13 @@ class VerifyDatabase extends Command
|
||||
$this->createLinkTypes();
|
||||
$this->createAccessTokens();
|
||||
$this->fixDoubleAmounts();
|
||||
$this->fixBadMeta();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create user access tokens, if not present already.
|
||||
*/
|
||||
private function createAccessTokens()
|
||||
private function createAccessTokens(): void
|
||||
{
|
||||
$count = 0;
|
||||
$users = User::get();
|
||||
@@ -122,7 +115,7 @@ class VerifyDatabase extends Command
|
||||
/**
|
||||
* Create default link types if necessary.
|
||||
*/
|
||||
private function createLinkTypes()
|
||||
private function createLinkTypes(): void
|
||||
{
|
||||
$count = 0;
|
||||
$set = [
|
||||
@@ -148,7 +141,69 @@ class VerifyDatabase extends Command
|
||||
}
|
||||
}
|
||||
|
||||
private function fixDoubleAmounts()
|
||||
/**
|
||||
* Fix the situation where the matching transactions
|
||||
* of a journal somehow have non-matching categories
|
||||
* or budgets
|
||||
*/
|
||||
private function fixBadMeta(): void
|
||||
{
|
||||
// categories
|
||||
$set = Transaction
|
||||
::leftJoin('category_transaction', 'category_transaction.transaction_id', '=', 'transactions.id')
|
||||
->whereNull('transactions.deleted_at')
|
||||
->get(['transactions.id', 'transaction_journal_id', 'identifier', 'category_transaction.category_id', 'category_transaction.id as ct_id']);
|
||||
$results = [];
|
||||
foreach ($set as $obj) {
|
||||
$key = $obj->transaction_journal_id . '-' . $obj->identifier;
|
||||
$category = (int)$obj->category_id;
|
||||
|
||||
// value exists and is not category:
|
||||
if (isset($results[$key]) && $results[$key] !== $category) {
|
||||
$this->error(
|
||||
sprintf(
|
||||
'Transaction #%d referred to the wrong category. Was category #%d but is fixed to be category #%d.', $obj->transaction_journal_id, $category, $results[$key]
|
||||
)
|
||||
);
|
||||
DB::table('category_transaction')->where('id', $obj->ct_id)->update(['category_id' => $results[$key]]);
|
||||
|
||||
}
|
||||
|
||||
// value does not exist:
|
||||
if ($category > 0 && !isset($results[$key])) {
|
||||
$results[$key] = $category;
|
||||
}
|
||||
}
|
||||
|
||||
// budgets
|
||||
$set = Transaction
|
||||
::leftJoin('budget_transaction', 'budget_transaction.transaction_id', '=', 'transactions.id')
|
||||
->whereNull('transactions.deleted_at')
|
||||
->get(['transactions.id', 'transaction_journal_id', 'identifier', 'budget_transaction.budget_id', 'budget_transaction.id as ct_id']);
|
||||
$results = [];
|
||||
foreach ($set as $obj) {
|
||||
$key = $obj->transaction_journal_id . '-' . $obj->identifier;
|
||||
$budget = (int)$obj->budget_id;
|
||||
|
||||
// value exists and is not budget:
|
||||
if (isset($results[$key]) && $results[$key] !== $budget) {
|
||||
$this->error(
|
||||
sprintf(
|
||||
'Transaction #%d referred to the wrong budget. Was budget #%d but is fixed to be budget #%d.', $obj->transaction_journal_id, $budget, $results[$key]
|
||||
)
|
||||
);
|
||||
DB::table('budget_transaction')->where('id', $obj->ct_id)->update(['budget_id' => $results[$key]]);
|
||||
|
||||
}
|
||||
|
||||
// value does not exist:
|
||||
if ($budget > 0 && !isset($results[$key])) {
|
||||
$results[$key] = $budget;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function fixDoubleAmounts(): void
|
||||
{
|
||||
$count = 0;
|
||||
// get invalid journals
|
||||
@@ -158,7 +213,7 @@ class VerifyDatabase extends Command
|
||||
->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')]);
|
||||
/** @var stdClass $entry */
|
||||
foreach ($journals as $entry) {
|
||||
if (0 !== bccomp(strval($entry->the_sum), '0')) {
|
||||
if (0 !== bccomp((string)$entry->the_sum, '0')) {
|
||||
$errored[] = $entry->transaction_journal_id;
|
||||
}
|
||||
}
|
||||
@@ -171,7 +226,7 @@ class VerifyDatabase extends Command
|
||||
// report about it
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = TransactionJournal::find($journalId);
|
||||
if (is_null($journal)) {
|
||||
if (null === $journal) {
|
||||
continue;
|
||||
}
|
||||
if (TransactionType::OPENING_BALANCE === $journal->transactionType->type) {
|
||||
@@ -194,8 +249,6 @@ class VerifyDatabase extends Command
|
||||
if (0 === $count) {
|
||||
$this->info('Amount integrity OK!');
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,8 +278,6 @@ class VerifyDatabase extends Command
|
||||
return true;
|
||||
}
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -254,7 +305,7 @@ class VerifyDatabase extends Command
|
||||
/**
|
||||
* Reports on budgets with no budget limits (which makes them pointless).
|
||||
*/
|
||||
private function reportBudgetLimits()
|
||||
private function reportBudgetLimits(): void
|
||||
{
|
||||
$set = Budget::leftJoin('budget_limits', 'budget_limits.budget_id', '=', 'budgets.id')
|
||||
->leftJoin('users', 'budgets.user_id', '=', 'users.id')
|
||||
@@ -278,7 +329,7 @@ class VerifyDatabase extends Command
|
||||
/**
|
||||
* Reports on deleted accounts that still have not deleted transactions or journals attached to them.
|
||||
*/
|
||||
private function reportDeletedAccounts()
|
||||
private function reportDeletedAccounts(): void
|
||||
{
|
||||
$set = Account::leftJoin('transactions', 'transactions.account_id', '=', 'accounts.id')
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
@@ -297,7 +348,7 @@ class VerifyDatabase extends Command
|
||||
);
|
||||
/** @var stdClass $entry */
|
||||
foreach ($set as $entry) {
|
||||
$date = null === $entry->transaction_deleted_at ? $entry->journal_deleted_at : $entry->transaction_deleted_at;
|
||||
$date = $entry->transaction_deleted_at ?? $entry->journal_deleted_at;
|
||||
$this->error(
|
||||
'Error: Account #' . $entry->account_id . ' should have been deleted, but has not.' .
|
||||
' Find it in the table called "accounts" and change the "deleted_at" field to: "' . $date . '"'
|
||||
@@ -308,7 +359,7 @@ class VerifyDatabase extends Command
|
||||
/**
|
||||
* Report on journals with bad account types linked to them.
|
||||
*/
|
||||
private function reportIncorrectJournals()
|
||||
private function reportIncorrectJournals(): void
|
||||
{
|
||||
$configuration = [
|
||||
// a withdrawal can not have revenue account:
|
||||
@@ -350,7 +401,7 @@ class VerifyDatabase extends Command
|
||||
/**
|
||||
* Any deleted transaction journals that have transactions that are NOT deleted:.
|
||||
*/
|
||||
private function reportJournals()
|
||||
private function reportJournals(): void
|
||||
{
|
||||
$count = 0;
|
||||
$set = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
@@ -381,7 +432,7 @@ class VerifyDatabase extends Command
|
||||
/**
|
||||
* Report on journals without transactions.
|
||||
*/
|
||||
private function reportNoTransactions()
|
||||
private function reportNoTransactions(): void
|
||||
{
|
||||
$count = 0;
|
||||
$set = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
@@ -405,7 +456,7 @@ class VerifyDatabase extends Command
|
||||
*
|
||||
* @param string $name
|
||||
*/
|
||||
private function reportObject(string $name)
|
||||
private function reportObject(string $name): void
|
||||
{
|
||||
$plural = str_plural($name);
|
||||
$class = sprintf('FireflyIII\Models\%s', ucfirst($name));
|
||||
@@ -441,14 +492,14 @@ class VerifyDatabase extends Command
|
||||
/**
|
||||
* Reports for each user when the sum of their transactions is not zero.
|
||||
*/
|
||||
private function reportSum()
|
||||
private function reportSum(): void
|
||||
{
|
||||
/** @var UserRepositoryInterface $userRepository */
|
||||
$userRepository = app(UserRepositoryInterface::class);
|
||||
|
||||
/** @var User $user */
|
||||
foreach ($userRepository->all() as $user) {
|
||||
$sum = strval($user->transactions()->sum('amount'));
|
||||
$sum = (string)$user->transactions()->sum('amount');
|
||||
if (0 !== bccomp($sum, '0')) {
|
||||
$this->error('Error: Transactions for user #' . $user->id . ' (' . $user->email . ') are off by ' . $sum . '!');
|
||||
} else {
|
||||
@@ -460,7 +511,7 @@ class VerifyDatabase extends Command
|
||||
/**
|
||||
* Reports on deleted transactions that are connected to a not deleted journal.
|
||||
*/
|
||||
private function reportTransactions()
|
||||
private function reportTransactions(): void
|
||||
{
|
||||
$set = Transaction::leftJoin('transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->whereNotNull('transactions.deleted_at')
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* Kernel.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* AdminRequestedTestMessage.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* Event.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* RegisteredUser.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* RequestedNewPassword.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* RequestedVersionCheckStatus.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
@@ -49,4 +49,4 @@ class RequestedVersionCheckStatus extends Event
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* StoredTransactionJournal.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
@@ -26,6 +26,7 @@ use FireflyIII\Models\TransactionJournal;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* Class StoredTransactionJournal.
|
||||
*/
|
||||
class StoredTransactionJournal extends Event
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* UpdatedTransactionJournal.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
@@ -27,6 +27,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class UpdatedTransactionJournal.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
*/
|
||||
class UpdatedTransactionJournal extends Event
|
||||
{
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* UserChangedEmail.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* FireflyException.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,13 +19,14 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class FireflyException.
|
||||
*/
|
||||
class FireflyException extends \Exception
|
||||
class FireflyException extends Exception
|
||||
{
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* Handler.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Exceptions;
|
||||
|
||||
@@ -70,21 +70,22 @@ class Handler extends ExceptionHandler
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
if ($exception instanceof NotFoundHttpException && $request->expectsJson()) {
|
||||
// JSON error:
|
||||
return response()->json(['message' => 'Resource not found', 'exception' => 'NotFoundHttpException'], 404);
|
||||
}
|
||||
|
||||
if ($exception instanceof AuthenticationException && $request->expectsJson()) {
|
||||
// somehow Laravel handler does not catch this:
|
||||
return response()->json(['message' => 'Unauthenticated', 'exception' => 'AuthenticationException'], 401);
|
||||
}
|
||||
|
||||
|
||||
if ($request->expectsJson()) {
|
||||
$isDebug = config('app.debug', false);
|
||||
if ($isDebug) {
|
||||
return response()->json(
|
||||
[
|
||||
'message' => $exception->getMessage(),
|
||||
'exception' => get_class($exception),
|
||||
'exception' => \get_class($exception),
|
||||
'line' => $exception->getLine(),
|
||||
'file' => $exception->getFile(),
|
||||
'trace' => $exception->getTrace(),
|
||||
@@ -92,7 +93,7 @@ class Handler extends ExceptionHandler
|
||||
);
|
||||
}
|
||||
|
||||
return response()->json(['message' => 'Internal Firefly III Exception. See log files.', 'exception' => get_class($exception)], 500);
|
||||
return response()->json(['message' => 'Internal Firefly III Exception. See log files.', 'exception' => \get_class($exception)], 500);
|
||||
}
|
||||
|
||||
if ($exception instanceof FireflyException || $exception instanceof ErrorException) {
|
||||
@@ -130,7 +131,7 @@ class Handler extends ExceptionHandler
|
||||
$userData['email'] = auth()->user()->email;
|
||||
}
|
||||
$data = [
|
||||
'class' => get_class($exception),
|
||||
'class' => \get_class($exception),
|
||||
'errorMessage' => $exception->getMessage(),
|
||||
'time' => date('r'),
|
||||
'stackTrace' => $exception->getTraceAsString(),
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* NotImplementedException.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Exceptions;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* ValidationException.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Exceptions;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* AttachmentCollector.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Collector;
|
||||
|
||||
@@ -97,14 +97,16 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
|
||||
$file = $attachment->fileName();
|
||||
if ($this->uploadDisk->exists($file)) {
|
||||
try {
|
||||
$decrypted = Crypt::decrypt($this->uploadDisk->get($file));
|
||||
$exportFile = $this->exportFileName($attachment);
|
||||
$this->exportDisk->put($exportFile, $decrypted);
|
||||
$this->getEntries()->push($exportFile);
|
||||
$decrypted = Crypt::decrypt($this->uploadDisk->get($file));
|
||||
} catch (DecryptException $e) {
|
||||
Log::error('Catchable error: could not decrypt attachment #' . $attachment->id . ' because: ' . $e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$exportFile = $this->exportFileName($attachment);
|
||||
$this->exportDisk->put($exportFile, $decrypted);
|
||||
$this->getEntries()->push($exportFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -118,7 +120,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
|
||||
*/
|
||||
private function exportFileName($attachment): string
|
||||
{
|
||||
return sprintf('%s-Attachment nr. %s - %s', $this->job->key, strval($attachment->id), $attachment->filename);
|
||||
return sprintf('%s-Attachment nr. %s - %s', $this->job->key, (string)$attachment->id, $attachment->filename);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,8 +129,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
|
||||
private function getAttachments(): Collection
|
||||
{
|
||||
$this->repository->setUser($this->user);
|
||||
$attachments = $this->repository->getBetween($this->start, $this->end);
|
||||
|
||||
return $attachments;
|
||||
return $this->repository->getBetween($this->start, $this->end);
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* BasicCollector.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Collector;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* CollectorInterface.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Collector;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* UploadCollector.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,13 +19,12 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Collector;
|
||||
|
||||
use Crypt;
|
||||
use Exception;
|
||||
use Illuminate\Contracts\Encryption\DecryptException;
|
||||
use Illuminate\Contracts\Filesystem\FileNotFoundException;
|
||||
use Log;
|
||||
use Storage;
|
||||
|
||||
@@ -99,11 +99,11 @@ class UploadCollector extends BasicCollector implements CollectorInterface
|
||||
$content = '';
|
||||
try {
|
||||
$content = Crypt::decrypt($this->uploadDisk->get(sprintf('%s.upload', $key)));
|
||||
} catch (FileNotFoundException | DecryptException $e) {
|
||||
} catch (Exception | DecryptException $e) {
|
||||
Log::error(sprintf('Could not decrypt old import file "%s". Skipped because: %s', $key, $e->getMessage()));
|
||||
}
|
||||
|
||||
if (strlen($content) > 0) {
|
||||
if (\strlen($content) > 0) {
|
||||
// add to export disk.
|
||||
$date = $job->created_at->format('Y-m-d');
|
||||
$file = sprintf('%s-Old %s import dated %s.%s', $this->job->key, strtoupper($job->file_type), $date, $job->file_type);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* Entry.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Entry;
|
||||
|
||||
@@ -199,31 +199,29 @@ final class Entry
|
||||
$entry->transaction_id = $transaction->id;
|
||||
$entry->date = $transaction->date->format('Ymd');
|
||||
$entry->description = $transaction->description;
|
||||
if (strlen(strval($transaction->transaction_description)) > 0) {
|
||||
if (\strlen((string)$transaction->transaction_description) > 0) {
|
||||
$entry->description = $transaction->transaction_description . '(' . $transaction->description . ')';
|
||||
}
|
||||
$entry->currency_code = $transaction->transactionCurrency->code;
|
||||
$entry->amount = strval(round($transaction->transaction_amount, $transaction->transactionCurrency->decimal_places));
|
||||
$entry->amount = (string)round($transaction->transaction_amount, $transaction->transactionCurrency->decimal_places);
|
||||
|
||||
$entry->foreign_currency_code = null === $transaction->foreign_currency_id ? null : $transaction->foreignCurrency->code;
|
||||
$entry->foreign_amount = null === $transaction->foreign_currency_id
|
||||
? null
|
||||
: strval(
|
||||
round(
|
||||
$transaction->transaction_foreign_amount,
|
||||
$transaction->foreignCurrency->decimal_places
|
||||
)
|
||||
: (string)round(
|
||||
$transaction->transaction_foreign_amount,
|
||||
$transaction->foreignCurrency->decimal_places
|
||||
);
|
||||
|
||||
$entry->transaction_type = $transaction->transaction_type_type;
|
||||
$entry->asset_account_id = strval($transaction->account_id);
|
||||
$entry->asset_account_id = (string)$transaction->account_id;
|
||||
$entry->asset_account_name = app('steam')->tryDecrypt($transaction->account_name);
|
||||
$entry->asset_account_iban = $transaction->account_iban;
|
||||
$entry->asset_account_number = $transaction->account_number;
|
||||
$entry->asset_account_bic = $transaction->account_bic;
|
||||
$entry->asset_currency_code = $transaction->account_currency_code;
|
||||
|
||||
$entry->opposing_account_id = strval($transaction->opposing_account_id);
|
||||
$entry->opposing_account_id = (string)$transaction->opposing_account_id;
|
||||
$entry->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name);
|
||||
$entry->opposing_account_iban = $transaction->opposing_account_iban;
|
||||
$entry->opposing_account_number = $transaction->opposing_account_number;
|
||||
@@ -231,7 +229,7 @@ final class Entry
|
||||
$entry->opposing_currency_code = $transaction->opposing_currency_code;
|
||||
|
||||
// budget
|
||||
$entry->budget_id = strval($transaction->transaction_budget_id);
|
||||
$entry->budget_id = (string)$transaction->transaction_budget_id;
|
||||
$entry->budget_name = app('steam')->tryDecrypt($transaction->transaction_budget_name);
|
||||
if (null === $transaction->transaction_budget_id) {
|
||||
$entry->budget_id = $transaction->transaction_journal_budget_id;
|
||||
@@ -239,7 +237,7 @@ final class Entry
|
||||
}
|
||||
|
||||
// category
|
||||
$entry->category_id = strval($transaction->transaction_category_id);
|
||||
$entry->category_id = (string)$transaction->transaction_category_id;
|
||||
$entry->category_name = app('steam')->tryDecrypt($transaction->transaction_category_name);
|
||||
if (null === $transaction->transaction_category_id) {
|
||||
$entry->category_id = $transaction->transaction_journal_category_id;
|
||||
@@ -247,7 +245,7 @@ final class Entry
|
||||
}
|
||||
|
||||
// budget
|
||||
$entry->bill_id = strval($transaction->bill_id);
|
||||
$entry->bill_id = (string)$transaction->bill_id;
|
||||
$entry->bill_name = app('steam')->tryDecrypt($transaction->bill_name);
|
||||
|
||||
$entry->tags = $transaction->tags;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* ExpandedProcessor.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export;
|
||||
|
||||
@@ -39,6 +39,7 @@ use Illuminate\Support\Collection;
|
||||
use Log;
|
||||
use Storage;
|
||||
use ZipArchive;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
|
||||
/**
|
||||
* Class ExpandedProcessor.
|
||||
@@ -118,13 +119,13 @@ class ExpandedProcessor implements ProcessorInterface
|
||||
$currencies = $this->getAccountCurrencies($ibans);
|
||||
$transactions->each(
|
||||
function (Transaction $transaction) use ($notes, $tags, $ibans, $currencies) {
|
||||
$journalId = intval($transaction->journal_id);
|
||||
$accountId = intval($transaction->account_id);
|
||||
$opposingId = intval($transaction->opposing_account_id);
|
||||
$currencyId = $ibans[$accountId]['currency_id'] ?? 0;
|
||||
$opposingCurrencyId = $ibans[$opposingId]['currency_id'] ?? 0;
|
||||
$journalId = (int)$transaction->journal_id;
|
||||
$accountId = (int)$transaction->account_id;
|
||||
$opposingId = (int)$transaction->opposing_account_id;
|
||||
$currencyId = (int)($ibans[$accountId]['currency_id'] ?? 0.0);
|
||||
$opposingCurrencyId = (int)($ibans[$opposingId]['currency_id'] ?? 0.0);
|
||||
$transaction->notes = $notes[$journalId] ?? '';
|
||||
$transaction->tags = join(',', $tags[$journalId] ?? []);
|
||||
$transaction->tags = implode(',', $tags[$journalId] ?? []);
|
||||
$transaction->account_number = $ibans[$accountId]['accountNumber'] ?? '';
|
||||
$transaction->account_bic = $ibans[$accountId]['BIC'] ?? '';
|
||||
$transaction->account_currency_code = $currencies[$currencyId] ?? '';
|
||||
@@ -263,7 +264,7 @@ class ExpandedProcessor implements ProcessorInterface
|
||||
$ids = [];
|
||||
$repository->setUser($this->job->user);
|
||||
foreach ($array as $value) {
|
||||
$ids[] = $value['currency_id'] ?? 0;
|
||||
$ids[] = (int)($value['currency_id'] ?? 0.0);
|
||||
}
|
||||
$ids = array_unique($ids);
|
||||
$result = $repository->getByIds($ids);
|
||||
@@ -293,7 +294,7 @@ class ExpandedProcessor implements ProcessorInterface
|
||||
->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data']);
|
||||
/** @var AccountMeta $meta */
|
||||
foreach ($set as $meta) {
|
||||
$id = intval($meta->account_id);
|
||||
$id = (int)$meta->account_id;
|
||||
$return[$id][$meta->name] = $meta->data;
|
||||
}
|
||||
|
||||
@@ -310,14 +311,14 @@ class ExpandedProcessor implements ProcessorInterface
|
||||
private function getNotes(array $array): array
|
||||
{
|
||||
$array = array_unique($array);
|
||||
$notes = Note::where('notes.noteable_type', 'FireflyIII\\Models\\TransactionJournal')
|
||||
$notes = Note::where('notes.noteable_type', TransactionJournal::class)
|
||||
->whereIn('notes.noteable_id', $array)
|
||||
->get(['notes.*']);
|
||||
$return = [];
|
||||
/** @var Note $note */
|
||||
foreach ($notes as $note) {
|
||||
if (strlen(trim(strval($note->text))) > 0) {
|
||||
$id = intval($note->noteable_id);
|
||||
if (\strlen(trim((string)$note->text)) > 0) {
|
||||
$id = (int)$note->noteable_id;
|
||||
$return[$id] = $note->text;
|
||||
}
|
||||
}
|
||||
@@ -331,6 +332,7 @@ class ExpandedProcessor implements ProcessorInterface
|
||||
* @param array $array
|
||||
*
|
||||
* @return array
|
||||
* @throws \Illuminate\Contracts\Encryption\DecryptException
|
||||
*/
|
||||
private function getTags(array $array): array
|
||||
{
|
||||
@@ -342,8 +344,8 @@ class ExpandedProcessor implements ProcessorInterface
|
||||
->get(['tag_transaction_journal.transaction_journal_id', 'tags.tag']);
|
||||
$result = [];
|
||||
foreach ($set as $entry) {
|
||||
$id = intval($entry->transaction_journal_id);
|
||||
$result[$id] = isset($result[$id]) ? $result[$id] : [];
|
||||
$id = (int)$entry->transaction_journal_id;
|
||||
$result[$id] = $result[$id] ?? [];
|
||||
$result[$id][] = Crypt::decrypt($entry->tag);
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* BasicExporter.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Exporter;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* CsvExporter.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Exporter;
|
||||
|
||||
@@ -34,14 +34,6 @@ class CsvExporter extends BasicExporter implements ExporterInterface
|
||||
/** @var string */
|
||||
private $fileName;
|
||||
|
||||
/**
|
||||
* CsvExporter constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -53,7 +45,6 @@ class CsvExporter extends BasicExporter implements ExporterInterface
|
||||
/**
|
||||
* @return bool
|
||||
*
|
||||
* @throws \TypeError
|
||||
*/
|
||||
public function run(): bool
|
||||
{
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* ExporterInterface.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export\Exporter;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* ProcessorInterface.php
|
||||
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
||||
@@ -18,7 +19,6 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Export;
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* AccountFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
@@ -63,8 +63,8 @@ class AccountFactory
|
||||
'user_id' => $this->user->id,
|
||||
'account_type_id' => $type->id,
|
||||
'name' => $data['name'],
|
||||
'virtual_balance' => strlen(strval($data['virtualBalance'])) === 0 ? '0' : $data['virtualBalance'],
|
||||
'active' => true === $data['active'] ? true : false,
|
||||
'virtual_balance' => $data['virtualBalance'] ?? '0',
|
||||
'active' => true === $data['active'],
|
||||
'iban' => $data['iban'],
|
||||
];
|
||||
|
||||
@@ -73,8 +73,13 @@ class AccountFactory
|
||||
$databaseData['virtual_balance'] = '0';
|
||||
}
|
||||
|
||||
// fix virtual balance when it's empty
|
||||
if ($databaseData['virtual_balance'] === '') {
|
||||
$databaseData['virtual_balance'] = '0';
|
||||
}
|
||||
|
||||
$newAccount = Account::create($databaseData);
|
||||
$this->updateMetadata($newAccount, $data);
|
||||
$this->updateMetaData($newAccount, $data);
|
||||
|
||||
if ($this->validIBData($data) && $type->type === AccountType::ASSET) {
|
||||
$this->updateIB($newAccount, $data);
|
||||
@@ -158,14 +163,19 @@ class AccountFactory
|
||||
*/
|
||||
protected function getAccountType(?int $accountTypeId, ?string $accountType): ?AccountType
|
||||
{
|
||||
$accountTypeId = intval($accountTypeId);
|
||||
$accountTypeId = (int)$accountTypeId;
|
||||
if ($accountTypeId > 0) {
|
||||
return AccountType::find($accountTypeId);
|
||||
}
|
||||
$type = config('firefly.accountTypeByIdentifier.' . strval($accountType));
|
||||
$type = config('firefly.accountTypeByIdentifier.' . (string)$accountType);
|
||||
$result = AccountType::whereType($type)->first();
|
||||
if (null === $result && null !== $accountType) {
|
||||
// try as full name:
|
||||
$result = AccountType::whereType($accountType)->first();
|
||||
}
|
||||
|
||||
return AccountType::whereType($type)->first();
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* AccountMetaFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
@@ -40,4 +40,4 @@ class AccountMetaFactory
|
||||
return AccountMeta::create($data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* BillFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
@@ -45,23 +45,20 @@ class BillFactory
|
||||
*/
|
||||
public function create(array $data): ?Bill
|
||||
{
|
||||
$matchArray = explode(',', $data['match']);
|
||||
$matchArray = array_unique($matchArray);
|
||||
$match = join(',', $matchArray);
|
||||
|
||||
/** @var Bill $bill */
|
||||
$bill = Bill::create(
|
||||
[
|
||||
'name' => $data['name'],
|
||||
'match' => $match,
|
||||
'amount_min' => $data['amount_min'],
|
||||
'user_id' => $this->user->id,
|
||||
'amount_max' => $data['amount_max'],
|
||||
'date' => $data['date'],
|
||||
'repeat_freq' => $data['repeat_freq'],
|
||||
'skip' => $data['skip'],
|
||||
'automatch' => $data['automatch'],
|
||||
'active' => $data['active'],
|
||||
'name' => $data['name'],
|
||||
'match' => 'MIGRATED_TO_RULES',
|
||||
'amount_min' => $data['amount_min'],
|
||||
'user_id' => $this->user->id,
|
||||
'transaction_currency_id' => $data['transaction_currency_id'],
|
||||
'amount_max' => $data['amount_max'],
|
||||
'date' => $data['date'],
|
||||
'repeat_freq' => $data['repeat_freq'],
|
||||
'skip' => $data['skip'],
|
||||
'automatch' => true,
|
||||
'active' => $data['active'],
|
||||
]
|
||||
);
|
||||
|
||||
@@ -81,22 +78,22 @@ class BillFactory
|
||||
*/
|
||||
public function find(?int $billId, ?string $billName): ?Bill
|
||||
{
|
||||
$billId = intval($billId);
|
||||
$billName = strval($billName);
|
||||
$billId = (int)$billId;
|
||||
$billName = (string)$billName;
|
||||
|
||||
// first find by ID:
|
||||
if ($billId > 0) {
|
||||
/** @var Bill $bill */
|
||||
$bill = $this->user->bills()->find($billId);
|
||||
if (!is_null($bill)) {
|
||||
if (null !== $bill) {
|
||||
return $bill;
|
||||
}
|
||||
}
|
||||
|
||||
// then find by name:
|
||||
if (strlen($billName) > 0) {
|
||||
if (\strlen($billName) > 0) {
|
||||
$bill = $this->findByName($billName);
|
||||
if (!is_null($bill)) {
|
||||
if (null !== $bill) {
|
||||
return $bill;
|
||||
}
|
||||
}
|
||||
@@ -134,4 +131,4 @@ class BillFactory
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* BudgetFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
@@ -44,10 +44,10 @@ class BudgetFactory
|
||||
*/
|
||||
public function find(?int $budgetId, ?string $budgetName): ?Budget
|
||||
{
|
||||
$budgetId = intval($budgetId);
|
||||
$budgetName = strval($budgetName);
|
||||
$budgetId = (int)$budgetId;
|
||||
$budgetName = (string)$budgetName;
|
||||
|
||||
if (strlen($budgetName) === 0 && $budgetId === 0) {
|
||||
if (\strlen($budgetName) === 0 && $budgetId === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -55,14 +55,14 @@ class BudgetFactory
|
||||
if ($budgetId > 0) {
|
||||
/** @var Budget $budget */
|
||||
$budget = $this->user->budgets()->find($budgetId);
|
||||
if (!is_null($budget)) {
|
||||
if (null !== $budget) {
|
||||
return $budget;
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($budgetName) > 0) {
|
||||
if (\strlen($budgetName) > 0) {
|
||||
$budget = $this->findByName($budgetName);
|
||||
if (!is_null($budget)) {
|
||||
if (null !== $budget) {
|
||||
return $budget;
|
||||
}
|
||||
}
|
||||
@@ -97,4 +97,4 @@ class BudgetFactory
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* CategoryFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
@@ -44,16 +44,18 @@ class CategoryFactory
|
||||
*/
|
||||
public function findByName(string $name): ?Category
|
||||
{
|
||||
$result = null;
|
||||
/** @var Collection $collection */
|
||||
$collection = $this->user->categories()->get();
|
||||
/** @var Category $category */
|
||||
foreach ($collection as $category) {
|
||||
if ($category->name === $name) {
|
||||
return $category;
|
||||
$result = $category;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,26 +66,26 @@ class CategoryFactory
|
||||
*/
|
||||
public function findOrCreate(?int $categoryId, ?string $categoryName): ?Category
|
||||
{
|
||||
$categoryId = intval($categoryId);
|
||||
$categoryName = strval($categoryName);
|
||||
$categoryId = (int)$categoryId;
|
||||
$categoryName = (string)$categoryName;
|
||||
|
||||
Log::debug(sprintf('Going to find category with ID %d and name "%s"', $categoryId, $categoryName));
|
||||
|
||||
if (strlen($categoryName) === 0 && $categoryId === 0) {
|
||||
if (\strlen($categoryName) === 0 && $categoryId === 0) {
|
||||
return null;
|
||||
}
|
||||
// first by ID:
|
||||
if ($categoryId > 0) {
|
||||
/** @var Category $category */
|
||||
$category = $this->user->categories()->find($categoryId);
|
||||
if (!is_null($category)) {
|
||||
if (null !== $category) {
|
||||
return $category;
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($categoryName) > 0) {
|
||||
if (\strlen($categoryName) > 0) {
|
||||
$category = $this->findByName($categoryName);
|
||||
if (!is_null($category)) {
|
||||
if (null !== $category) {
|
||||
return $category;
|
||||
}
|
||||
|
||||
@@ -106,4 +108,4 @@ class CategoryFactory
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* PiggyBankEventFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
@@ -46,7 +46,7 @@ class PiggyBankEventFactory
|
||||
public function create(TransactionJournal $journal, ?PiggyBank $piggyBank): ?PiggyBankEvent
|
||||
{
|
||||
Log::debug(sprintf('Now in PiggyBankEventCreate for a %s', $journal->transactionType->type));
|
||||
if (is_null($piggyBank)) {
|
||||
if (null === $piggyBank) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ class PiggyBankEventFactory
|
||||
$piggyRepos->setUser($journal->user);
|
||||
|
||||
// repetition exists?
|
||||
$repetition = $piggyRepos->getRepetition($piggyBank, $journal->date);
|
||||
if (null === $repetition->id) {
|
||||
$repetition = $piggyRepos->getRepetition($piggyBank);
|
||||
if (null === $repetition) {
|
||||
Log::error(sprintf('No piggy bank repetition on %s!', $journal->date->format('Y-m-d')));
|
||||
|
||||
return null;
|
||||
@@ -85,4 +85,4 @@ class PiggyBankEventFactory
|
||||
|
||||
return $event;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* PiggyBankFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
@@ -43,25 +43,25 @@ class PiggyBankFactory
|
||||
*/
|
||||
public function find(?int $piggyBankId, ?string $piggyBankName): ?PiggyBank
|
||||
{
|
||||
$piggyBankId = intval($piggyBankId);
|
||||
$piggyBankName = strval($piggyBankName);
|
||||
if (strlen($piggyBankName) === 0 && $piggyBankId === 0) {
|
||||
$piggyBankId = (int)$piggyBankId;
|
||||
$piggyBankName = (string)$piggyBankName;
|
||||
if (\strlen($piggyBankName) === 0 && $piggyBankId === 0) {
|
||||
return null;
|
||||
}
|
||||
// first find by ID:
|
||||
if ($piggyBankId > 0) {
|
||||
/** @var PiggyBank $piggyBank */
|
||||
$piggyBank = $this->user->piggyBanks()->find($piggyBankId);
|
||||
if (!is_null($piggyBank)) {
|
||||
if (null !== $piggyBank) {
|
||||
return $piggyBank;
|
||||
}
|
||||
}
|
||||
|
||||
// then find by name:
|
||||
if (strlen($piggyBankName) > 0) {
|
||||
if (\strlen($piggyBankName) > 0) {
|
||||
/** @var PiggyBank $piggyBank */
|
||||
$piggyBank = $this->findByName($piggyBankName);
|
||||
if (!is_null($piggyBank)) {
|
||||
if (null !== $piggyBank) {
|
||||
return $piggyBank;
|
||||
}
|
||||
}
|
||||
@@ -97,4 +97,4 @@ class PiggyBankFactory
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* TagFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
@@ -65,13 +65,13 @@ class TagFactory
|
||||
*/
|
||||
public function findOrCreate(string $tag): ?Tag
|
||||
{
|
||||
if (is_null($this->tags)) {
|
||||
if (null === $this->tags) {
|
||||
$this->tags = $this->user->tags()->get();
|
||||
}
|
||||
|
||||
/** @var Tag $object */
|
||||
foreach ($this->tags as $object) {
|
||||
if ($object->tag === $tag) {
|
||||
if (strtolower($object->tag) === strtolower($tag)) {
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
@@ -99,4 +99,4 @@ class TagFactory
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* TransactionCurrencyFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,17 +20,43 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class TransactionCurrencyFactory
|
||||
*/
|
||||
class TransactionCurrencyFactory
|
||||
{
|
||||
/**
|
||||
* @param array $data
|
||||
*
|
||||
* @return TransactionCurrency|null
|
||||
*/
|
||||
public function create(array $data): ?TransactionCurrency
|
||||
{
|
||||
$result = null;
|
||||
try {
|
||||
/** @var TransactionCurrency $currency */
|
||||
$result = TransactionCurrency::create(
|
||||
[
|
||||
'name' => $data['name'],
|
||||
'code' => $data['code'],
|
||||
'symbol' => $data['symbol'],
|
||||
'decimal_places' => $data['decimal_places'],
|
||||
]
|
||||
);
|
||||
} catch (QueryException $e) {
|
||||
Log::error(sprintf('Could not create new currency: %s', $e->getMessage()));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null $currencyId
|
||||
* @param null|string $currencyCode
|
||||
@@ -38,24 +65,24 @@ class TransactionCurrencyFactory
|
||||
*/
|
||||
public function find(?int $currencyId, ?string $currencyCode): ?TransactionCurrency
|
||||
{
|
||||
$currencyCode = strval($currencyCode);
|
||||
$currencyId = intval($currencyId);
|
||||
$currencyCode = (string)$currencyCode;
|
||||
$currencyId = (int)$currencyId;
|
||||
|
||||
if (strlen($currencyCode) === 0 && intval($currencyId) === 0) {
|
||||
if (\strlen($currencyCode) === 0 && (int)$currencyId === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// first by ID:
|
||||
if ($currencyId > 0) {
|
||||
$currency = TransactionCurrency::find($currencyId);
|
||||
if (!is_null($currency)) {
|
||||
if (null !== $currency) {
|
||||
return $currency;
|
||||
}
|
||||
}
|
||||
// then by code:
|
||||
if (strlen($currencyCode) > 0) {
|
||||
if (\strlen($currencyCode) > 0) {
|
||||
$currency = TransactionCurrency::whereCode($currencyCode)->first();
|
||||
if (!is_null($currency)) {
|
||||
if (null !== $currency) {
|
||||
return $currency;
|
||||
}
|
||||
}
|
||||
@@ -64,4 +91,4 @@ class TransactionCurrencyFactory
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* TransactionFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,13 +20,13 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Services\Internal\Support\TransactionServiceTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -89,7 +90,7 @@ class TransactionFactory
|
||||
$source = $this->create(
|
||||
[
|
||||
'description' => $description,
|
||||
'amount' => app('steam')->negative(strval($data['amount'])),
|
||||
'amount' => app('steam')->negative((string)$data['amount']),
|
||||
'foreign_amount' => null,
|
||||
'currency' => $currency,
|
||||
'account' => $sourceAccount,
|
||||
@@ -102,7 +103,7 @@ class TransactionFactory
|
||||
$dest = $this->create(
|
||||
[
|
||||
'description' => $description,
|
||||
'amount' => app('steam')->positive(strval($data['amount'])),
|
||||
'amount' => app('steam')->positive((string)$data['amount']),
|
||||
'foreign_amount' => null,
|
||||
'currency' => $currency,
|
||||
'account' => $destinationAccount,
|
||||
@@ -118,12 +119,17 @@ class TransactionFactory
|
||||
$this->setForeignCurrency($dest, $foreign);
|
||||
|
||||
// set foreign amount:
|
||||
if (!is_null($data['foreign_amount'])) {
|
||||
$this->setForeignAmount($source, app('steam')->negative(strval($data['foreign_amount'])));
|
||||
$this->setForeignAmount($dest, app('steam')->positive(strval($data['foreign_amount'])));
|
||||
if (null !== $data['foreign_amount']) {
|
||||
$this->setForeignAmount($source, app('steam')->negative((string)$data['foreign_amount']));
|
||||
$this->setForeignAmount($dest, app('steam')->positive((string)$data['foreign_amount']));
|
||||
}
|
||||
|
||||
// set budget:
|
||||
if ($journal->transactionType->type === TransactionType::TRANSFER) {
|
||||
$data['budget_id'] = null;
|
||||
$data['budget_name'] = null;
|
||||
}
|
||||
|
||||
$budget = $this->findBudget($data['budget_id'], $data['budget_name']);
|
||||
$this->setBudget($source, $budget);
|
||||
$this->setBudget($dest, $budget);
|
||||
@@ -145,4 +151,4 @@ class TransactionFactory
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* TransactionJournalFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
@@ -40,8 +40,6 @@ class TransactionJournalFactory
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* Create a new transaction journal and associated transactions.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return TransactionJournal
|
||||
@@ -68,6 +66,7 @@ class TransactionJournalFactory
|
||||
);
|
||||
|
||||
// store basic transactions:
|
||||
/** @var TransactionFactory $factory */
|
||||
$factory = app(TransactionFactory::class);
|
||||
$factory->setUser($this->user);
|
||||
|
||||
@@ -88,16 +87,15 @@ class TransactionJournalFactory
|
||||
$this->connectTags($journal, $data);
|
||||
|
||||
// store note:
|
||||
$this->storeNote($journal, strval($data['notes']));
|
||||
$this->storeNote($journal, (string)$data['notes']);
|
||||
|
||||
// store date meta fields (if present):
|
||||
$this->storeMeta($journal, $data, 'interest_date');
|
||||
$this->storeMeta($journal, $data, 'book_date');
|
||||
$this->storeMeta($journal, $data, 'process_date');
|
||||
$this->storeMeta($journal, $data, 'due_date');
|
||||
$this->storeMeta($journal, $data, 'payment_date');
|
||||
$this->storeMeta($journal, $data, 'invoice_date');
|
||||
$this->storeMeta($journal, $data, 'internal_reference');
|
||||
$fields = ['sepa-cc', 'sepa-ct-op', 'sepa-ct-id', 'sepa-db', 'sepa-country', 'sepa-ep', 'sepa-ci', 'interest_date', 'book_date', 'process_date',
|
||||
'due_date', 'payment_date', 'invoice_date', 'internal_reference', 'bunq_payment_id','importHash'];
|
||||
|
||||
foreach ($fields as $field) {
|
||||
$this->storeMeta($journal, $data, $field);
|
||||
}
|
||||
Log::debug('End of TransactionJournalFactory::create()');
|
||||
|
||||
return $journal;
|
||||
@@ -124,7 +122,7 @@ class TransactionJournalFactory
|
||||
$factory->setUser($this->user);
|
||||
|
||||
$piggyBank = $factory->find($data['piggy_bank_id'], $data['piggy_bank_name']);
|
||||
if (!is_null($piggyBank)) {
|
||||
if (null !== $piggyBank) {
|
||||
/** @var PiggyBankEventFactory $factory */
|
||||
$factory = app(PiggyBankEventFactory::class);
|
||||
$factory->create($journal, $piggyBank);
|
||||
@@ -144,11 +142,12 @@ class TransactionJournalFactory
|
||||
{
|
||||
$factory = app(TransactionTypeFactory::class);
|
||||
$transactionType = $factory->find($type);
|
||||
if (is_null($transactionType)) {
|
||||
if (null === $transactionType) {
|
||||
Log::error(sprintf('Could not find transaction type for "%s"', $type)); // @codeCoverageIgnore
|
||||
throw new FireflyException(sprintf('Could not find transaction type for "%s"', $type)); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
return $transactionType;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* TransactionJournalMetaFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
@@ -43,7 +43,7 @@ class TransactionJournalMetaFactory
|
||||
$value = $data['data'];
|
||||
/** @var TransactionJournalMeta $entry */
|
||||
$entry = $data['journal']->transactionJournalMeta()->where('name', $data['name'])->first();
|
||||
if (is_null($value) && !is_null($entry)) {
|
||||
if (null === $value && null !== $entry) {
|
||||
try {
|
||||
$entry->delete();
|
||||
} catch (Exception $e) { // @codeCoverageIgnore
|
||||
@@ -56,7 +56,18 @@ class TransactionJournalMetaFactory
|
||||
if ($data['data'] instanceof Carbon) {
|
||||
$value = $data['data']->toW3cString();
|
||||
}
|
||||
if ((string)$value === '') {
|
||||
// don't store blank strings.
|
||||
if (null !== $entry) {
|
||||
try {
|
||||
$entry->delete();
|
||||
} catch (Exception $e) { // @codeCoverageIgnore
|
||||
Log::error(sprintf('Could not delete transaction journal meta: %s', $e->getMessage())); // @codeCoverageIgnore
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (null === $entry) {
|
||||
$entry = new TransactionJournalMeta();
|
||||
@@ -69,4 +80,4 @@ class TransactionJournalMetaFactory
|
||||
return $entry;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* TransactionTypeFactory.php
|
||||
* Copyright (c) 2018 thegrumpydictator@gmail.com
|
||||
@@ -19,7 +20,6 @@
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Factory;
|
||||
|
||||
@@ -41,4 +41,4 @@ class TransactionTypeFactory
|
||||
return TransactionType::whereType(ucfirst($type))->first();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -66,10 +66,10 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
{
|
||||
reset($data);
|
||||
$first = current($data);
|
||||
$labels = is_array($first['entries']) ? array_keys($first['entries']) : [];
|
||||
$labels = \is_array($first['entries']) ? array_keys($first['entries']) : [];
|
||||
|
||||
$chartData = [
|
||||
'count' => count($data),
|
||||
'count' => \count($data),
|
||||
'labels' => $labels, // take ALL labels from the first set.
|
||||
'datasets' => [],
|
||||
];
|
||||
@@ -119,7 +119,7 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
// different sort when values are positive and when they're negative.
|
||||
asort($data);
|
||||
$next = next($data);
|
||||
if (!is_bool($next) && 1 === bccomp($next, '0')) {
|
||||
if (!\is_bool($next) && 1 === bccomp($next, '0')) {
|
||||
// next is positive, sort other way around.
|
||||
arsort($data);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
$index = 0;
|
||||
foreach ($data as $key => $value) {
|
||||
// make larger than 0
|
||||
$chartData['datasets'][0]['data'][] = floatval(Steam::positive($value));
|
||||
$chartData['datasets'][0]['data'][] = (float)Steam::positive($value);
|
||||
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
|
||||
$chartData['labels'][] = $key;
|
||||
++$index;
|
||||
|
@@ -42,13 +42,11 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
|
||||
$expenseIds = join(',', $this->expense->pluck('id')->toArray());
|
||||
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
|
||||
$expenseIds = implode(',', $this->expense->pluck('id')->toArray());
|
||||
$reportType = 'account';
|
||||
$preferredPeriod = $this->preferredPeriod();
|
||||
|
||||
|
@@ -60,7 +60,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
|
||||
$defaultShow = ['icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'to'];
|
||||
$reportType = 'audit';
|
||||
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
|
||||
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
|
||||
$hideable = ['buttons', 'icon', 'description', 'balance_before', 'amount', 'balance_after', 'date',
|
||||
'interest_date', 'book_date', 'process_date',
|
||||
// three new optional fields.
|
||||
@@ -172,7 +172,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
$journals = $journals->reverse();
|
||||
$dayBeforeBalance = Steam::balance($account, $date);
|
||||
$startBalance = $dayBeforeBalance;
|
||||
$currency = $currencyRepos->find(intval($account->getMeta('currency_id')));
|
||||
$currency = $currencyRepos->find((int)$account->getMeta('currency_id'));
|
||||
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($journals as $transaction) {
|
||||
@@ -192,9 +192,9 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
$return = [
|
||||
'journals' => $journals->reverse(),
|
||||
'exists' => $journals->count() > 0,
|
||||
'end' => $this->end->formatLocalized(strval(trans('config.month_and_day'))),
|
||||
'end' => $this->end->formatLocalized((string)trans('config.month_and_day')),
|
||||
'endBalance' => Steam::balance($account, $this->end),
|
||||
'dayBefore' => $date->formatLocalized(strval(trans('config.month_and_day'))),
|
||||
'dayBefore' => $date->formatLocalized((string)trans('config.month_and_day')),
|
||||
'dayBeforeBalance' => $dayBeforeBalance,
|
||||
];
|
||||
|
||||
|
@@ -66,8 +66,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
|
||||
$budgetIds = join(',', $this->budgets->pluck('id')->toArray());
|
||||
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
|
||||
$budgetIds = implode(',', $this->budgets->pluck('id')->toArray());
|
||||
$expenses = $this->getExpenses();
|
||||
$accountSummary = $this->summarizeByAccount($expenses);
|
||||
$budgetSummary = $this->summarizeByBudget($expenses);
|
||||
@@ -199,8 +199,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
$jrnlBudId = intval($transaction->transaction_journal_budget_id);
|
||||
$transBudId = intval($transaction->transaction_budget_id);
|
||||
$jrnlBudId = (int)$transaction->transaction_journal_budget_id;
|
||||
$transBudId = (int)$transaction->transaction_budget_id;
|
||||
$budgetId = max($jrnlBudId, $transBudId);
|
||||
$result[$budgetId] = $result[$budgetId] ?? '0';
|
||||
$result[$budgetId] = bcadd($transaction->transaction_amount, $result[$budgetId]);
|
||||
|
@@ -67,8 +67,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
|
||||
$categoryIds = join(',', $this->categories->pluck('id')->toArray());
|
||||
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
|
||||
$categoryIds = implode(',', $this->categories->pluck('id')->toArray());
|
||||
$reportType = 'category';
|
||||
$expenses = $this->getExpenses();
|
||||
$income = $this->getIncome();
|
||||
@@ -239,8 +239,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
$result = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
$jrnlCatId = intval($transaction->transaction_journal_category_id);
|
||||
$transCatId = intval($transaction->transaction_category_id);
|
||||
$jrnlCatId = (int)$transaction->transaction_journal_category_id;
|
||||
$transCatId = (int)$transaction->transaction_category_id;
|
||||
$categoryId = max($jrnlCatId, $transCatId);
|
||||
$result[$categoryId] = $result[$categoryId] ?? '0';
|
||||
$result[$categoryId] = bcadd($transaction->transaction_amount, $result[$categoryId]);
|
||||
|
@@ -41,15 +41,13 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
/** @var ReportHelperInterface $helper */
|
||||
$helper = app(ReportHelperInterface::class);
|
||||
$bills = $helper->getBillReport($this->start, $this->end, $this->accounts);
|
||||
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
|
||||
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
|
||||
$reportType = 'default';
|
||||
|
||||
// continue!
|
||||
|
@@ -40,13 +40,11 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
// and some id's, joined:
|
||||
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
|
||||
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
|
||||
$reportType = 'default';
|
||||
|
||||
// continue!
|
||||
|
@@ -40,13 +40,11 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
// and some id's, joined:
|
||||
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
|
||||
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
|
||||
$reportType = 'default';
|
||||
|
||||
// continue!
|
||||
|
@@ -35,9 +35,7 @@ class Support
|
||||
*/
|
||||
public function getTopExpenses(): Collection
|
||||
{
|
||||
$transactions = $this->getExpenses()->sortBy('transaction_amount');
|
||||
|
||||
return $transactions;
|
||||
return $this->getExpenses()->sortBy('transaction_amount');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -45,9 +43,7 @@ class Support
|
||||
*/
|
||||
public function getTopIncome(): Collection
|
||||
{
|
||||
$transactions = $this->getIncome()->sortByDesc('transaction_amount');
|
||||
|
||||
return $transactions;
|
||||
return $this->getIncome()->sortByDesc('transaction_amount');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,13 +74,13 @@ class Support
|
||||
}
|
||||
++$result[$opposingId]['count'];
|
||||
$result[$opposingId]['sum'] = bcadd($result[$opposingId]['sum'], $transaction->transaction_amount);
|
||||
$result[$opposingId]['average'] = bcdiv($result[$opposingId]['sum'], strval($result[$opposingId]['count']));
|
||||
$result[$opposingId]['average'] = bcdiv($result[$opposingId]['sum'], (string)$result[$opposingId]['count']);
|
||||
}
|
||||
|
||||
// sort result by average:
|
||||
$average = [];
|
||||
foreach ($result as $key => $row) {
|
||||
$average[$key] = floatval($row['average']);
|
||||
$average[$key] = (float)$row['average'];
|
||||
}
|
||||
|
||||
array_multisort($average, $sortFlag, $result);
|
||||
@@ -146,15 +142,12 @@ class Support
|
||||
*/
|
||||
protected function summarizeByAccount(Collection $collection): array
|
||||
{
|
||||
$result = [
|
||||
'sum' => '0',
|
||||
];
|
||||
$result = [];
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($collection as $transaction) {
|
||||
$accountId = $transaction->account_id;
|
||||
$result[$accountId] = $result[$accountId] ?? '0';
|
||||
$result[$accountId] = bcadd($transaction->transaction_amount, $result[$accountId]);
|
||||
$result['sum'] = bcadd($result['sum'], $transaction->transaction_amount);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
@@ -65,12 +65,11 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
|
||||
$tagTags = join(',', $this->tags->pluck('tag')->toArray());
|
||||
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
|
||||
$tagTags = implode(',', $this->tags->pluck('tag')->toArray());
|
||||
$reportType = 'tag';
|
||||
$expenses = $this->getExpenses();
|
||||
$income = $this->getIncome();
|
||||
|
@@ -22,12 +22,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Handlers\Events;
|
||||
|
||||
use Exception;
|
||||
use FireflyIII\Events\AdminRequestedTestMessage;
|
||||
use FireflyIII\Mail\AdminTestMail;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use Log;
|
||||
use Mail;
|
||||
use Session;
|
||||
use Swift_TransportException;
|
||||
|
||||
/**
|
||||
* Class AdminEventHandler.
|
||||
@@ -43,6 +44,15 @@ class AdminEventHandler
|
||||
*/
|
||||
public function sendTestMessage(AdminRequestedTestMessage $event): bool
|
||||
{
|
||||
/** @var UserRepositoryInterface $repository */
|
||||
$repository = app(UserRepositoryInterface::class);
|
||||
|
||||
// is user even admin?
|
||||
if (!$repository->hasRole($event->user, 'owner')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
$email = $event->user->email;
|
||||
$ipAddress = $event->ipAddress;
|
||||
|
||||
@@ -51,7 +61,7 @@ class AdminEventHandler
|
||||
Log::debug('Trying to send message...');
|
||||
Mail::to($email)->send(new AdminTestMail($email, $ipAddress));
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (Swift_TransportException $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::debug('Send message failed! :(');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
|
@@ -28,9 +28,7 @@ use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface as JRI;
|
||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface as PRI;
|
||||
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface as RGRI;
|
||||
use FireflyIII\Support\Events\BillScanner;
|
||||
use FireflyIII\TransactionRules\Processor;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
@@ -67,6 +65,7 @@ class StoredJournalEventHandler
|
||||
* @param StoredTransactionJournal $storedJournalEvent
|
||||
*
|
||||
* @return bool
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function processRules(StoredTransactionJournal $storedJournalEvent): bool
|
||||
{
|
||||
@@ -91,18 +90,4 @@ class StoredJournalEventHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method calls a special bill scanner that will check if the stored journal is part of a bill.
|
||||
*
|
||||
* @param StoredTransactionJournal $storedJournalEvent
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function scanBills(StoredTransactionJournal $storedJournalEvent): bool
|
||||
{
|
||||
$journal = $storedJournalEvent->journal;
|
||||
BillScanner::scan($journal);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -26,7 +26,6 @@ use FireflyIII\Events\UpdatedTransactionJournal;
|
||||
use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
|
||||
use FireflyIII\Support\Events\BillScanner;
|
||||
use FireflyIII\TransactionRules\Processor;
|
||||
|
||||
/**
|
||||
@@ -51,11 +50,11 @@ class UpdatedJournalEventHandler
|
||||
|
||||
/**
|
||||
* This method will check all the rules when a journal is updated.
|
||||
* TODO move to factory.
|
||||
*
|
||||
* @param UpdatedTransactionJournal $updatedJournalEvent
|
||||
*
|
||||
* @return bool
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public function processRules(UpdatedTransactionJournal $updatedJournalEvent): bool
|
||||
{
|
||||
@@ -80,19 +79,4 @@ class UpdatedJournalEventHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method calls a special bill scanner that will check if the updated journal is part of a bill.
|
||||
* TODO move to factory.
|
||||
*
|
||||
* @param UpdatedTransactionJournal $updatedJournalEvent
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function scanBills(UpdatedTransactionJournal $updatedJournalEvent): bool
|
||||
{
|
||||
$journal = $updatedJournalEvent->journal;
|
||||
BillScanner::scan($journal);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Handlers\Events;
|
||||
|
||||
use Exception;
|
||||
use FireflyIII\Events\RegisteredUser;
|
||||
use FireflyIII\Events\RequestedNewPassword;
|
||||
use FireflyIII\Events\UserChangedEmail;
|
||||
@@ -36,7 +37,6 @@ use Illuminate\Auth\Events\Login;
|
||||
use Log;
|
||||
use Mail;
|
||||
use Preferences;
|
||||
use Swift_TransportException;
|
||||
|
||||
/**
|
||||
* Class UserEventHandler.
|
||||
@@ -95,7 +95,7 @@ class UserEventHandler
|
||||
}
|
||||
// user is the only user but does not have role "owner".
|
||||
$role = $repository->getRole('owner');
|
||||
if (is_null($role)) {
|
||||
if (null === $role) {
|
||||
// create role, does not exist. Very strange situation so let's raise a big fuss about it.
|
||||
$role = $repository->createRole('owner', 'Site Owner', 'User runs this instance of FF3');
|
||||
Log::error('Could not find role "owner". This is weird.');
|
||||
@@ -124,7 +124,7 @@ class UserEventHandler
|
||||
try {
|
||||
Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $uri, $ipAddress));
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (Swift_TransportException $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ class UserEventHandler
|
||||
try {
|
||||
Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $uri, $ipAddress));
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (Swift_TransportException $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ class UserEventHandler
|
||||
try {
|
||||
Mail::to($email)->send(new RequestedNewPasswordMail($url, $ipAddress));
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (Swift_TransportException $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ class UserEventHandler
|
||||
try {
|
||||
Mail::to($email)->send(new RegisteredUserMail($uri, $ipAddress));
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (Swift_TransportException $e) {
|
||||
} catch (Exception $e) {
|
||||
Log::error($e->getMessage());
|
||||
}
|
||||
|
||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Handlers\Events;
|
||||
use FireflyConfig;
|
||||
use FireflyIII\Events\RequestedVersionCheckStatus;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\Services\Github\Object\Release;
|
||||
use FireflyIII\Services\Github\Request\UpdateRequest;
|
||||
use FireflyIII\User;
|
||||
@@ -43,22 +44,26 @@ class VersionCheckEventHandler
|
||||
public function checkForUpdates(RequestedVersionCheckStatus $event)
|
||||
{
|
||||
// in Sandstorm, cannot check for updates:
|
||||
$sandstorm = 1 === intval(getenv('SANDSTORM'));
|
||||
$sandstorm = 1 === (int)getenv('SANDSTORM');
|
||||
if ($sandstorm === true) {
|
||||
return;
|
||||
return; // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
/** @var UserRepositoryInterface $repository */
|
||||
$repository = app(UserRepositoryInterface::class);
|
||||
|
||||
/** @var User $user */
|
||||
$user = $event->user;
|
||||
if (!$user->hasRole('owner')) {
|
||||
if (!$repository->hasRole($user, 'owner')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$permission = FireflyConfig::get('permission_update_check', -1);
|
||||
$lastCheckTime = FireflyConfig::get('last_update_check', time());
|
||||
$now = time();
|
||||
if ($now - $lastCheckTime->data < 604800) {
|
||||
$diff = $now - $lastCheckTime->data;
|
||||
Log::debug(sprintf('Difference is %d seconds.', $diff));
|
||||
if ($diff < 604800) {
|
||||
Log::debug(sprintf('Checked for updates less than a week ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data)));
|
||||
|
||||
return;
|
||||
@@ -70,7 +75,7 @@ class VersionCheckEventHandler
|
||||
// have actual permission?
|
||||
if ($permission->data === -1) {
|
||||
// never asked before.
|
||||
session()->flash('info', strval(trans('firefly.check_for_updates_permission', ['link' => route('admin.update-check')])));
|
||||
session()->flash('info', (string)trans('firefly.check_for_updates_permission', ['link' => route('admin.update-check')]));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -79,7 +84,7 @@ class VersionCheckEventHandler
|
||||
/** @var UpdateRequest $request */
|
||||
$request = app(UpdateRequest::class);
|
||||
$check = -2;
|
||||
$first = new Release(['id' => '0', 'title' => '0', 'updated' => '2017-01-01', 'content' => '']);
|
||||
$first = new Release(['id' => '0', 'title' => '0.2', 'updated' => '2017-01-01', 'content' => '']);
|
||||
try {
|
||||
$request->call();
|
||||
$releases = $request->getReleases();
|
||||
@@ -87,30 +92,31 @@ class VersionCheckEventHandler
|
||||
/** @var Release $first */
|
||||
$first = reset($releases);
|
||||
$check = version_compare($current, $first->getTitle());
|
||||
Log::debug(sprintf('Comparing %s with %s, result is %s', $current, $first->getTitle(), $check));
|
||||
FireflyConfig::set('last_update_check', time());
|
||||
} catch (FireflyException $e) {
|
||||
Log::error(sprintf('Could not check for updates: %s', $e->getMessage()));
|
||||
}
|
||||
$string = 'no result: ' . $check;
|
||||
if ($check === -2) {
|
||||
$string = strval(trans('firefly.update_check_error'));
|
||||
$string = (string)trans('firefly.update_check_error');
|
||||
}
|
||||
if ($check === -1) {
|
||||
// there is a new FF version!
|
||||
$monthAndDayFormat = (string)trans('config.month_and_day');
|
||||
$string = strval(
|
||||
trans(
|
||||
'firefly.update_new_version_alert',
|
||||
['your_version' => $current, 'new_version' => $first->getTitle(), 'date' => $first->getUpdated()->formatLocalized($monthAndDayFormat)]
|
||||
)
|
||||
$string = (string)trans(
|
||||
'firefly.update_new_version_alert',
|
||||
[
|
||||
'your_version' => $current,
|
||||
'new_version' => $first->getTitle(),
|
||||
'date' => $first->getUpdated()->formatLocalized($monthAndDayFormat),
|
||||
]
|
||||
);
|
||||
}
|
||||
if ($check !== 0) {
|
||||
// flash info
|
||||
session()->flash('info', $string);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->maxUploadSize = intval(config('firefly.maxUploadSize'));
|
||||
$this->maxUploadSize = (int)config('firefly.maxUploadSize');
|
||||
$this->allowedMimes = (array)config('firefly.allowedMimes');
|
||||
$this->errors = new MessageBag;
|
||||
$this->messages = new MessageBag;
|
||||
@@ -71,7 +71,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
*/
|
||||
public function getAttachmentLocation(Attachment $attachment): string
|
||||
{
|
||||
$path = sprintf('%s%sat-%d.data', storage_path('upload'), DIRECTORY_SEPARATOR, intval($attachment->id));
|
||||
$path = sprintf('%s%sat-%d.data', storage_path('upload'), DIRECTORY_SEPARATOR, (int)$attachment->id);
|
||||
|
||||
return $path;
|
||||
}
|
||||
@@ -108,8 +108,8 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
*/
|
||||
public function saveAttachmentsForModel(Model $model, ?array $files): bool
|
||||
{
|
||||
Log::debug(sprintf('Now in saveAttachmentsForModel for model %s', get_class($model)));
|
||||
if (is_array($files)) {
|
||||
Log::debug(sprintf('Now in saveAttachmentsForModel for model %s', \get_class($model)));
|
||||
if (\is_array($files)) {
|
||||
Log::debug('$files is an array.');
|
||||
/** @var UploadedFile $entry */
|
||||
foreach ($files as $entry) {
|
||||
@@ -136,7 +136,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
{
|
||||
$md5 = md5_file($file->getRealPath());
|
||||
$name = $file->getClientOriginalName();
|
||||
$class = get_class($model);
|
||||
$class = \get_class($model);
|
||||
$count = $model->user->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count();
|
||||
|
||||
if ($count > 0) {
|
||||
@@ -155,6 +155,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
* @param Model $model
|
||||
*
|
||||
* @return Attachment
|
||||
* @throws \Illuminate\Contracts\Encryption\EncryptException
|
||||
*/
|
||||
protected function processFile(UploadedFile $file, Model $model): Attachment
|
||||
{
|
||||
@@ -179,8 +180,8 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
$fileObject->rewind();
|
||||
$content = $fileObject->fread($file->getSize());
|
||||
$encrypted = Crypt::encrypt($content);
|
||||
Log::debug(sprintf('Full file length is %d and upload size is %d.', strlen($content), $file->getSize()));
|
||||
Log::debug(sprintf('Encrypted content is %d', strlen($encrypted)));
|
||||
Log::debug(sprintf('Full file length is %d and upload size is %d.', \strlen($content), $file->getSize()));
|
||||
Log::debug(sprintf('Encrypted content is %d', \strlen($encrypted)));
|
||||
|
||||
// store it:
|
||||
$this->uploadDisk->put($attachment->fileName(), $encrypted);
|
||||
@@ -206,10 +207,10 @@ class AttachmentHelper implements AttachmentHelperInterface
|
||||
Log::debug('Now in validMime()');
|
||||
$mime = e($file->getMimeType());
|
||||
$name = e($file->getClientOriginalName());
|
||||
Log::debug(sprintf('Name is %, and mime is %s', $name, $mime));
|
||||
Log::debug(sprintf('Name is %s, and mime is %s', $name, $mime));
|
||||
Log::debug('Valid mimes are', $this->allowedMimes);
|
||||
|
||||
if (!in_array($mime, $this->allowedMimes)) {
|
||||
if (!\in_array($mime, $this->allowedMimes)) {
|
||||
$msg = (string)trans('validation.file_invalid_mime', ['name' => $name, 'mime' => $mime]);
|
||||
$this->errors->add('attachments', $msg);
|
||||
Log::error($msg);
|
||||
|
@@ -103,7 +103,7 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
$transactions = $this->getTransactions($direction);
|
||||
$grouped = $this->groupByFields($transactions, $this->grouping[$group]);
|
||||
$chartData = $this->organizeByType($group, $grouped);
|
||||
$key = strval(trans('firefly.everything_else'));
|
||||
$key = (string)trans('firefly.everything_else');
|
||||
|
||||
// also collect all other transactions
|
||||
if ($this->collectOtherObjects && 'expense' === $direction) {
|
||||
@@ -113,7 +113,7 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::WITHDRAWAL]);
|
||||
|
||||
$journals = $collector->getJournals();
|
||||
$sum = strval($journals->sum('transaction_amount'));
|
||||
$sum = (string)$journals->sum('transaction_amount');
|
||||
$sum = bcmul($sum, '-1');
|
||||
$sum = bcsub($sum, $this->total);
|
||||
$chartData[$key] = $sum;
|
||||
@@ -125,7 +125,7 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
$collector->setUser($this->user);
|
||||
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::DEPOSIT]);
|
||||
$journals = $collector->getJournals();
|
||||
$sum = strval($journals->sum('transaction_amount'));
|
||||
$sum = (string)$journals->sum('transaction_amount');
|
||||
$sum = bcsub($sum, $this->total);
|
||||
$chartData[$key] = $sum;
|
||||
}
|
||||
@@ -282,6 +282,7 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
$collector->withCategoryInformation();
|
||||
$collector->withBudgetInformation();
|
||||
}
|
||||
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return $collector->getJournals();
|
||||
@@ -297,7 +298,7 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
*/
|
||||
protected function groupByFields(Collection $set, array $fields): array
|
||||
{
|
||||
if (0 === count($fields) && $this->tags->count() > 0) {
|
||||
if (0 === \count($fields) && $this->tags->count() > 0) {
|
||||
// do a special group on tags:
|
||||
return $this->groupByTag($set); // @codeCoverageIgnore
|
||||
}
|
||||
@@ -307,7 +308,7 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
foreach ($set as $transaction) {
|
||||
$values = [];
|
||||
foreach ($fields as $field) {
|
||||
$values[] = intval($transaction->$field);
|
||||
$values[] = (int)$transaction->$field;
|
||||
}
|
||||
$value = max($values);
|
||||
$grouped[$value] = $grouped[$value] ?? '0';
|
||||
@@ -331,7 +332,7 @@ class MetaPieChart implements MetaPieChartInterface
|
||||
$repository->setUser($this->user);
|
||||
foreach ($array as $objectId => $amount) {
|
||||
if (!isset($names[$objectId])) {
|
||||
$object = $repository->find(intval($objectId));
|
||||
$object = $repository->find((int)$objectId);
|
||||
$names[$objectId] = $object->name ?? $object->tag;
|
||||
}
|
||||
$amount = Steam::positive($amount);
|
||||
|
@@ -35,15 +35,15 @@ class BalanceLine
|
||||
/**
|
||||
*
|
||||
*/
|
||||
const ROLE_DEFAULTROLE = 1;
|
||||
public const ROLE_DEFAULTROLE = 1;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
const ROLE_TAGROLE = 2;
|
||||
public const ROLE_TAGROLE = 2;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
const ROLE_DIFFROLE = 3;
|
||||
public const ROLE_DIFFROLE = 3;
|
||||
|
||||
/** @var Collection */
|
||||
protected $balanceEntries;
|
||||
@@ -162,13 +162,13 @@ class BalanceLine
|
||||
return $this->getBudget()->name;
|
||||
}
|
||||
if (self::ROLE_DEFAULTROLE === $this->getRole()) {
|
||||
return strval(trans('firefly.no_budget'));
|
||||
return (string)trans('firefly.no_budget');
|
||||
}
|
||||
if (self::ROLE_TAGROLE === $this->getRole()) {
|
||||
return strval(trans('firefly.coveredWithTags'));
|
||||
return (string)trans('firefly.coveredWithTags');
|
||||
}
|
||||
if (self::ROLE_DIFFROLE === $this->getRole()) {
|
||||
return strval(trans('firefly.leftUnbalanced'));
|
||||
return (string)trans('firefly.leftUnbalanced');
|
||||
}
|
||||
|
||||
return '';
|
||||
|
@@ -101,7 +101,7 @@ class Bill
|
||||
{
|
||||
$set = $this->bills->sortBy(
|
||||
function (BillLine $bill) {
|
||||
$active = 0 === intval($bill->getBill()->active) ? 1 : 0;
|
||||
$active = 0 === (int)$bill->getBill()->active ? 1 : 0;
|
||||
$name = $bill->getBill()->name;
|
||||
|
||||
return $active . $name;
|
||||
|
@@ -190,7 +190,7 @@ class BillLine
|
||||
*/
|
||||
public function isActive(): bool
|
||||
{
|
||||
return 1 === intval($this->bill->active);
|
||||
return 1 === (int)$this->bill->active;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -25,11 +25,13 @@ namespace FireflyIII\Helpers\Collector;
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Helpers\Filter\CountAttachmentsFilter;
|
||||
use FireflyIII\Helpers\Filter\FilterInterface;
|
||||
use FireflyIII\Helpers\Filter\InternalTransferFilter;
|
||||
use FireflyIII\Helpers\Filter\NegativeAmountFilter;
|
||||
use FireflyIII\Helpers\Filter\OpposingAccountFilter;
|
||||
use FireflyIII\Helpers\Filter\PositiveAmountFilter;
|
||||
use FireflyIII\Helpers\Filter\SplitIndicatorFilter;
|
||||
use FireflyIII\Helpers\Filter\TransferFilter;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Budget;
|
||||
@@ -134,7 +136,7 @@ class JournalCollector implements JournalCollectorInterface
|
||||
public function addFilter(string $filter): JournalCollectorInterface
|
||||
{
|
||||
$interfaces = class_implements($filter);
|
||||
if (in_array(FilterInterface::class, $interfaces) && !in_array($filter, $this->filters)) {
|
||||
if (\in_array(FilterInterface::class, $interfaces) && !\in_array($filter, $this->filters)) {
|
||||
Log::debug(sprintf('Enabled filter %s', $filter));
|
||||
$this->filters[] = $filter;
|
||||
}
|
||||
@@ -235,7 +237,7 @@ class JournalCollector implements JournalCollectorInterface
|
||||
$countQuery->getQuery()->groups = null;
|
||||
$countQuery->getQuery()->orders = null;
|
||||
$countQuery->groupBy('accounts.user_id');
|
||||
$this->count = intval($countQuery->count());
|
||||
$this->count = (int)$countQuery->count();
|
||||
|
||||
return $this->count;
|
||||
}
|
||||
@@ -252,6 +254,9 @@ class JournalCollector implements JournalCollectorInterface
|
||||
$key = 'query-' . substr($hash, -8);
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($key);
|
||||
foreach ($this->filters as $filter) {
|
||||
$cache->addProperty((string)$filter);
|
||||
}
|
||||
if ($cache->has()) {
|
||||
Log::debug(sprintf('Return cache of query with ID "%s".', $key));
|
||||
|
||||
@@ -268,10 +273,10 @@ class JournalCollector implements JournalCollectorInterface
|
||||
$set->each(
|
||||
function (Transaction $transaction) {
|
||||
$transaction->date = new Carbon($transaction->date);
|
||||
$transaction->description = Steam::decrypt(intval($transaction->encrypted), $transaction->description);
|
||||
$transaction->description = Steam::decrypt((int)$transaction->encrypted, $transaction->description);
|
||||
|
||||
if (null !== $transaction->bill_name) {
|
||||
$transaction->bill_name = Steam::decrypt(intval($transaction->bill_name_encrypted), $transaction->bill_name);
|
||||
$transaction->bill_name = Steam::decrypt((int)$transaction->bill_name_encrypted, $transaction->bill_name);
|
||||
}
|
||||
$transaction->account_name = app('steam')->tryDecrypt($transaction->account_name);
|
||||
$transaction->opposing_account_name = app('steam')->tryDecrypt($transaction->opposing_account_name);
|
||||
@@ -336,7 +341,7 @@ class JournalCollector implements JournalCollectorInterface
|
||||
if ($accounts->count() > 0) {
|
||||
$accountIds = $accounts->pluck('id')->toArray();
|
||||
$this->query->whereIn('transactions.account_id', $accountIds);
|
||||
Log::debug(sprintf('setAccounts: %s', join(', ', $accountIds)));
|
||||
Log::debug(sprintf('setAccounts: %s', implode(', ', $accountIds)));
|
||||
$this->accountIds = $accountIds;
|
||||
}
|
||||
|
||||
@@ -439,7 +444,7 @@ class JournalCollector implements JournalCollectorInterface
|
||||
public function setBudgets(Collection $budgets): JournalCollectorInterface
|
||||
{
|
||||
$budgetIds = $budgets->pluck('id')->toArray();
|
||||
if (0 === count($budgetIds)) {
|
||||
if (0 === \count($budgetIds)) {
|
||||
return $this;
|
||||
}
|
||||
$this->joinBudgetTables();
|
||||
@@ -463,7 +468,7 @@ class JournalCollector implements JournalCollectorInterface
|
||||
public function setCategories(Collection $categories): JournalCollectorInterface
|
||||
{
|
||||
$categoryIds = $categories->pluck('id')->toArray();
|
||||
if (0 === count($categoryIds)) {
|
||||
if (0 === \count($categoryIds)) {
|
||||
return $this;
|
||||
}
|
||||
$this->joinCategoryTables();
|
||||
@@ -638,7 +643,7 @@ class JournalCollector implements JournalCollectorInterface
|
||||
*/
|
||||
public function setTypes(array $types): JournalCollectorInterface
|
||||
{
|
||||
if (count($types) > 0) {
|
||||
if (\count($types) > 0) {
|
||||
Log::debug('Set query collector types', $types);
|
||||
$this->query->whereIn('transaction_types.type', $types);
|
||||
}
|
||||
@@ -677,6 +682,7 @@ class JournalCollector implements JournalCollectorInterface
|
||||
->orderBy('transaction_journals.order', 'ASC')
|
||||
->orderBy('transaction_journals.id', 'DESC')
|
||||
->orderBy('transaction_journals.description', 'DESC')
|
||||
->orderBy('transactions.identifier', 'ASC')
|
||||
->orderBy('transactions.amount', 'DESC');
|
||||
|
||||
$this->query = $query;
|
||||
@@ -760,8 +766,10 @@ class JournalCollector implements JournalCollectorInterface
|
||||
TransferFilter::class => new TransferFilter,
|
||||
PositiveAmountFilter::class => new PositiveAmountFilter,
|
||||
NegativeAmountFilter::class => new NegativeAmountFilter,
|
||||
SplitIndicatorFilter::class => new SplitIndicatorFilter,
|
||||
CountAttachmentsFilter::class => new CountAttachmentsFilter,
|
||||
];
|
||||
Log::debug(sprintf('Will run %d filters on the set.', count($this->filters)));
|
||||
Log::debug(sprintf('Will run %d filters on the set.', \count($this->filters)));
|
||||
foreach ($this->filters as $enabled) {
|
||||
if (isset($filters[$enabled])) {
|
||||
Log::debug(sprintf('Before filter %s: %d', $enabled, $set->count()));
|
||||
|
@@ -42,13 +42,6 @@ interface JournalCollectorInterface
|
||||
*/
|
||||
public function addFilter(string $filter): JournalCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param Collection $journals
|
||||
*
|
||||
* @return JournalCollectorInterface
|
||||
*/
|
||||
public function setJournals(Collection $journals): JournalCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $amount
|
||||
*
|
||||
@@ -153,6 +146,13 @@ interface JournalCollectorInterface
|
||||
*/
|
||||
public function setCategory(Category $category): JournalCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param Collection $journals
|
||||
*
|
||||
* @return JournalCollectorInterface
|
||||
*/
|
||||
public function setJournals(Collection $journals): JournalCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param int $limit
|
||||
*
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user