mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-08-17 11:16:39 +00:00
Compare commits
361 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2660dc5bf7 | ||
|
40083bf2b4 | ||
|
3136bccb24 | ||
|
a5c370c70e | ||
|
01a897b5e1 | ||
|
722ae91c02 | ||
|
6df7f1f762 | ||
|
7aacd1f945 | ||
|
b02a61dfbd | ||
|
2b0a3ec818 | ||
|
00410c8486 | ||
|
8e0f0b03d8 | ||
|
7c3f2dd83a | ||
|
d2f0eab4c4 | ||
|
a8ade914ac | ||
|
ef08b7eb93 | ||
|
726ed3292a | ||
|
5883dfbed8 | ||
|
271e4271eb | ||
|
627db2c2df | ||
|
b9feb0aa71 | ||
|
155084084d | ||
|
1c3cb85a46 | ||
|
b0a39c00ba | ||
|
7cb919e9c2 | ||
|
cbecacd652 | ||
|
14e9d73768 | ||
|
8604b05d07 | ||
|
b66bac497e | ||
|
6ad38b38b8 | ||
|
53f31f17d2 | ||
|
a7bfdbe31f | ||
|
72ead65d9c | ||
|
846c60fb85 | ||
|
938446ede3 | ||
|
68f01d932e | ||
|
a6c355c7b8 | ||
|
5e49e149b1 | ||
|
06fd8dc5e0 | ||
|
43c79af293 | ||
|
3355645cb4 | ||
|
bac0710a9c | ||
|
47d8ab685d | ||
|
9fd4d29fda | ||
|
0126669fa8 | ||
|
1e01eb7bc2 | ||
|
ed28102aff | ||
|
6c91ca5463 | ||
|
9ab926f9ab | ||
|
29132b18ab | ||
|
28307edf81 | ||
|
7310e7a3e5 | ||
|
ff7219a955 | ||
|
97d739e254 | ||
|
8f26bbdaa0 | ||
|
67ef185a72 | ||
|
76954f4a13 | ||
|
afb9e6ef71 | ||
|
28112a2283 | ||
|
c5db6c9201 | ||
|
64813d4ba7 | ||
|
67e2c061ab | ||
|
d149cf01bd | ||
|
590c3cf6f8 | ||
|
93b25842e2 | ||
|
fa240c0e00 | ||
|
1b489385b2 | ||
|
bac0f99b9b | ||
|
8a66249b3d | ||
|
77bbe1e213 | ||
|
9973fd2970 | ||
|
64ea59e4ec | ||
|
80b8e676d0 | ||
|
867d932e59 | ||
|
57fb0d7f3b | ||
|
97cc2405a9 | ||
|
0022201c4f | ||
|
6f6b8d9b3e | ||
|
1d2e95f5af | ||
|
a0564751d6 | ||
|
4edd9fe3da | ||
|
5b05fb07ae | ||
|
998fed7782 | ||
|
c0cc896102 | ||
|
2d5790c417 | ||
|
1b978d41e0 | ||
|
9002365e6d | ||
|
c1cc71f85c | ||
|
ff599795d3 | ||
|
688f50ee3f | ||
|
e51fef3037 | ||
|
0f6f4e1a50 | ||
|
fe0a205a05 | ||
|
1059da8a2a | ||
|
e41236495f | ||
|
7436f94feb | ||
|
bcf1e4dc13 | ||
|
ba0843d0bb | ||
|
5a35960434 | ||
|
6eabe5fa8c | ||
|
8cb72d8d7d | ||
|
f81b5bea9d | ||
|
fa45076e48 | ||
|
08c07352ae | ||
|
94b0028254 | ||
|
b77b3e3fc8 | ||
|
4db6933c17 | ||
|
88160df2e8 | ||
|
0220cf9784 | ||
|
ef428a0226 | ||
|
dc45131f73 | ||
|
633d84449a | ||
|
c3a779df12 | ||
|
280c941899 | ||
|
d653bb24cb | ||
|
9879378566 | ||
|
7b4eb9f1df | ||
|
101bcc250e | ||
|
dedc1e8131 | ||
|
3b4b074bae | ||
|
4ee3c7d83e | ||
|
d36feebb71 | ||
|
6790c318e2 | ||
|
e9ef7d4144 | ||
|
a3a412d553 | ||
|
d0d7a0befc | ||
|
6b2e3dcb2a | ||
|
ab6d05cac3 | ||
|
c46962306e | ||
|
821bf6d657 | ||
|
f3df1d0a04 | ||
|
d7ff7c633d | ||
|
06629b0b89 | ||
|
ee9ab3d548 | ||
|
feb171171d | ||
|
21fede0dd0 | ||
|
12675dd950 | ||
|
5e32878d01 | ||
|
9a17a11b37 | ||
|
4f2159b54d | ||
|
075d459b7c | ||
|
e65d0eef6e | ||
|
91b7d20f9b | ||
|
59d96f2893 | ||
|
aa1a521cf0 | ||
|
4bb171128e | ||
|
a28f561e0c | ||
|
3b6c727916 | ||
|
447ec63299 | ||
|
f1a8d3cc81 | ||
|
4d7909e23d | ||
|
6f13600fb5 | ||
|
c9fefcd8f4 | ||
|
fa31483b02 | ||
|
e7be0eae8a | ||
|
86c70cf232 | ||
|
a3490e97c0 | ||
|
85b1768908 | ||
|
6ab462a795 | ||
|
70f46338db | ||
|
461b5ad859 | ||
|
6af62c6be0 | ||
|
78153c2aa4 | ||
|
62458885ce | ||
|
83d64262c8 | ||
|
0133a7c5db | ||
|
fa920fed4e | ||
|
1d138eed8d | ||
|
9e94b9e57e | ||
|
c4c690f44f | ||
|
902cc21ff0 | ||
|
106471877f | ||
|
ccaace707e | ||
|
cc14a4ac57 | ||
|
3ca1e6d197 | ||
|
531a6c17de | ||
|
4b7e1fcdb0 | ||
|
5f35bc5ee6 | ||
|
8100f68020 | ||
|
32a36bbb12 | ||
|
64b9234207 | ||
|
a9d490263b | ||
|
8c5a3c9b3e | ||
|
dd2f8d4404 | ||
|
ea82cff0ce | ||
|
66ef9a919a | ||
|
73b912ee8b | ||
|
5960258a89 | ||
|
ea7d1f481a | ||
|
d81a0ebba4 | ||
|
e90fb98613 | ||
|
2c34bd36a5 | ||
|
a86a582d0f | ||
|
c7778ce8cb | ||
|
5eaf1f4438 | ||
|
691682bc0c | ||
|
8627ee391a | ||
|
41089a0a0a | ||
|
2072a3dd94 | ||
|
8eec325e0a | ||
|
7ae88b42cf | ||
|
24e0839c34 | ||
|
c3398d4d51 | ||
|
80237d8bc3 | ||
|
4cec0a9f97 | ||
|
a810eb2cb5 | ||
|
7feb4b4aaf | ||
|
840fd61b04 | ||
|
5425dac180 | ||
|
0d65e396d4 | ||
|
704fc24d20 | ||
|
9b22c16f14 | ||
|
2923d1b449 | ||
|
9d5b028a5f | ||
|
97dfdd5c5d | ||
|
eb5ee4d147 | ||
|
d97581325d | ||
|
2a1e53f32a | ||
|
b5e4ac0038 | ||
|
b032210a33 | ||
|
24a1d61560 | ||
|
d632c1c7fc | ||
|
9c5b3fc030 | ||
|
90e407b9d0 | ||
|
dc0a2a2a10 | ||
|
b6aa76477e | ||
|
068191e08c | ||
|
533cd1dbed | ||
|
028ef63f6e | ||
|
127b6ea515 | ||
|
ab546865a8 | ||
|
d6a2f2959d | ||
|
58848caf30 | ||
|
c1107fe854 | ||
|
c3debb1a17 | ||
|
0c841a12d2 | ||
|
64ed9376fe | ||
|
1966e12703 | ||
|
289ccc7d89 | ||
|
590c33c0af | ||
|
4e7236a338 | ||
|
63b7626aab | ||
|
78b88949d8 | ||
|
40a7abf9e8 | ||
|
cd62dfd8f4 | ||
|
4445ad8fe5 | ||
|
ed29721677 | ||
|
e587f6ec37 | ||
|
f98f4b00ba | ||
|
78bbcb324b | ||
|
d646ab0232 | ||
|
1fe36044f1 | ||
|
2ea9369f99 | ||
|
802e1dbf2d | ||
|
b6aca26d8c | ||
|
ef653f7b00 | ||
|
8e183d8cad | ||
|
0ce34048cd | ||
|
d46041f22e | ||
|
94cf424bbd | ||
|
778d700ba8 | ||
|
8c1cbd77dd | ||
|
954bf779eb | ||
|
7fbed452bb | ||
|
e32023bb97 | ||
|
664a08d42f | ||
|
854c7f090b | ||
|
a29d056a9b | ||
|
7d3ee9f0c4 | ||
|
e26d39ab63 | ||
|
ecf465958f | ||
|
8fa6030341 | ||
|
1f6f6dadfa | ||
|
ed81eb4edf | ||
|
06ff4b808a | ||
|
fe5999d5b8 | ||
|
9331796dc3 | ||
|
0a18c948bc | ||
|
595a1fbe34 | ||
|
f12db3b8d9 | ||
|
2c1da7af31 | ||
|
0f9535bfd5 | ||
|
961d3c26fc | ||
|
bd8e003db8 | ||
|
619eb60dd1 | ||
|
15948303ec | ||
|
ccec203910 | ||
|
78122a7d4b | ||
|
272c73054e | ||
|
aa629523a0 | ||
|
3e6aca4cd1 | ||
|
891883c8c2 | ||
|
98ba392016 | ||
|
d49ee83748 | ||
|
88cdb1811f | ||
|
94c190668c | ||
|
eef0f4bd4e | ||
|
dad58fa362 | ||
|
40585469f2 | ||
|
d06035071a | ||
|
e81565d36a | ||
|
f66dd259f0 | ||
|
e003dcd596 | ||
|
d4ecf44b08 | ||
|
f4426eb830 | ||
|
7c86ce3977 | ||
|
1665335525 | ||
|
14bce014a3 | ||
|
75e5115aa3 | ||
|
de7638c502 | ||
|
126e378399 | ||
|
45e9c999b8 | ||
|
62bba0d33b | ||
|
0b220f3288 | ||
|
7dbdf0c4ff | ||
|
417b7c3f86 | ||
|
724a16944a | ||
|
c3bc1af7b5 | ||
|
38b7daf3b6 | ||
|
7bf7bb529e | ||
|
6b5774a66d | ||
|
0e3ebb9f1a | ||
|
1c41b6753d | ||
|
549f3c038a | ||
|
edbac66576 | ||
|
c788395508 | ||
|
35b0c20f88 | ||
|
518712d9e8 | ||
|
241ad25e2f | ||
|
7cf7c5fcef | ||
|
fbb9de64c3 | ||
|
88c145ac3e | ||
|
4aba842624 | ||
|
936c2b8888 | ||
|
c3e971c419 | ||
|
19fee6a8fb | ||
|
477eebdbe7 | ||
|
093bff750c | ||
|
92e679a9ea | ||
|
43232ae45c | ||
|
1fb13d8697 | ||
|
9ac28b93ca | ||
|
067c01ca06 | ||
|
82040c2a5d | ||
|
62502c746c | ||
|
6ab79a87fe | ||
|
04ee3b4dc1 | ||
|
9c9af79ad5 | ||
|
dd794e409f | ||
|
67d29b8416 | ||
|
5ee80dd046 | ||
|
f62e93b487 | ||
|
a7cc70b975 | ||
|
60f0d8074a | ||
|
ed1fdf9382 | ||
|
9ea3c4224e | ||
|
71325de44e | ||
|
cdb041e647 | ||
|
b9d750bf59 | ||
|
461249737e | ||
|
1aeaa8b77d |
@@ -36,9 +36,13 @@ $finder = PhpCsFixer\Finder::create()
|
||||
|
||||
$config = new PhpCsFixer\Config();
|
||||
return $config->setRules([
|
||||
'@PSR12' => true,
|
||||
'declare_strict_types' => true,
|
||||
'strict_param' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'@PhpCsFixer:risky' => true,
|
||||
'@PSR12:risky' => true,
|
||||
'declare_strict_types' => true,
|
||||
'strict_param' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'native_function_invocation' => false, // annoying
|
||||
'php_unit_data_provider_name' => false, // bloody annoying long test names
|
||||
'static_lambda' => false, // breaks the Response macro for API's.
|
||||
])
|
||||
->setFinder($finder);
|
||||
|
251
.ci/php-cs-fixer/composer.lock
generated
251
.ci/php-cs-fixer/composer.lock
generated
@@ -8,16 +8,16 @@
|
||||
"packages": [
|
||||
{
|
||||
"name": "composer/pcre",
|
||||
"version": "3.1.0",
|
||||
"version": "3.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/composer/pcre.git",
|
||||
"reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2"
|
||||
"reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
|
||||
"reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
|
||||
"url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9",
|
||||
"reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -59,7 +59,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/composer/pcre/issues",
|
||||
"source": "https://github.com/composer/pcre/tree/3.1.0"
|
||||
"source": "https://github.com/composer/pcre/tree/3.1.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -75,7 +75,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-11-17T09:50:14+00:00"
|
||||
"time": "2023-10-11T07:11:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/semver",
|
||||
@@ -226,52 +226,50 @@
|
||||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
"version": "v3.25.0",
|
||||
"version": "v3.40.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d"
|
||||
"reference": "7002f09c9593f515625a9f9717b10c2ab64dd3d5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d",
|
||||
"reference": "9025b7d2b6e1d90a63d0ac0905018ce5d03ec88d",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7002f09c9593f515625a9f9717b10c2ab64dd3d5",
|
||||
"reference": "7002f09c9593f515625a9f9717b10c2ab64dd3d5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"composer/semver": "^3.3",
|
||||
"composer/semver": "^3.4",
|
||||
"composer/xdebug-handler": "^3.0.3",
|
||||
"ext-json": "*",
|
||||
"ext-tokenizer": "*",
|
||||
"php": "^7.4 || ^8.0",
|
||||
"sebastian/diff": "^4.0 || ^5.0",
|
||||
"symfony/console": "^5.4 || ^6.0",
|
||||
"symfony/event-dispatcher": "^5.4 || ^6.0",
|
||||
"symfony/filesystem": "^5.4 || ^6.0",
|
||||
"symfony/finder": "^5.4 || ^6.0",
|
||||
"symfony/options-resolver": "^5.4 || ^6.0",
|
||||
"symfony/polyfill-mbstring": "^1.27",
|
||||
"symfony/polyfill-php80": "^1.27",
|
||||
"symfony/polyfill-php81": "^1.27",
|
||||
"symfony/process": "^5.4 || ^6.0",
|
||||
"symfony/stopwatch": "^5.4 || ^6.0"
|
||||
"symfony/console": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/finder": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/polyfill-mbstring": "^1.28",
|
||||
"symfony/polyfill-php80": "^1.28",
|
||||
"symfony/polyfill-php81": "^1.28",
|
||||
"symfony/process": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"facile-it/paraunit": "^1.3 || ^2.0",
|
||||
"justinrainbow/json-schema": "^5.2",
|
||||
"keradus/cli-executor": "^2.0",
|
||||
"keradus/cli-executor": "^2.1",
|
||||
"mikey179/vfsstream": "^1.6.11",
|
||||
"php-coveralls/php-coveralls": "^2.5.3",
|
||||
"php-coveralls/php-coveralls": "^2.7",
|
||||
"php-cs-fixer/accessible-object": "^1.1",
|
||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2",
|
||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1",
|
||||
"phpspec/prophecy": "^1.16",
|
||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4",
|
||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4",
|
||||
"phpspec/prophecy": "^1.17",
|
||||
"phpspec/prophecy-phpunit": "^2.0",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"phpunitgoodpractices/polyfill": "^1.6",
|
||||
"phpunitgoodpractices/traits": "^1.9.2",
|
||||
"symfony/phpunit-bridge": "^6.2.3",
|
||||
"symfony/yaml": "^5.4 || ^6.0"
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"symfony/phpunit-bridge": "^6.3.8 || ^7.0",
|
||||
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-dom": "For handling output formats in XML",
|
||||
@@ -309,7 +307,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.25.0"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.40.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -317,7 +315,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2023-08-31T21:27:18+00:00"
|
||||
"time": "2023-12-02T23:18:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
@@ -541,43 +539,46 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v6.3.4",
|
||||
"version": "v7.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "eca495f2ee845130855ddf1cf18460c38966c8b6"
|
||||
"reference": "cdce5c684b2f920bb1343deecdfba356ffad83d5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/eca495f2ee845130855ddf1cf18460c38966c8b6",
|
||||
"reference": "eca495f2ee845130855ddf1cf18460c38966c8b6",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/cdce5c684b2f920bb1343deecdfba356ffad83d5",
|
||||
"reference": "cdce5c684b2f920bb1343deecdfba356ffad83d5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"symfony/deprecation-contracts": "^2.5|^3",
|
||||
"php": ">=8.2",
|
||||
"symfony/polyfill-mbstring": "~1.0",
|
||||
"symfony/service-contracts": "^2.5|^3",
|
||||
"symfony/string": "^5.4|^6.0"
|
||||
"symfony/string": "^6.4|^7.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/dependency-injection": "<5.4",
|
||||
"symfony/dotenv": "<5.4",
|
||||
"symfony/event-dispatcher": "<5.4",
|
||||
"symfony/lock": "<5.4",
|
||||
"symfony/process": "<5.4"
|
||||
"symfony/dependency-injection": "<6.4",
|
||||
"symfony/dotenv": "<6.4",
|
||||
"symfony/event-dispatcher": "<6.4",
|
||||
"symfony/lock": "<6.4",
|
||||
"symfony/process": "<6.4"
|
||||
},
|
||||
"provide": {
|
||||
"psr/log-implementation": "1.0|2.0|3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "^1|^2|^3",
|
||||
"symfony/config": "^5.4|^6.0",
|
||||
"symfony/dependency-injection": "^5.4|^6.0",
|
||||
"symfony/event-dispatcher": "^5.4|^6.0",
|
||||
"symfony/lock": "^5.4|^6.0",
|
||||
"symfony/process": "^5.4|^6.0",
|
||||
"symfony/var-dumper": "^5.4|^6.0"
|
||||
"symfony/config": "^6.4|^7.0",
|
||||
"symfony/dependency-injection": "^6.4|^7.0",
|
||||
"symfony/event-dispatcher": "^6.4|^7.0",
|
||||
"symfony/http-foundation": "^6.4|^7.0",
|
||||
"symfony/http-kernel": "^6.4|^7.0",
|
||||
"symfony/lock": "^6.4|^7.0",
|
||||
"symfony/messenger": "^6.4|^7.0",
|
||||
"symfony/process": "^6.4|^7.0",
|
||||
"symfony/stopwatch": "^6.4|^7.0",
|
||||
"symfony/var-dumper": "^6.4|^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -611,7 +612,7 @@
|
||||
"terminal"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/console/tree/v6.3.4"
|
||||
"source": "https://github.com/symfony/console/tree/v7.0.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -627,11 +628,11 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-08-16T10:10:12+00:00"
|
||||
"time": "2023-12-01T15:10:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
"version": "v3.3.0",
|
||||
"version": "v3.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||
@@ -678,7 +679,7 @@
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0"
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -698,24 +699,24 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v6.3.2",
|
||||
"version": "v7.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e"
|
||||
"reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/adb01fe097a4ee930db9258a3cc906b5beb5cf2e",
|
||||
"reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c459b40ffe67c49af6fd392aac374c9edf8a027e",
|
||||
"reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"php": ">=8.2",
|
||||
"symfony/event-dispatcher-contracts": "^2.5|^3"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/dependency-injection": "<5.4",
|
||||
"symfony/dependency-injection": "<6.4",
|
||||
"symfony/service-contracts": "<2.5"
|
||||
},
|
||||
"provide": {
|
||||
@@ -724,13 +725,13 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "^1|^2|^3",
|
||||
"symfony/config": "^5.4|^6.0",
|
||||
"symfony/dependency-injection": "^5.4|^6.0",
|
||||
"symfony/error-handler": "^5.4|^6.0",
|
||||
"symfony/expression-language": "^5.4|^6.0",
|
||||
"symfony/http-foundation": "^5.4|^6.0",
|
||||
"symfony/config": "^6.4|^7.0",
|
||||
"symfony/dependency-injection": "^6.4|^7.0",
|
||||
"symfony/error-handler": "^6.4|^7.0",
|
||||
"symfony/expression-language": "^6.4|^7.0",
|
||||
"symfony/http-foundation": "^6.4|^7.0",
|
||||
"symfony/service-contracts": "^2.5|^3",
|
||||
"symfony/stopwatch": "^5.4|^6.0"
|
||||
"symfony/stopwatch": "^6.4|^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -758,7 +759,7 @@
|
||||
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/event-dispatcher/tree/v6.3.2"
|
||||
"source": "https://github.com/symfony/event-dispatcher/tree/v7.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -774,11 +775,11 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-07-06T06:56:43+00:00"
|
||||
"time": "2023-07-27T16:29:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher-contracts",
|
||||
"version": "v3.3.0",
|
||||
"version": "v3.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
|
||||
@@ -834,7 +835,7 @@
|
||||
"standards"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0"
|
||||
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -854,20 +855,20 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/filesystem",
|
||||
"version": "v6.3.1",
|
||||
"version": "v7.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/filesystem.git",
|
||||
"reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae"
|
||||
"reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae",
|
||||
"reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/7da8ea2362a283771478c5f7729cfcb43a76b8b7",
|
||||
"reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"php": ">=8.2",
|
||||
"symfony/polyfill-ctype": "~1.8",
|
||||
"symfony/polyfill-mbstring": "~1.8"
|
||||
},
|
||||
@@ -897,7 +898,7 @@
|
||||
"description": "Provides basic utilities for the filesystem",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/filesystem/tree/v6.3.1"
|
||||
"source": "https://github.com/symfony/filesystem/tree/v7.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -913,27 +914,27 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-06-01T08:30:39+00:00"
|
||||
"time": "2023-07-27T06:33:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/finder",
|
||||
"version": "v6.3.3",
|
||||
"version": "v7.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/finder.git",
|
||||
"reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e"
|
||||
"reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/9915db259f67d21eefee768c1abcf1cc61b1fc9e",
|
||||
"reference": "9915db259f67d21eefee768c1abcf1cc61b1fc9e",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/6e5688d69f7cfc4ed4a511e96007e06c2d34ce56",
|
||||
"reference": "6e5688d69f7cfc4ed4a511e96007e06c2d34ce56",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1"
|
||||
"php": ">=8.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/filesystem": "^6.0"
|
||||
"symfony/filesystem": "^6.4|^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -961,7 +962,7 @@
|
||||
"description": "Finds files and directories via an intuitive fluent interface",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/finder/tree/v6.3.3"
|
||||
"source": "https://github.com/symfony/finder/tree/v7.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -977,24 +978,24 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-07-31T08:31:44+00:00"
|
||||
"time": "2023-10-31T17:59:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/options-resolver",
|
||||
"version": "v6.3.0",
|
||||
"version": "v7.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/options-resolver.git",
|
||||
"reference": "a10f19f5198d589d5c33333cffe98dc9820332dd"
|
||||
"reference": "700ff4096e346f54cb628ea650767c8130f1001f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd",
|
||||
"reference": "a10f19f5198d589d5c33333cffe98dc9820332dd",
|
||||
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/700ff4096e346f54cb628ea650767c8130f1001f",
|
||||
"reference": "700ff4096e346f54cb628ea650767c8130f1001f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"php": ">=8.2",
|
||||
"symfony/deprecation-contracts": "^2.5|^3"
|
||||
},
|
||||
"type": "library",
|
||||
@@ -1028,7 +1029,7 @@
|
||||
"options"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/options-resolver/tree/v6.3.0"
|
||||
"source": "https://github.com/symfony/options-resolver/tree/v7.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1044,7 +1045,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-05-12T14:21:09+00:00"
|
||||
"time": "2023-08-08T10:20:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
@@ -1540,20 +1541,20 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v6.3.4",
|
||||
"version": "v7.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "0b5c29118f2e980d455d2e34a5659f4579847c54"
|
||||
"reference": "13bdb1670c7f510494e04fcb2bfa29af63db9c0d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54",
|
||||
"reference": "0b5c29118f2e980d455d2e34a5659f4579847c54",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/13bdb1670c7f510494e04fcb2bfa29af63db9c0d",
|
||||
"reference": "13bdb1670c7f510494e04fcb2bfa29af63db9c0d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1"
|
||||
"php": ">=8.2"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -1581,7 +1582,7 @@
|
||||
"description": "Executes commands in sub-processes",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/process/tree/v6.3.4"
|
||||
"source": "https://github.com/symfony/process/tree/v7.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1597,20 +1598,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-08-07T10:39:22+00:00"
|
||||
"time": "2023-11-20T16:43:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/service-contracts",
|
||||
"version": "v3.3.0",
|
||||
"version": "v3.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/service-contracts.git",
|
||||
"reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4"
|
||||
"reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4",
|
||||
"reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4",
|
||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838",
|
||||
"reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1663,7 +1664,7 @@
|
||||
"standards"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/service-contracts/tree/v3.3.0"
|
||||
"source": "https://github.com/symfony/service-contracts/tree/v3.4.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1679,24 +1680,24 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-05-23T14:45:45+00:00"
|
||||
"time": "2023-07-30T20:28:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/stopwatch",
|
||||
"version": "v6.3.0",
|
||||
"version": "v7.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/stopwatch.git",
|
||||
"reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2"
|
||||
"reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2",
|
||||
"reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2",
|
||||
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a",
|
||||
"reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"php": ">=8.2",
|
||||
"symfony/service-contracts": "^2.5|^3"
|
||||
},
|
||||
"type": "library",
|
||||
@@ -1725,7 +1726,7 @@
|
||||
"description": "Provides a way to profile code",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/stopwatch/tree/v6.3.0"
|
||||
"source": "https://github.com/symfony/stopwatch/tree/v7.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1741,24 +1742,24 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-02-16T10:14:28+00:00"
|
||||
"time": "2023-07-05T13:06:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/string",
|
||||
"version": "v6.3.2",
|
||||
"version": "v7.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/string.git",
|
||||
"reference": "53d1a83225002635bca3482fcbf963001313fb68"
|
||||
"reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/53d1a83225002635bca3482fcbf963001313fb68",
|
||||
"reference": "53d1a83225002635bca3482fcbf963001313fb68",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/92bd2bfbba476d4a1838e5e12168bef2fd1e6620",
|
||||
"reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"php": ">=8.2",
|
||||
"symfony/polyfill-ctype": "~1.8",
|
||||
"symfony/polyfill-intl-grapheme": "~1.0",
|
||||
"symfony/polyfill-intl-normalizer": "~1.0",
|
||||
@@ -1768,11 +1769,11 @@
|
||||
"symfony/translation-contracts": "<2.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/error-handler": "^5.4|^6.0",
|
||||
"symfony/http-client": "^5.4|^6.0",
|
||||
"symfony/intl": "^6.2",
|
||||
"symfony/error-handler": "^6.4|^7.0",
|
||||
"symfony/http-client": "^6.4|^7.0",
|
||||
"symfony/intl": "^6.4|^7.0",
|
||||
"symfony/translation-contracts": "^2.5|^3.0",
|
||||
"symfony/var-exporter": "^5.4|^6.0"
|
||||
"symfony/var-exporter": "^6.4|^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -1811,7 +1812,7 @@
|
||||
"utf8"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/string/tree/v6.3.2"
|
||||
"source": "https://github.com/symfony/string/tree/v7.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1827,7 +1828,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-07-05T08:41:27+00:00"
|
||||
"time": "2023-11-29T08:40:23+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
@@ -1838,5 +1839,5 @@
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.3.0"
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
|
22
.ci/phpcs.sh
22
.ci/phpcs.sh
@@ -28,11 +28,29 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
# enable test .env file.
|
||||
# cp .ci/.env.ci .env
|
||||
|
||||
OUTPUT_FORMAT=txt
|
||||
EXTRA_PARAMS="-v"
|
||||
|
||||
if [[ $GITHUB_ACTIONS = "true" ]]
|
||||
then
|
||||
OUTPUT_FORMAT=gitlab
|
||||
EXTRA_PARAMS="--diff --dry-run"
|
||||
fi
|
||||
|
||||
# clean up php code
|
||||
cd $SCRIPT_DIR/php-cs-fixer
|
||||
composer update --quiet
|
||||
rm -f .php-cs-fixer.cache
|
||||
PHP_CS_FIXER_IGNORE_ENV=true ./vendor/bin/php-cs-fixer fix --config $SCRIPT_DIR/php-cs-fixer/.php-cs-fixer.php --allow-risky=yes
|
||||
PHP_CS_FIXER_IGNORE_ENV=true
|
||||
./vendor/bin/php-cs-fixer fix \
|
||||
--config $SCRIPT_DIR/php-cs-fixer/.php-cs-fixer.php \
|
||||
--format=$OUTPUT_FORMAT \
|
||||
--allow-risky=yes $EXTRA_PARAMS
|
||||
|
||||
EXIT_CODE=$?
|
||||
|
||||
echo "Exit code for CS fixer is $EXIT_CODE."
|
||||
|
||||
cd $SCRIPT_DIR/..
|
||||
|
||||
exit 0
|
||||
exit $EXIT_CODE
|
||||
|
18
.ci/phpmd.sh
Normal file → Executable file
18
.ci/phpmd.sh
Normal file → Executable file
@@ -22,16 +22,30 @@
|
||||
|
||||
|
||||
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
OUTPUT_FORMAT=text
|
||||
|
||||
if [[ $GITHUB_ACTIONS = "true" ]]
|
||||
then
|
||||
OUTPUT_FORMAT=github
|
||||
fi
|
||||
|
||||
|
||||
cd $SCRIPT_DIR/phpmd
|
||||
composer update --quiet
|
||||
./vendor/bin/phpmd \
|
||||
$SCRIPT_DIR/../app text phpmd.xml \
|
||||
$SCRIPT_DIR/../app,$SCRIPT_DIR/../database,$SCRIPT_DIR/../routes,$SCRIPT_DIR/../config \
|
||||
$OUTPUT_FORMAT phpmd.xml \
|
||||
--exclude $SCRIPT_DIR/../app/resources/** \
|
||||
--exclude $SCRIPT_DIR/../app/frontend/** \
|
||||
--exclude $SCRIPT_DIR/../app/public/** \
|
||||
--exclude $SCRIPT_DIR/../app/vendor/** \
|
||||
--exclude $SCRIPT_DIR/../app/vendor/**
|
||||
|
||||
EXIT_CODE=$?
|
||||
|
||||
cd $SCRIPT_DIR/..
|
||||
|
||||
echo "Exit code is $EXIT_CODE, but we ignore this for the time being."
|
||||
|
||||
# for the time being, exit 0
|
||||
#exit $EXIT_CODE
|
||||
exit 0
|
||||
|
181
.ci/phpmd/composer.lock
generated
181
.ci/phpmd/composer.lock
generated
@@ -9,16 +9,16 @@
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "composer/pcre",
|
||||
"version": "3.1.0",
|
||||
"version": "3.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/composer/pcre.git",
|
||||
"reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2"
|
||||
"reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
|
||||
"reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
|
||||
"url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9",
|
||||
"reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -60,7 +60,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/composer/pcre/issues",
|
||||
"source": "https://github.com/composer/pcre/tree/3.1.0"
|
||||
"source": "https://github.com/composer/pcre/tree/3.1.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -76,7 +76,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-11-17T09:50:14+00:00"
|
||||
"time": "2023-10-11T07:11:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/xdebug-handler",
|
||||
@@ -146,23 +146,24 @@
|
||||
},
|
||||
{
|
||||
"name": "pdepend/pdepend",
|
||||
"version": "2.14.0",
|
||||
"version": "2.16.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pdepend/pdepend.git",
|
||||
"reference": "1121d4b04af06e33e9659bac3a6741b91cab1de1"
|
||||
"reference": "8dfc0c46529e2073fa97986552f80646eedac562"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pdepend/pdepend/zipball/1121d4b04af06e33e9659bac3a6741b91cab1de1",
|
||||
"reference": "1121d4b04af06e33e9659bac3a6741b91cab1de1",
|
||||
"url": "https://api.github.com/repos/pdepend/pdepend/zipball/8dfc0c46529e2073fa97986552f80646eedac562",
|
||||
"reference": "8dfc0c46529e2073fa97986552f80646eedac562",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.7",
|
||||
"symfony/config": "^2.3.0|^3|^4|^5|^6.0",
|
||||
"symfony/dependency-injection": "^2.3.0|^3|^4|^5|^6.0",
|
||||
"symfony/filesystem": "^2.3.0|^3|^4|^5|^6.0"
|
||||
"symfony/config": "^2.3.0|^3|^4|^5|^6.0|^7.0",
|
||||
"symfony/dependency-injection": "^2.3.0|^3|^4|^5|^6.0|^7.0",
|
||||
"symfony/filesystem": "^2.3.0|^3|^4|^5|^6.0|^7.0",
|
||||
"symfony/polyfill-mbstring": "^1.19"
|
||||
},
|
||||
"require-dev": {
|
||||
"easy-doc/easy-doc": "0.0.0|^1.2.3",
|
||||
@@ -197,7 +198,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/pdepend/pdepend/issues",
|
||||
"source": "https://github.com/pdepend/pdepend/tree/2.14.0"
|
||||
"source": "https://github.com/pdepend/pdepend/tree/2.16.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -205,26 +206,26 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-05-26T13:15:18+00:00"
|
||||
"time": "2023-11-29T08:52:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpmd/phpmd",
|
||||
"version": "2.13.0",
|
||||
"version": "2.14.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpmd/phpmd.git",
|
||||
"reference": "dad0228156856b3ad959992f9748514fa943f3e3"
|
||||
"reference": "442fc2c34edcd5198b442d8647c7f0aec3afabe8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpmd/phpmd/zipball/dad0228156856b3ad959992f9748514fa943f3e3",
|
||||
"reference": "dad0228156856b3ad959992f9748514fa943f3e3",
|
||||
"url": "https://api.github.com/repos/phpmd/phpmd/zipball/442fc2c34edcd5198b442d8647c7f0aec3afabe8",
|
||||
"reference": "442fc2c34edcd5198b442d8647c7f0aec3afabe8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"composer/xdebug-handler": "^1.0 || ^2.0 || ^3.0",
|
||||
"ext-xml": "*",
|
||||
"pdepend/pdepend": "^2.12.1",
|
||||
"pdepend/pdepend": "^2.15.1",
|
||||
"php": ">=5.3.9"
|
||||
},
|
||||
"require-dev": {
|
||||
@@ -234,7 +235,7 @@
|
||||
"gregwar/rst": "^1.0",
|
||||
"mikey179/vfsstream": "^1.6.8",
|
||||
"phpunit/phpunit": "^4.8.36 || ^5.7.27",
|
||||
"squizlabs/php_codesniffer": "^2.0"
|
||||
"squizlabs/php_codesniffer": "^2.9.2 || ^3.7.2"
|
||||
},
|
||||
"bin": [
|
||||
"src/bin/phpmd"
|
||||
@@ -271,6 +272,7 @@
|
||||
"description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.",
|
||||
"homepage": "https://phpmd.org/",
|
||||
"keywords": [
|
||||
"dev",
|
||||
"mess detection",
|
||||
"mess detector",
|
||||
"pdepend",
|
||||
@@ -280,7 +282,7 @@
|
||||
"support": {
|
||||
"irc": "irc://irc.freenode.org/phpmd",
|
||||
"issues": "https://github.com/phpmd/phpmd/issues",
|
||||
"source": "https://github.com/phpmd/phpmd/tree/2.13.0"
|
||||
"source": "https://github.com/phpmd/phpmd/tree/2.14.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -288,7 +290,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-09-10T08:44:15+00:00"
|
||||
"time": "2023-09-28T13:07:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
@@ -395,34 +397,34 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/config",
|
||||
"version": "v6.3.0",
|
||||
"version": "v7.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/config.git",
|
||||
"reference": "a5e00dec161b08c946a2c16eed02adbeedf827ae"
|
||||
"reference": "8789646600f4e7e451dde9e1dc81cfa429f3857a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/config/zipball/a5e00dec161b08c946a2c16eed02adbeedf827ae",
|
||||
"reference": "a5e00dec161b08c946a2c16eed02adbeedf827ae",
|
||||
"url": "https://api.github.com/repos/symfony/config/zipball/8789646600f4e7e451dde9e1dc81cfa429f3857a",
|
||||
"reference": "8789646600f4e7e451dde9e1dc81cfa429f3857a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"php": ">=8.2",
|
||||
"symfony/deprecation-contracts": "^2.5|^3",
|
||||
"symfony/filesystem": "^5.4|^6.0",
|
||||
"symfony/filesystem": "^6.4|^7.0",
|
||||
"symfony/polyfill-ctype": "~1.8"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/finder": "<5.4",
|
||||
"symfony/finder": "<6.4",
|
||||
"symfony/service-contracts": "<2.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/event-dispatcher": "^5.4|^6.0",
|
||||
"symfony/finder": "^5.4|^6.0",
|
||||
"symfony/messenger": "^5.4|^6.0",
|
||||
"symfony/event-dispatcher": "^6.4|^7.0",
|
||||
"symfony/finder": "^6.4|^7.0",
|
||||
"symfony/messenger": "^6.4|^7.0",
|
||||
"symfony/service-contracts": "^2.5|^3",
|
||||
"symfony/yaml": "^5.4|^6.0"
|
||||
"symfony/yaml": "^6.4|^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -450,7 +452,7 @@
|
||||
"description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/config/tree/v6.3.0"
|
||||
"source": "https://github.com/symfony/config/tree/v7.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -466,44 +468,43 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-04-25T10:46:17+00:00"
|
||||
"time": "2023-11-09T08:30:23+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/dependency-injection",
|
||||
"version": "v6.3.1",
|
||||
"version": "v7.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/dependency-injection.git",
|
||||
"reference": "7abf242af21f196b65f20ab00ff251fdf3889b8d"
|
||||
"reference": "f6667642954bce638733f254c39e5b5700b47ba4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/7abf242af21f196b65f20ab00ff251fdf3889b8d",
|
||||
"reference": "7abf242af21f196b65f20ab00ff251fdf3889b8d",
|
||||
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f6667642954bce638733f254c39e5b5700b47ba4",
|
||||
"reference": "f6667642954bce638733f254c39e5b5700b47ba4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"php": ">=8.2",
|
||||
"psr/container": "^1.1|^2.0",
|
||||
"symfony/deprecation-contracts": "^2.5|^3",
|
||||
"symfony/service-contracts": "^2.5|^3.0",
|
||||
"symfony/var-exporter": "^6.2.10"
|
||||
"symfony/service-contracts": "^3.3",
|
||||
"symfony/var-exporter": "^6.4|^7.0"
|
||||
},
|
||||
"conflict": {
|
||||
"ext-psr": "<1.1|>=2",
|
||||
"symfony/config": "<6.1",
|
||||
"symfony/finder": "<5.4",
|
||||
"symfony/proxy-manager-bridge": "<6.3",
|
||||
"symfony/yaml": "<5.4"
|
||||
"symfony/config": "<6.4",
|
||||
"symfony/finder": "<6.4",
|
||||
"symfony/yaml": "<6.4"
|
||||
},
|
||||
"provide": {
|
||||
"psr/container-implementation": "1.1|2.0",
|
||||
"symfony/service-implementation": "1.1|2.0|3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/config": "^6.1",
|
||||
"symfony/expression-language": "^5.4|^6.0",
|
||||
"symfony/yaml": "^5.4|^6.0"
|
||||
"symfony/config": "^6.4|^7.0",
|
||||
"symfony/expression-language": "^6.4|^7.0",
|
||||
"symfony/yaml": "^6.4|^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -531,7 +532,7 @@
|
||||
"description": "Allows you to standardize and centralize the way objects are constructed in your application",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/dependency-injection/tree/v6.3.1"
|
||||
"source": "https://github.com/symfony/dependency-injection/tree/v7.0.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -547,11 +548,11 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-06-24T11:51:27+00:00"
|
||||
"time": "2023-12-01T15:10:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
"version": "v3.3.0",
|
||||
"version": "v3.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||
@@ -598,7 +599,7 @@
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0"
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -618,20 +619,20 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/filesystem",
|
||||
"version": "v6.3.1",
|
||||
"version": "v7.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/filesystem.git",
|
||||
"reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae"
|
||||
"reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae",
|
||||
"reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/7da8ea2362a283771478c5f7729cfcb43a76b8b7",
|
||||
"reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"php": ">=8.2",
|
||||
"symfony/polyfill-ctype": "~1.8",
|
||||
"symfony/polyfill-mbstring": "~1.8"
|
||||
},
|
||||
@@ -661,7 +662,7 @@
|
||||
"description": "Provides basic utilities for the filesystem",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/filesystem/tree/v6.3.1"
|
||||
"source": "https://github.com/symfony/filesystem/tree/v7.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -677,20 +678,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-06-01T08:30:39+00:00"
|
||||
"time": "2023-07-27T06:33:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.27.0",
|
||||
"version": "v1.28.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a"
|
||||
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
|
||||
"reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -705,7 +706,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.27-dev"
|
||||
"dev-main": "1.28-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@@ -743,7 +744,7 @@
|
||||
"portable"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0"
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -759,20 +760,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
"time": "2023-01-26T09:26:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.27.0",
|
||||
"version": "v1.28.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||
"reference": "42292d99c55abe617799667f454222c54c60e229"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229",
|
||||
"reference": "42292d99c55abe617799667f454222c54c60e229",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -787,7 +788,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.27-dev"
|
||||
"dev-main": "1.28-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
@@ -826,7 +827,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -842,20 +843,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
"time": "2023-07-28T09:04:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/service-contracts",
|
||||
"version": "v3.3.0",
|
||||
"version": "v3.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/service-contracts.git",
|
||||
"reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4"
|
||||
"reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4",
|
||||
"reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4",
|
||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838",
|
||||
"reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -908,7 +909,7 @@
|
||||
"standards"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/service-contracts/tree/v3.3.0"
|
||||
"source": "https://github.com/symfony/service-contracts/tree/v3.4.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -924,27 +925,27 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-05-23T14:45:45+00:00"
|
||||
"time": "2023-07-30T20:28:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-exporter",
|
||||
"version": "v6.3.0",
|
||||
"version": "v7.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-exporter.git",
|
||||
"reference": "db5416d04269f2827d8c54331ba4cfa42620d350"
|
||||
"reference": "a3d7c877414fcd59ab7075ecdc3b8f9c00f7bcc3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/db5416d04269f2827d8c54331ba4cfa42620d350",
|
||||
"reference": "db5416d04269f2827d8c54331ba4cfa42620d350",
|
||||
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/a3d7c877414fcd59ab7075ecdc3b8f9c00f7bcc3",
|
||||
"reference": "a3d7c877414fcd59ab7075ecdc3b8f9c00f7bcc3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1"
|
||||
"php": ">=8.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/var-dumper": "^5.4|^6.0"
|
||||
"symfony/var-dumper": "^6.4|^7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -982,7 +983,7 @@
|
||||
"serialize"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/var-exporter/tree/v6.3.0"
|
||||
"source": "https://github.com/symfony/var-exporter/tree/v7.0.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -998,7 +999,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-04-21T08:48:44+00:00"
|
||||
"time": "2023-11-30T11:38:21+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
@@ -1008,5 +1009,5 @@
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.3.0"
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
|
@@ -20,53 +20,74 @@
|
||||
-->
|
||||
|
||||
<ruleset name="pcsg-generated-ruleset"
|
||||
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<description>Bla bla</description>
|
||||
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<description>Firefly III ruleset.</description>
|
||||
<!-- Import the entire controversial code rule set -->
|
||||
<rule ref="rulesets/controversial.xml">
|
||||
<exclude name="CamelCasePropertyName"/>
|
||||
</rule>
|
||||
|
||||
<!--
|
||||
Commando vanuit firefly directory:
|
||||
phpmd database,app,tests html /gdrive-all/development/phpmd/phpmd.xml > public/report.html
|
||||
-->
|
||||
<!-- clean code -->
|
||||
<!-- <rule ref="rulesets/codesize.xml" /> -->
|
||||
<rule ref="rulesets/unusedcode.xml"/>
|
||||
|
||||
<!-- Import the entire controversial code rule set -->
|
||||
<rule ref="rulesets/controversial.xml">
|
||||
<exclude name="CamelCasePropertyName" />
|
||||
</rule>
|
||||
|
||||
<!-- clean code -->
|
||||
<rule ref="rulesets/codesize.xml" />
|
||||
<rule ref="rulesets/design.xml" />
|
||||
<rule ref="rulesets/naming.xml" />
|
||||
<rule ref="rulesets/unusedcode.xml" />
|
||||
<rule ref="rulesets/design.xml/NumberOfChildren">
|
||||
<properties>
|
||||
<!-- TODO we want to be at minimum 15. But we start high, and drop the bar slowly. -->
|
||||
<property name="minimum" value="256"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
|
||||
<properties>
|
||||
<!-- TODO we want to be at maximum 13. But we start high, and drop the bar slowly. -->
|
||||
<property name="maximum" value="256"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
|
||||
<properties>
|
||||
<property name="reportLevel" value="5"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/NPathComplexity">
|
||||
<properties>
|
||||
<property name="minimum" value="128"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
|
||||
<properties>
|
||||
<property name="minimum" value="40"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/ExcessiveParameterList">
|
||||
<properties>
|
||||
<property name="minimum" value="5"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- include clean code manually -->
|
||||
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag" />
|
||||
<rule ref="rulesets/cleancode.xml/ElseExpression" />
|
||||
<rule ref="rulesets/naming.xml/ShortMethodName">
|
||||
<properties>
|
||||
<property name="minimum" value="3"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- no this one -->
|
||||
<!--<rule ref="rulesets/cleancode.xml/StaticAccess" />-->
|
||||
<!-- code size -->
|
||||
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
|
||||
<properties>
|
||||
<!-- TODO we want to be at report level 5. But we start high, and drop the bar slowly. -->
|
||||
<property name="reportLevel" value="500"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/NPathComplexity">
|
||||
<properties>
|
||||
<!-- TODO we want to be at a value of 128. But we start high, and drop the bar slowly. -->
|
||||
<property name="minimum" value="24062500"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
|
||||
<properties>
|
||||
<!-- TODO we want to be at a value of 40. But we start high, and drop the bar slowly. -->
|
||||
<property name="minimum" value="100"/>
|
||||
<property name="ignore-whitespace" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/ExcessiveParameterList">
|
||||
<properties>
|
||||
<!-- 5 is fine. 6 is excessive, but I have just one of those. At the end of the day, I still need all params. -->
|
||||
<property name="minimum" value="5"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- include clean code manually -->
|
||||
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag"/>
|
||||
<rule ref="rulesets/cleancode.xml/ElseExpression"/>
|
||||
<rule ref="rulesets/cleancode.xml/MissingImport"/>
|
||||
<rule ref="rulesets/cleancode.xml/UndefinedVariable"/>
|
||||
<rule ref="rulesets/cleancode.xml/IfStatementAssignment"/>
|
||||
<rule ref="rulesets/cleancode.xml/DuplicatedArrayKey"/>
|
||||
<rule ref="rulesets/cleancode.xml/ErrorControlOperator"/>
|
||||
</ruleset>
|
||||
|
@@ -1,42 +1,32 @@
|
||||
includes:
|
||||
- ../vendor/nunomaduro/larastan/extension.neon
|
||||
- ../vendor/ergebnis/phpstan-rules/rules.neon
|
||||
- ../vendor/phpstan/phpstan-deprecation-rules/rules.neon
|
||||
- ../vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
|
||||
|
||||
parameters:
|
||||
universalObjectCratesClasses:
|
||||
- Illuminate\Database\Eloquent\Model
|
||||
# TODO: slowly remove these parameters and fix the issues found.
|
||||
reportUnmatchedIgnoredErrors: false
|
||||
checkGenericClassInNonGenericObjectType: false # remove this rule when all other issues are solved.
|
||||
ignoreErrors:
|
||||
# TODO: slowly remove these exceptions and fix the issues found.
|
||||
- '#Dynamic call to static method#' # all the Laravel ORM things depend on this.
|
||||
- '#Control structures using switch should not be used.#' # switch is fine in some cases.
|
||||
- '#with no value type specified in iterable type array#' # remove this rule when all other issues are solved.
|
||||
- '#has no value type specified in iterable type array#' # remove this rule when all other issues are solved.
|
||||
- '#is not allowed to extend#'
|
||||
- '#switch is forbidden to use#'
|
||||
- '#is neither abstract nor final#'
|
||||
- '#has a nullable return type declaration#'
|
||||
- '#with a nullable type declaration#'
|
||||
- '#has a nullable return type declaration#' # perhaps throw errors instead?
|
||||
- '#with a nullable type declaration#' # decide what action should be if param is null.
|
||||
- '#with null as default value#'
|
||||
- '#is not covariant with PHPDoc type array#'
|
||||
-
|
||||
message: '#Constructor in [a-zA-Z0-9\\_]+ has parameter \$[a-zA-Z0-9\\_]+ with default value#'
|
||||
paths:
|
||||
- ../app/Exceptions/IntervalException.php
|
||||
- ../app/Support/Navigation.php
|
||||
-
|
||||
message: '#but containers should not be injected#'
|
||||
paths:
|
||||
- ../app/Support/Authentication/RemoteUserGuard.php
|
||||
-
|
||||
message: '#Control structures using switch should not be used.#'
|
||||
paths:
|
||||
- ../app/Api/V1/Controllers/Data/DestroyController.php
|
||||
- ../app/Console/Commands/Correction/FixAccountTypes.php
|
||||
- ../app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php
|
||||
- ../app/Exceptions/GracefulNotFoundHandler.php
|
||||
- ../app/Generator/Webhook/StandardMessageGenerator.php
|
||||
- ../app/Support/Amount.php
|
||||
- ../app/Support/Navigation.php
|
||||
- ../app/Support/ParseDateString.php
|
||||
- ../app/Support/Search/AccountSearch.php
|
||||
- ../app/Support/Search/OperatorQuerySearch.php
|
||||
- ../app/Support/Twig/General.php
|
||||
- ../app/Transformers/RecurrenceTransformer.php
|
||||
- ../app/Validation/AccountValidator.php
|
||||
- ../app/Validation/RecurrenceValidation.php
|
||||
- ../app/Validation/TransactionValidation.php
|
||||
|
||||
-
|
||||
message: '#Function compact\(\) should not be used#'
|
||||
message: '#Function compact\(\) should not be used#' # too useful in template rendering.
|
||||
paths:
|
||||
- ../app/Generator/Report/Account/MonthReportGenerator.php
|
||||
- ../app/Generator/Report/Audit/MonthReportGenerator.php
|
||||
@@ -57,7 +47,6 @@ parameters:
|
||||
message: '#Either catch a more specific exception#'
|
||||
paths:
|
||||
- ../app/Support/Form/FormSupport.php
|
||||
|
||||
paths:
|
||||
- ../app
|
||||
- ../database
|
||||
@@ -66,5 +55,6 @@ parameters:
|
||||
- ../bootstrap/app.php
|
||||
|
||||
# The level 8 is the highest level. original was 5
|
||||
level: 4
|
||||
# 7 is more than enough, higher just leaves NULL things.
|
||||
level: 7
|
||||
|
||||
|
@@ -29,7 +29,20 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
# cp .ci/.env.ci .env
|
||||
|
||||
# Do static code analysis.
|
||||
# ./vendor/bin/phpstan analyse -c .ci/phpstan.neon --no-progress
|
||||
./vendor/bin/phpstan analyse -c .ci/phpstan.neon --xdebug --error-format=table > phpstan-report.txt
|
||||
if [[ $GITHUB_ACTIONS = "" ]]
|
||||
then
|
||||
./vendor/bin/phpstan analyse -c .ci/phpstan.neon --error-format=table > phpstan-report.txt
|
||||
EXIT_CODE=$?
|
||||
echo "The PHPstan report can be found in phpstan-report.txt. Exit code is $EXIT_CODE."
|
||||
fi
|
||||
|
||||
echo 'The PHPstan report can be found in phpstan-report.txt'
|
||||
if [[ $GITHUB_ACTIONS = "true" ]]
|
||||
then
|
||||
./vendor/bin/phpstan analyse -c .ci/phpstan.neon --no-progress --error-format=github
|
||||
EXIT_CODE=$?
|
||||
|
||||
# temporary exit code 0
|
||||
# EXIT_CODE=0
|
||||
fi
|
||||
|
||||
exit $EXIT_CODE
|
||||
|
@@ -1,63 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# phpunit.sh
|
||||
# Copyright (c) 2021 james@firefly-iii.org
|
||||
#
|
||||
# This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
# enable test .env file.
|
||||
cp $SCRIPT_DIR/../.env $SCRIPT_DIR/../.env.backup
|
||||
cp $SCRIPT_DIR/.env.ci $SCRIPT_DIR/../.env
|
||||
|
||||
COVERAGE=false
|
||||
RESET=false
|
||||
FILE=storage/database/database.sqlite
|
||||
|
||||
while getopts "cr" o; do
|
||||
case "${o}" in
|
||||
c) COVERAGE=true;;
|
||||
r) RESET=true;;
|
||||
esac
|
||||
done
|
||||
|
||||
# reset if necessary.
|
||||
if [ $RESET = "true" ] ; then
|
||||
rm -f $FILE
|
||||
fi
|
||||
|
||||
# download test database
|
||||
if [ -f "$FILE" ]; then
|
||||
echo 'DB exists, will use it'
|
||||
else
|
||||
echo 'Download new DB'
|
||||
wget --quiet https://github.com/firefly-iii/test-fixtures/raw/main/test-database.sqlite -O $FILE
|
||||
fi
|
||||
|
||||
# run phpunit
|
||||
if [ $COVERAGE = "true" ] ; then
|
||||
echo 'Run with coverage'
|
||||
XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html $SCRIPT_DIR/coverage
|
||||
else
|
||||
echo 'Run without coverage'
|
||||
./vendor/bin/phpunit --configuration phpunit.xml
|
||||
fi
|
||||
|
||||
# restore .env file
|
||||
mv $SCRIPT_DIR/../.env.backup $SCRIPT_DIR/../.env
|
||||
|
||||
cd $SCRIPT_DIR/..
|
10
.env.example
10
.env.example
@@ -195,6 +195,16 @@ MAP_DEFAULT_LAT=51.983333
|
||||
MAP_DEFAULT_LONG=5.916667
|
||||
MAP_DEFAULT_ZOOM=6
|
||||
|
||||
#
|
||||
# Some objects have room for an URL, like transactions and webhooks.
|
||||
# By default, the following protocols are allowed:
|
||||
# http, https, ftp, ftps, mailto
|
||||
#
|
||||
# To change this, set your preferred comma separated set below.
|
||||
# Be sure to include http, https and other default ones if you need to.
|
||||
#
|
||||
VALID_URL_PROTOCOLS=
|
||||
|
||||
#
|
||||
# Firefly III authentication settings
|
||||
#
|
||||
|
26
.env.testing
Normal file
26
.env.testing
Normal file
@@ -0,0 +1,26 @@
|
||||
APP_ENV=testing
|
||||
APP_DEBUG=true
|
||||
SITE_OWNER=mail@example.com
|
||||
APP_KEY=TestTestTestTestTestTestTestTest
|
||||
DEFAULT_LANGUAGE=en_US
|
||||
DEFAULT_LOCALE=equal
|
||||
TZ=Europe/Amsterdam
|
||||
LOG_CHANNEL=stdout
|
||||
APP_LOG_LEVEL=debug
|
||||
AUDIT_LOG_LEVEL=info
|
||||
AUDIT_LOG_CHANNEL=audit_stdout
|
||||
DB_CONNECTION=sqlite
|
||||
CACHE_DRIVER=array
|
||||
SESSION_DRIVER=array
|
||||
MAIL_MAILER=log
|
||||
SEND_ERROR_MESSAGE=true
|
||||
ENABLE_EXTERNAL_MAP=false
|
||||
ENABLE_EXTERNAL_RATES=true
|
||||
AUTHENTICATION_GUARD=web
|
||||
ALLOW_WEBHOOKS=true
|
||||
APP_NAME=FireflyIII
|
||||
BROADCAST_DRIVER=log
|
||||
QUEUE_DRIVER=sync
|
||||
CACHE_PREFIX=firefly
|
||||
FIREFLY_III_LAYOUT=v1
|
||||
APP_URL=http://localhost
|
37
.github/label-actions.yml
vendored
Normal file
37
.github/label-actions.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# Configuration for Label Actions - https://github.com/dessant/label-actions
|
||||
|
||||
# The `feature` label is added to issues
|
||||
feature:
|
||||
issues:
|
||||
# Post a comment, `{issue-author}` is an optional placeholder
|
||||
comment: |
|
||||
Hi there! This is an automatic reply. `Share and enjoy`
|
||||
|
||||
This issue has been marked as a feature request. The requested (new) feature will become a part of Firefly III or the data importer in due course.
|
||||
|
||||
If you come across this issue, please be aware there is NO need to reply with "+1" or "me too" or "I need this too" or whatever. Such comments are not helpful, and do not influence [the roadmap](https://roadmap.firefly-iii.org/). Your comment may be :skull: deleted. You can subscribe to this issue to get updates.
|
||||
|
||||
Thank you for your contributions.
|
||||
|
||||
enhancement:
|
||||
issues:
|
||||
# Post a comment, `{issue-author}` is an optional placeholder
|
||||
comment: |
|
||||
Hi there! This is an automatic reply. `Share and enjoy`
|
||||
|
||||
This issue has been marked as an enhancement. The requested enhancement to an existing feature will become a part of Firefly III or the data importer in due course.
|
||||
|
||||
If you come across this issue, please be aware there is NO need to reply with "+1" or "me too" or "I need this too" or whatever. Such comments are not helpful, and do not influence [the roadmap](https://roadmap.firefly-iii.org/). Your comment may be :skull: deleted. You can subscribe to this issue to get updates.
|
||||
|
||||
Thank you for your contributions.
|
||||
|
||||
# The `solved` label is added to discussions
|
||||
triage:
|
||||
issues:
|
||||
# Post a comment, `{issue-author}` is an optional placeholder
|
||||
comment: |
|
||||
Hi there! This is an automatic reply. `Share and enjoy`
|
||||
|
||||
This issue has been marked as being in triage. The root cause is not known yet, or the issue needs more investigation. You can help by sharing debug information (from `/debug`) if you also have this issue or when you haven't already done so.
|
||||
|
||||
Thank you for your contributions.
|
23
.github/workflows/cleanup.yml
vendored
23
.github/workflows/cleanup.yml
vendored
@@ -1,6 +1,6 @@
|
||||
# This workflow prunes old workflow runs for an entire repository.
|
||||
|
||||
name: Prune old builds
|
||||
name: "Chore - Prune old builds"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
@@ -22,14 +22,14 @@ jobs:
|
||||
repo: context.repo.repo,
|
||||
status: 'cancelled',
|
||||
});
|
||||
|
||||
|
||||
const skipped = await github.rest.actions.listWorkflowRunsForRepo({
|
||||
owner: context.repo.owner,
|
||||
per_page: 100,
|
||||
repo: context.repo.repo,
|
||||
status: 'skipped',
|
||||
});
|
||||
|
||||
|
||||
for (const response of [cancelled, skipped]) {
|
||||
for (const run of response.data.workflow_runs) {
|
||||
console.log(`Run id ${run.id} of '${run.name}' is a cancelled/skipped run. Deleting...`);
|
||||
@@ -50,23 +50,22 @@ jobs:
|
||||
const ms_in_day = 86400000;
|
||||
const now = Date.now();
|
||||
const pages = 5;
|
||||
|
||||
|
||||
// we don't want to prune old runs from test.yml
|
||||
// because we track the duration of runs over time
|
||||
|
||||
|
||||
const workflows = [
|
||||
'cleanup.yml',
|
||||
'closed-issues.yml',
|
||||
'depsreview.yaml',
|
||||
'laravel.yml',
|
||||
'depsreview.yml',
|
||||
'label-actions.yml',
|
||||
'lock.yml',
|
||||
'qodana.yml',
|
||||
'sonarcloud.yml',
|
||||
'stale.yml'
|
||||
]
|
||||
|
||||
|
||||
let runs_to_delete = [];
|
||||
|
||||
|
||||
for (const workflow of workflows) {
|
||||
for (let page = 0; page < pages; page += 1) {
|
||||
let response = await github.rest.actions.listWorkflowRuns({
|
||||
@@ -76,7 +75,7 @@ jobs:
|
||||
repo: context.repo.repo,
|
||||
workflow_id: workflow
|
||||
});
|
||||
|
||||
|
||||
if (response.data.workflow_runs.length > 0) {
|
||||
for (const run of response.data.workflow_runs) {
|
||||
if (now - Date.parse(run.created_at) > ms_in_day * days_to_expiration) {
|
||||
@@ -86,7 +85,7 @@ jobs:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const run of runs_to_delete) {
|
||||
console.log(`Run id ${run[0]} of '${run[1]}' is older than ${days_to_expiration} days. Deleting...`);
|
||||
try {
|
||||
|
24
.github/workflows/closed-issues.yml
vendored
24
.github/workflows/closed-issues.yml
vendored
@@ -1,22 +1,28 @@
|
||||
name: "Reply to closed issue"
|
||||
---
|
||||
name: Issues - Reply to closed issue
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- closed
|
||||
jobs:
|
||||
auto_comment:
|
||||
command_and_close:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: aws-actions/closed-issue-message@v1
|
||||
with:
|
||||
message: |
|
||||
Hi there! This is an automatic reply. `Share and enjoy`
|
||||
|
||||
This issue is now 🔒 closed. Please be aware that closed issues are **not** watched.
|
||||
|
||||
- If the original bug is not actually fixed, please feel free to open [a new issue](https://github.com/firefly-iii/firefly-iii/issues/new/choose). Please refer to this issue for clarity.
|
||||
|
||||
This issue is now 🔒 closed. Please be aware that closed issues are not monitored by the developer of Firefly III.
|
||||
|
||||
- If the original bug is not actually fixed, please open [a new issue](https://github.com/firefly-iii/firefly-iii/issues/new/choose). Refer to this issue for clarity.
|
||||
- Follow-up questions must be posted in a new [discussion](https://github.com/firefly-iii/firefly-iii/discussions/)
|
||||
- Further replies to this issue will get **no response**.
|
||||
|
||||
- Further replies to this issue may get no response.
|
||||
|
||||
If there is more to discuss, please open [a new issue](https://github.com/firefly-iii/firefly-iii/issues/new/choose) or [discussion](https://github.com/firefly-iii/firefly-iii/discussions/).
|
||||
|
||||
Thank you for your contributions.
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: OSDKDev/lock-issues@v1.1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
name: 'Dependency Review'
|
||||
name: 'Code - Dependency review'
|
||||
on: [ pull_request ]
|
||||
|
||||
permissions:
|
||||
@@ -8,7 +8,9 @@ jobs:
|
||||
dependency-review:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Checkout Repository'
|
||||
- name: 'Checkout repository'
|
||||
uses: actions/checkout@v3
|
||||
- name: 'Dependency Review'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: 'Dependency review'
|
||||
uses: actions/dependency-review-action@v3
|
21
.github/workflows/label-actions.yml
vendored
Normal file
21
.github/workflows/label-actions.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: 'Issues - Reply to specific labels'
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled, unlabeled]
|
||||
pull_request_target:
|
||||
types: [labeled, unlabeled]
|
||||
discussion:
|
||||
types: [labeled, unlabeled]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
discussions: write
|
||||
|
||||
jobs:
|
||||
action:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/label-actions@v3
|
146
.github/workflows/laravel.yml
vendored
146
.github/workflows/laravel.yml
vendored
@@ -1,146 +0,0 @@
|
||||
name: Firefly III
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Copy .env
|
||||
run: test -f .env || cp .ci/.env.ci .env
|
||||
- name: Prepare dependencies
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
export PATH=$PATH:$HOME/.composer/vendor/bin/
|
||||
composer global require hirak/prestissimo --no-plugins --no-scripts
|
||||
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
|
||||
|
||||
touch ./storage/database/database.sqlite
|
||||
- name: Prepare Firefly III
|
||||
run: |
|
||||
chmod -R 777 storage bootstrap/cache
|
||||
php artisan migrate --seed
|
||||
php artisan firefly-iii:upgrade-database
|
||||
- name: Upload database
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: database
|
||||
path: storage/database/database.sqlite
|
||||
- name: Upload cache
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: cache
|
||||
path: bootstrap/cache/
|
||||
- name: Upload composer cache
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: composer
|
||||
path: ~/.composer
|
||||
|
||||
laravel-tests:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs:
|
||||
- prepare
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Copy .env
|
||||
run: test -f .env || cp .ci/.env.ci .env
|
||||
- name: Download database
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: database
|
||||
path: storage/database/database.sqlite
|
||||
- name: Download cache
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: cache
|
||||
path: bootstrap/cache/
|
||||
- name: Download vendor
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: composer
|
||||
path: ~/.composer
|
||||
- name: Install composer
|
||||
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
|
||||
|
||||
- name: PHPUnit tests
|
||||
uses: php-actions/phpunit@v1
|
||||
with:
|
||||
config: phpunit.xml
|
||||
memory: 512M
|
||||
|
||||
coding-standards:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs:
|
||||
- prepare
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Copy .env
|
||||
run: test -f .env || cp .ci/.env.ci .env
|
||||
- name: Download database
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: database
|
||||
path: storage/database/database.sqlite
|
||||
- name: Download cache
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: cache
|
||||
path: bootstrap/cache/
|
||||
- name: Download vendor
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: composer
|
||||
path: ~/.composer
|
||||
- name: install depenencies
|
||||
run: |
|
||||
composer global require nette/coding-standard
|
||||
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
|
||||
|
||||
- name: Execute code standard
|
||||
run: /home/runner/.composer/vendor/bin/ecs check app tests --config ./.ci/firefly-iii-standard.yml
|
||||
|
||||
phpstan:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs:
|
||||
- prepare
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Copy .env
|
||||
run: test -f .env || cp .ci/.env.ci .env
|
||||
- name: Download database
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: database
|
||||
path: storage/database/database.sqlite
|
||||
- name: Download cache
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: cache
|
||||
path: bootstrap/cache/
|
||||
- name: Download vendor
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: composer
|
||||
path: ~/.composer
|
||||
- name: Install depenencies
|
||||
run: |
|
||||
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
|
||||
|
||||
- name: Execute PHPStan
|
||||
run: vendor/bin/phpstan analyse -c .ci/phpstan.neon
|
2
.github/workflows/lock.yml
vendored
2
.github/workflows/lock.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Lock old issues
|
||||
name: 'Issues - Lock old issues'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
35
.github/workflows/qodana.yml
vendored
35
.github/workflows/qodana.yml
vendored
@@ -1,35 +0,0 @@
|
||||
name: Qodana
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
jobs:
|
||||
qodana:
|
||||
runs-on: ubuntu-latest
|
||||
name: 'Qodana Scan'
|
||||
steps:
|
||||
- name: Setup PHP with no coverage driver
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.2'
|
||||
coverage: none
|
||||
extensions: bcmath, intl
|
||||
env:
|
||||
update: true
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
composer install --no-scripts
|
||||
cp .env.example .env
|
||||
php artisan key:generate
|
||||
php artisan clear-compiled
|
||||
php artisan ide-helper:generate;
|
||||
|
||||
- name: 'Qodana Scan'
|
||||
uses: JetBrains/qodana-action@main
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
|
54
.github/workflows/sonarcloud.yml
vendored
54
.github/workflows/sonarcloud.yml
vendored
@@ -1,21 +1,21 @@
|
||||
name: Sonarcloud
|
||||
name: 'Code - Run Sonarcloud'
|
||||
on:
|
||||
pull_request:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
env:
|
||||
DB_CONNECTION: sqlite
|
||||
APP_KEY: UfpBqqeXx7zpNodsC6yjYQcRfDdm4Bxh
|
||||
jobs:
|
||||
sonarcloud:
|
||||
name: SonarCloud
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -24,15 +24,47 @@ jobs:
|
||||
with:
|
||||
php-version: '8.2'
|
||||
coverage: xdebug
|
||||
extensions: >-
|
||||
bcmath
|
||||
curl
|
||||
fileinfo
|
||||
iconv
|
||||
intl
|
||||
json
|
||||
sqlite3
|
||||
mbstring
|
||||
openssl
|
||||
pdo
|
||||
session
|
||||
simplexml
|
||||
sodium
|
||||
tokenizer
|
||||
xml
|
||||
xmlwriter
|
||||
|
||||
- name: Copy standard configuration
|
||||
run: cp .env.testing .env
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install --prefer-dist --no-interaction --no-progress --no-scripts
|
||||
|
||||
- name: Copy environment file
|
||||
run: cp .env.example .env
|
||||
- name: PHPStan
|
||||
run: .ci/phpstan.sh
|
||||
|
||||
- name: Generate app key
|
||||
run: php artisan key:generate
|
||||
- name: PHPMD
|
||||
run: .ci/phpmd.sh
|
||||
|
||||
- name: PHP CS Fixer
|
||||
run: .ci/phpcs.sh
|
||||
|
||||
- name: "Create database file"
|
||||
run: touch storage/database/database.sqlite
|
||||
|
||||
- name: "Upgrades the database to the latest version"
|
||||
run: php artisan firefly-iii:upgrade-database
|
||||
|
||||
- name: "Integrity Database Report"
|
||||
run: php artisan firefly-iii:report-integrity
|
||||
|
||||
- name: "Run tests with coverage"
|
||||
run: composer coverage
|
||||
|
8
.github/workflows/stale.yml
vendored
8
.github/workflows/stale.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: "Close stale issues"
|
||||
name: "Issues - Close stale issues"
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 1 * * *"
|
||||
@@ -20,13 +20,13 @@ jobs:
|
||||
stale-issue-message: >
|
||||
Hi there! This is an automatic reply. `Share and enjoy`
|
||||
|
||||
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
|
||||
|
||||
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.
|
||||
stale-pr-message: >
|
||||
Hi there! This is an automatic reply. `Share and enjoy`
|
||||
|
||||
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
|
||||
This PR 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.
|
||||
days-before-stale: 14
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,8 +1,6 @@
|
||||
/node_modules
|
||||
/frontend/node_modules
|
||||
/storage/*.key
|
||||
/vendor
|
||||
/.vagrant
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
.env
|
||||
|
@@ -8,7 +8,5 @@
|
||||
# To hide directory listing
|
||||
Options All -Indexes
|
||||
|
||||
# To prevent access to .env and other files
|
||||
<Files .*>
|
||||
Deny from all
|
||||
</Files>
|
||||
# To prevent access any file
|
||||
Deny from all
|
||||
|
@@ -41,6 +41,7 @@ class AccountController extends Controller
|
||||
{
|
||||
use AccountFilter;
|
||||
|
||||
/** @var array<int, string> */
|
||||
private array $balanceTypes;
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
@@ -82,7 +83,8 @@ class AccountController extends Controller
|
||||
$date = $data['date'] ?? today(config('app.timezone'));
|
||||
|
||||
$return = [];
|
||||
$result = $this->repository->searchAccount((string)$query, $types, $data['limit']);
|
||||
|
||||
$result = $this->repository->searchAccount((string)$query, $types, $this->parameters->get('limit'));
|
||||
// TODO this code is duplicated in the V2 Autocomplete controller, which means this code is due to be deprecated.
|
||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
||||
|
||||
@@ -105,7 +107,7 @@ class AccountController extends Controller
|
||||
'name' => $account->name,
|
||||
'name_with_balance' => $nameWithBalance,
|
||||
'type' => $account->accountType->type,
|
||||
'currency_id' => $currency->id,
|
||||
'currency_id' => (string)$currency->id,
|
||||
'currency_name' => $currency->name,
|
||||
'currency_code' => $currency->code,
|
||||
'currency_symbol' => $currency->symbol,
|
||||
@@ -116,10 +118,10 @@ class AccountController extends Controller
|
||||
// custom order.
|
||||
usort(
|
||||
$return,
|
||||
function ($a, $b) {
|
||||
static function (array $left, array $right) {
|
||||
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
|
||||
$posA = array_search($a['type'], $order, true);
|
||||
$posB = array_search($b['type'], $order, true);
|
||||
$posA = (int)array_search($left['type'], $order, true);
|
||||
$posB = (int)array_search($right['type'], $order, true);
|
||||
|
||||
return $posA - $posB;
|
||||
}
|
||||
|
@@ -58,7 +58,6 @@ class BillController extends Controller
|
||||
/**
|
||||
* Documentation for this endpoint is at:
|
||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getBillsAC
|
||||
* TODO expand API to add active field.
|
||||
*
|
||||
* @param AutocompleteRequest $request
|
||||
*
|
||||
@@ -67,7 +66,7 @@ class BillController extends Controller
|
||||
public function bills(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$result = $this->repository->searchBill($data['query'], $data['limit']);
|
||||
$result = $this->repository->searchBill($data['query'], $this->parameters->get('limit'));
|
||||
$filtered = $result->map(
|
||||
static function (Bill $item) {
|
||||
return [
|
||||
|
@@ -66,7 +66,7 @@ class BudgetController extends Controller
|
||||
public function budgets(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$result = $this->repository->searchBudget($data['query'], $data['limit']);
|
||||
$result = $this->repository->searchBudget($data['query'], $this->parameters->get('limit'));
|
||||
$filtered = $result->map(
|
||||
static function (Budget $item) {
|
||||
return [
|
||||
|
@@ -66,7 +66,7 @@ class CategoryController extends Controller
|
||||
public function categories(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$result = $this->repository->searchCategory($data['query'], $data['limit']);
|
||||
$result = $this->repository->searchCategory($data['query'], $this->parameters->get('limit'));
|
||||
$filtered = $result->map(
|
||||
static function (Category $item) {
|
||||
return [
|
||||
|
@@ -26,7 +26,7 @@ namespace FireflyIII\Api\V1\Controllers\Autocomplete;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\UserGroups\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
@@ -66,7 +66,7 @@ class CurrencyController extends Controller
|
||||
public function currencies(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$collection = $this->repository->searchCurrency($data['query'], $data['limit']);
|
||||
$collection = $this->repository->searchCurrency($data['query'], $this->parameters->get('limit'));
|
||||
$result = [];
|
||||
|
||||
/** @var TransactionCurrency $currency */
|
||||
@@ -95,7 +95,7 @@ class CurrencyController extends Controller
|
||||
public function currenciesWithCode(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$collection = $this->repository->searchCurrency($data['query'], $data['limit']);
|
||||
$collection = $this->repository->searchCurrency($data['query'], $this->parameters->get('limit'));
|
||||
$result = [];
|
||||
|
||||
/** @var TransactionCurrency $currency */
|
||||
|
@@ -67,7 +67,7 @@ class ObjectGroupController extends Controller
|
||||
{
|
||||
$data = $request->getData();
|
||||
$return = [];
|
||||
$result = $this->repository->search($data['query'], $data['limit']);
|
||||
$result = $this->repository->search($data['query'], $this->parameters->get('limit'));
|
||||
|
||||
/** @var ObjectGroup $objectGroup */
|
||||
foreach ($result as $objectGroup) {
|
||||
|
@@ -70,7 +70,7 @@ class PiggyBankController extends Controller
|
||||
public function piggyBanks(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$piggies = $this->piggyRepository->searchPiggyBank($data['query'], $data['limit']);
|
||||
$piggies = $this->piggyRepository->searchPiggyBank($data['query'], $this->parameters->get('limit'));
|
||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
||||
$response = [];
|
||||
|
||||
@@ -105,7 +105,7 @@ class PiggyBankController extends Controller
|
||||
public function piggyBanksWithBalance(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$piggies = $this->piggyRepository->searchPiggyBank($data['query'], $data['limit']);
|
||||
$piggies = $this->piggyRepository->searchPiggyBank($data['query'], $this->parameters->get('limit'));
|
||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
||||
$response = [];
|
||||
/** @var PiggyBank $piggy */
|
||||
|
@@ -64,7 +64,7 @@ class RecurrenceController extends Controller
|
||||
public function recurring(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$recurrences = $this->repository->searchRecurrence($data['query'], $data['limit']);
|
||||
$recurrences = $this->repository->searchRecurrence($data['query'], $this->parameters->get('limit'));
|
||||
$response = [];
|
||||
|
||||
/** @var Recurrence $recurrence */
|
||||
|
@@ -63,7 +63,7 @@ class RuleController extends Controller
|
||||
public function rules(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$rules = $this->repository->searchRule($data['query'], $data['limit']);
|
||||
$rules = $this->repository->searchRule($data['query'], $this->parameters->get('limit'));
|
||||
$response = [];
|
||||
|
||||
/** @var Rule $rule */
|
||||
|
@@ -63,7 +63,7 @@ class RuleGroupController extends Controller
|
||||
public function ruleGroups(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$groups = $this->repository->searchRuleGroup($data['query'], $data['limit']);
|
||||
$groups = $this->repository->searchRuleGroup($data['query'], $this->parameters->get('limit'));
|
||||
$response = [];
|
||||
|
||||
/** @var RuleGroup $group */
|
||||
|
@@ -67,7 +67,7 @@ class TagController extends Controller
|
||||
{
|
||||
$data = $request->getData();
|
||||
|
||||
$result = $this->repository->searchTags($data['query'], $data['limit']);
|
||||
$result = $this->repository->searchTags($data['query'], $this->parameters->get('limit'));
|
||||
$array = [];
|
||||
/** @var Tag $tag */
|
||||
foreach ($result as $tag) {
|
||||
|
@@ -71,7 +71,7 @@ class TransactionController extends Controller
|
||||
public function transactions(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$result = $this->repository->searchJournalDescriptions($data['query'], $data['limit']);
|
||||
$result = $this->repository->searchJournalDescriptions($data['query'], $this->parameters->get('limit'));
|
||||
|
||||
// limit and unique
|
||||
$filtered = $result->unique('description');
|
||||
@@ -113,7 +113,7 @@ class TransactionController extends Controller
|
||||
}
|
||||
}
|
||||
if (!is_numeric($data['query'])) {
|
||||
$result = $this->repository->searchJournalDescriptions($data['query'], $data['limit']);
|
||||
$result = $this->repository->searchJournalDescriptions($data['query'], $this->parameters->get('limit'));
|
||||
}
|
||||
|
||||
// limit and unique
|
||||
|
@@ -62,7 +62,7 @@ class TransactionTypeController extends Controller
|
||||
public function transactionTypes(AutocompleteRequest $request): JsonResponse
|
||||
{
|
||||
$data = $request->getData();
|
||||
$types = $this->repository->searchTypes($data['query'], $data['limit']);
|
||||
$types = $this->repository->searchTypes($data['query'], $this->parameters->get('limit'));
|
||||
$array = [];
|
||||
|
||||
/** @var TransactionType $type */
|
||||
|
@@ -30,8 +30,8 @@ use FireflyIII\Api\V1\Requests\Data\DateRequest;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Preference;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Api\ApiSupport;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
@@ -46,8 +46,7 @@ class AccountController extends Controller
|
||||
{
|
||||
use ApiSupport;
|
||||
|
||||
private CurrencyRepositoryInterface $currencyRepository;
|
||||
private AccountRepositoryInterface $repository;
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
/**
|
||||
* AccountController constructor.
|
||||
@@ -64,9 +63,6 @@ class AccountController extends Controller
|
||||
$this->repository = app(AccountRepositoryInterface::class);
|
||||
$this->repository->setUser($user);
|
||||
|
||||
$this->currencyRepository = app(CurrencyRepositoryInterface::class);
|
||||
$this->currencyRepository->setUser($user);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
);
|
||||
@@ -95,6 +91,7 @@ class AccountController extends Controller
|
||||
|
||||
// user's preferences
|
||||
$defaultSet = $this->repository->getAccountsByType([AccountType::ASSET])->pluck('id')->toArray();
|
||||
/** @var Preference $frontPage */
|
||||
$frontPage = app('preferences')->get('frontPageAccounts', $defaultSet);
|
||||
$default = app('amount')->getDefaultCurrency();
|
||||
|
||||
|
@@ -27,11 +27,12 @@ namespace FireflyIII\Api\V1\Controllers;
|
||||
use Carbon\Carbon;
|
||||
use Carbon\Exceptions\InvalidDateException;
|
||||
use Carbon\Exceptions\InvalidFormatException;
|
||||
use FireflyIII\Models\Preference;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use League\Fractal\Manager;
|
||||
use League\Fractal\Serializer\JsonApiSerializer;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
@@ -50,7 +51,8 @@ abstract class Controller extends BaseController
|
||||
use DispatchesJobs;
|
||||
use ValidatesRequests;
|
||||
|
||||
protected const CONTENT_TYPE = 'application/vnd.api+json';
|
||||
protected const string CONTENT_TYPE = 'application/vnd.api+json';
|
||||
/** @var array<int, string> */
|
||||
protected array $allowedSort;
|
||||
protected ParameterBag $parameters;
|
||||
|
||||
@@ -61,9 +63,9 @@ abstract class Controller extends BaseController
|
||||
{
|
||||
// get global parameters
|
||||
$this->allowedSort = config('firefly.allowed_sort_parameters');
|
||||
$this->parameters = $this->getParameters();
|
||||
$this->middleware(
|
||||
function ($request, $next) {
|
||||
$this->parameters = $this->getParameters();
|
||||
if (auth()->check()) {
|
||||
$language = app('steam')->getLanguage();
|
||||
app()->setLocale($language);
|
||||
@@ -88,8 +90,8 @@ abstract class Controller extends BaseController
|
||||
if ($page < 1) {
|
||||
$page = 1;
|
||||
}
|
||||
if ($page > pow(2, 16)) {
|
||||
$page = pow(2, 16);
|
||||
if ($page > 2 ** 16) {
|
||||
$page = 2 ** 16;
|
||||
}
|
||||
$bag->set('page', $page);
|
||||
|
||||
@@ -100,21 +102,21 @@ abstract class Controller extends BaseController
|
||||
try {
|
||||
$date = request()->query->get($field);
|
||||
} catch (BadRequestException $e) {
|
||||
Log::error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $field));
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $field));
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$value = null;
|
||||
}
|
||||
$obj = null;
|
||||
if (null !== $date) {
|
||||
try {
|
||||
$obj = Carbon::parse($date);
|
||||
$obj = Carbon::parse((string)$date);
|
||||
} catch (InvalidDateException | InvalidFormatException $e) {
|
||||
// don't care
|
||||
app('log')->warning(
|
||||
sprintf(
|
||||
'Ignored invalid date "%s" in API controller parameter check: %s',
|
||||
substr($date, 0, 20),
|
||||
substr((string)$date, 0, 20),
|
||||
$e->getMessage()
|
||||
)
|
||||
);
|
||||
@@ -129,14 +131,24 @@ abstract class Controller extends BaseController
|
||||
try {
|
||||
$value = request()->query->get($integer);
|
||||
} catch (BadRequestException $e) {
|
||||
Log::error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $integer));
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error(sprintf('Request field "%s" contains a non-scalar value. Value set to NULL.', $integer));
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$value = null;
|
||||
}
|
||||
if (null !== $value) {
|
||||
$bag->set($integer, (int)$value);
|
||||
}
|
||||
if (null === $value &&
|
||||
'limit' === $integer && // @phpstan-ignore-line
|
||||
auth()->check()) {
|
||||
// set default for user:
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var Preference $pageSize */
|
||||
$pageSize = (int)app('preferences')->getForUser($user, 'listPageSize', 50)->data;
|
||||
$bag->set($integer, $pageSize);
|
||||
}
|
||||
}
|
||||
|
||||
// sort fields:
|
||||
@@ -154,9 +166,9 @@ abstract class Controller extends BaseController
|
||||
try {
|
||||
$param = (string)request()->query->get('sort');
|
||||
} catch (BadRequestException $e) {
|
||||
Log::error('Request field "sort" contains a non-scalar value. Value set to NULL.');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error('Request field "sort" contains a non-scalar value. Value set to NULL.');
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
$param = '';
|
||||
}
|
||||
if ('' === $param) {
|
||||
|
@@ -76,7 +76,7 @@ class TransactionController extends Controller
|
||||
// this deserves better code, but for now a loop of basic if-statements
|
||||
// to respond to what is in the $query.
|
||||
// this is OK because only one thing can be in the query at the moment.
|
||||
if ($this->updatesTransactionAccount($params)) {
|
||||
if ($this->isUpdateTransactionAccount($params)) {
|
||||
$original = $this->repository->find((int)$params['where']['account_id']);
|
||||
$destination = $this->repository->find((int)$params['update']['account_id']);
|
||||
|
||||
@@ -89,11 +89,11 @@ class TransactionController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @param array $params <array<string, array<string, int|string>>>
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function updatesTransactionAccount(array $params): bool
|
||||
private function isUpdateTransactionAccount(array $params): bool
|
||||
{
|
||||
return array_key_exists('account_id', $params['where']) && array_key_exists('account_id', $params['update']);
|
||||
}
|
||||
|
@@ -45,7 +45,6 @@ use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use FireflyIII\Services\Internal\Destroy\AccountDestroyService;
|
||||
use FireflyIII\Services\Internal\Destroy\JournalDestroyService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class DestroyController
|
||||
@@ -67,135 +66,34 @@ class DestroyController extends Controller
|
||||
{
|
||||
$objects = $request->getObjects();
|
||||
$this->unused = $request->boolean('unused', false);
|
||||
switch ($objects) {
|
||||
default:
|
||||
throw new FireflyException(sprintf('200033: This endpoint can\'t handle object "%s"', $objects));
|
||||
case 'budgets':
|
||||
$this->destroyBudgets();
|
||||
break;
|
||||
case 'bills':
|
||||
$this->destroyBills();
|
||||
break;
|
||||
case 'piggy_banks':
|
||||
$this->destroyPiggyBanks();
|
||||
break;
|
||||
case 'rules':
|
||||
$this->destroyRules();
|
||||
break;
|
||||
case 'recurring':
|
||||
$this->destroyRecurringTransactions();
|
||||
break;
|
||||
case 'categories':
|
||||
$this->destroyCategories();
|
||||
break;
|
||||
case 'tags':
|
||||
$this->destroyTags();
|
||||
break;
|
||||
case 'object_groups':
|
||||
$this->destroyObjectGroups();
|
||||
break;
|
||||
case 'not_assets_liabilities':
|
||||
$this->destroyAccounts(
|
||||
[
|
||||
AccountType::BENEFICIARY,
|
||||
AccountType::CASH,
|
||||
AccountType::CREDITCARD,
|
||||
AccountType::DEFAULT,
|
||||
AccountType::EXPENSE,
|
||||
AccountType::IMPORT,
|
||||
AccountType::INITIAL_BALANCE,
|
||||
AccountType::LIABILITY_CREDIT,
|
||||
AccountType::RECONCILIATION,
|
||||
AccountType::REVENUE,
|
||||
]
|
||||
);
|
||||
break;
|
||||
case 'accounts':
|
||||
$this->destroyAccounts(
|
||||
[
|
||||
AccountType::ASSET,
|
||||
AccountType::BENEFICIARY,
|
||||
AccountType::CASH,
|
||||
AccountType::CREDITCARD,
|
||||
AccountType::DEBT,
|
||||
AccountType::DEFAULT,
|
||||
AccountType::EXPENSE,
|
||||
AccountType::IMPORT,
|
||||
AccountType::INITIAL_BALANCE,
|
||||
AccountType::LIABILITY_CREDIT,
|
||||
AccountType::LOAN,
|
||||
AccountType::MORTGAGE,
|
||||
AccountType::RECONCILIATION,
|
||||
AccountType::REVENUE,
|
||||
]
|
||||
);
|
||||
break;
|
||||
case 'asset_accounts':
|
||||
$this->destroyAccounts(
|
||||
[
|
||||
AccountType::ASSET,
|
||||
AccountType::DEFAULT,
|
||||
]
|
||||
);
|
||||
break;
|
||||
case 'expense_accounts':
|
||||
$this->destroyAccounts(
|
||||
[
|
||||
AccountType::BENEFICIARY,
|
||||
AccountType::EXPENSE,
|
||||
]
|
||||
);
|
||||
break;
|
||||
case 'revenue_accounts':
|
||||
$this->destroyAccounts(
|
||||
[
|
||||
AccountType::REVENUE,
|
||||
]
|
||||
);
|
||||
break;
|
||||
case 'liabilities':
|
||||
$this->destroyAccounts(
|
||||
[
|
||||
AccountType::DEBT,
|
||||
AccountType::LOAN,
|
||||
AccountType::MORTGAGE,
|
||||
AccountType::CREDITCARD,
|
||||
]
|
||||
);
|
||||
break;
|
||||
case 'transactions':
|
||||
$this->destroyTransactions(
|
||||
[
|
||||
TransactionType::WITHDRAWAL,
|
||||
TransactionType::DEPOSIT,
|
||||
TransactionType::TRANSFER,
|
||||
TransactionType::RECONCILIATION,
|
||||
TransactionType::OPENING_BALANCE,
|
||||
]
|
||||
);
|
||||
break;
|
||||
case 'withdrawals':
|
||||
$this->destroyTransactions(
|
||||
[
|
||||
TransactionType::WITHDRAWAL,
|
||||
]
|
||||
);
|
||||
break;
|
||||
case 'deposits':
|
||||
$this->destroyTransactions(
|
||||
[
|
||||
TransactionType::DEPOSIT,
|
||||
]
|
||||
);
|
||||
break;
|
||||
case 'transfers':
|
||||
$this->destroyTransactions(
|
||||
[
|
||||
TransactionType::TRANSFER,
|
||||
]
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
$allExceptAssets = [AccountType::BENEFICIARY, AccountType::CASH, AccountType::CREDITCARD, AccountType::DEFAULT, AccountType::EXPENSE, AccountType::IMPORT, AccountType::INITIAL_BALANCE, AccountType::LIABILITY_CREDIT, AccountType::RECONCILIATION, AccountType::REVENUE,];
|
||||
$all = [AccountType::ASSET, AccountType::BENEFICIARY, AccountType::CASH, AccountType::CREDITCARD, AccountType::DEBT, AccountType::DEFAULT, AccountType::EXPENSE, AccountType::IMPORT, AccountType::INITIAL_BALANCE, AccountType::LIABILITY_CREDIT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::RECONCILIATION,];
|
||||
$liabilities = [AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::CREDITCARD];
|
||||
$transactions = [TransactionType::WITHDRAWAL, TransactionType::DEPOSIT, TransactionType::TRANSFER, TransactionType::RECONCILIATION, TransactionType::OPENING_BALANCE,];
|
||||
|
||||
match ($objects) {
|
||||
'budgets' => $this->destroyBudgets(),
|
||||
'bills' => $this->destroyBills(),
|
||||
'piggy_banks' => $this->destroyPiggyBanks(),
|
||||
'rules' => $this->destroyRules(),
|
||||
'recurring' => $this->destroyRecurringTransactions(),
|
||||
'categories' => $this->destroyCategories(),
|
||||
'tags' => $this->destroyTags(),
|
||||
'object_groups' => $this->destroyObjectGroups(),
|
||||
'not_assets_liabilities' => $this->destroyAccounts($allExceptAssets),
|
||||
'accounts' => $this->destroyAccounts($all),
|
||||
'asset_accounts' => $this->destroyAccounts([AccountType::ASSET, AccountType::DEFAULT]),
|
||||
'expense_accounts' => $this->destroyAccounts([AccountType::BENEFICIARY, AccountType::EXPENSE]),
|
||||
'revenue_accounts' => $this->destroyAccounts([AccountType::REVENUE]),
|
||||
'liabilities' => $this->destroyAccounts($liabilities),
|
||||
'transactions' => $this->destroyTransactions($transactions),
|
||||
'withdrawals' => $this->destroyTransactions([TransactionType::WITHDRAWAL]),
|
||||
'deposits' => $this->destroyTransactions([TransactionType::DEPOSIT]),
|
||||
'transfers' => $this->destroyTransactions([TransactionType::TRANSFER]),
|
||||
default => throw new FireflyException(sprintf('200033: This endpoint can\'t handle object "%s"', $objects)),
|
||||
};
|
||||
|
||||
app('preferences')->mark();
|
||||
|
||||
return response()->json([], 204);
|
||||
@@ -290,7 +188,7 @@ class DestroyController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $types
|
||||
* @param array $types <int, string>
|
||||
*/
|
||||
private function destroyAccounts(array $types): void
|
||||
{
|
||||
@@ -303,19 +201,19 @@ class DestroyController extends Controller
|
||||
foreach ($collection as $account) {
|
||||
$count = $account->transactions()->count();
|
||||
if (true === $this->unused && 0 === $count) {
|
||||
Log::info(sprintf('Deleted unused account #%d "%s"', $account->id, $account->name));
|
||||
app('log')->info(sprintf('Deleted unused account #%d "%s"', $account->id, $account->name));
|
||||
$service->destroy($account, null);
|
||||
continue;
|
||||
}
|
||||
if (false === $this->unused) {
|
||||
Log::info(sprintf('Deleting account #%d "%s"', $account->id, $account->name));
|
||||
app('log')->info(sprintf('Deleting account #%d "%s"', $account->id, $account->name));
|
||||
$service->destroy($account, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $types
|
||||
* @param array $types <int, string>
|
||||
*/
|
||||
private function destroyTransactions(array $types): void
|
||||
{
|
||||
|
@@ -62,7 +62,11 @@ class ExportController extends Controller
|
||||
* @param ExportRequest $request
|
||||
*
|
||||
* @return LaravelResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function accounts(ExportRequest $request): LaravelResponse
|
||||
{
|
||||
@@ -108,7 +112,10 @@ class ExportController extends Controller
|
||||
* @param ExportRequest $request
|
||||
*
|
||||
* @return LaravelResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function bills(ExportRequest $request): LaravelResponse
|
||||
{
|
||||
@@ -124,7 +131,10 @@ class ExportController extends Controller
|
||||
* @param ExportRequest $request
|
||||
*
|
||||
* @return LaravelResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function budgets(ExportRequest $request): LaravelResponse
|
||||
{
|
||||
@@ -140,7 +150,10 @@ class ExportController extends Controller
|
||||
* @param ExportRequest $request
|
||||
*
|
||||
* @return LaravelResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function categories(ExportRequest $request): LaravelResponse
|
||||
{
|
||||
@@ -156,7 +169,10 @@ class ExportController extends Controller
|
||||
* @param ExportRequest $request
|
||||
*
|
||||
* @return LaravelResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function piggyBanks(ExportRequest $request): LaravelResponse
|
||||
{
|
||||
@@ -172,7 +188,10 @@ class ExportController extends Controller
|
||||
* @param ExportRequest $request
|
||||
*
|
||||
* @return LaravelResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function recurring(ExportRequest $request): LaravelResponse
|
||||
{
|
||||
@@ -188,7 +207,10 @@ class ExportController extends Controller
|
||||
* @param ExportRequest $request
|
||||
*
|
||||
* @return LaravelResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function rules(ExportRequest $request): LaravelResponse
|
||||
{
|
||||
@@ -204,7 +226,10 @@ class ExportController extends Controller
|
||||
* @param ExportRequest $request
|
||||
*
|
||||
* @return LaravelResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function tags(ExportRequest $request): LaravelResponse
|
||||
{
|
||||
@@ -220,7 +245,9 @@ class ExportController extends Controller
|
||||
* @param ExportRequest $request
|
||||
*
|
||||
* @return LaravelResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function transactions(ExportRequest $request): LaravelResponse
|
||||
{
|
||||
|
@@ -35,6 +35,7 @@ use FireflyIII\Models\RuleGroup;
|
||||
use FireflyIII\Models\Tag;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
@@ -51,6 +52,7 @@ class PurgeController extends Controller
|
||||
*/
|
||||
public function purge(): JsonResponse
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
||||
// some manual code, too lazy to call all repositories.
|
||||
|
@@ -28,7 +28,6 @@ use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Account\OperationsRepositoryInterface;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Api\ApiSupport;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
@@ -43,7 +42,6 @@ class AccountController extends Controller
|
||||
{
|
||||
use ApiSupport;
|
||||
|
||||
private CurrencyRepositoryInterface $currencyRepository;
|
||||
private OperationsRepositoryInterface $opsRepository;
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
@@ -61,9 +59,6 @@ class AccountController extends Controller
|
||||
$this->repository = app(AccountRepositoryInterface::class);
|
||||
$this->repository->setUser($user);
|
||||
|
||||
$this->currencyRepository = app(CurrencyRepositoryInterface::class);
|
||||
$this->currencyRepository->setUser($user);
|
||||
|
||||
$this->opsRepository = app(OperationsRepositoryInterface::class);
|
||||
$this->opsRepository->setUser($user);
|
||||
|
||||
|
@@ -28,7 +28,6 @@ use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Account\OperationsRepositoryInterface;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Api\ApiSupport;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
@@ -43,7 +42,6 @@ class AccountController extends Controller
|
||||
{
|
||||
use ApiSupport;
|
||||
|
||||
private CurrencyRepositoryInterface $currencyRepository;
|
||||
private OperationsRepositoryInterface $opsRepository;
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
@@ -61,9 +59,6 @@ class AccountController extends Controller
|
||||
$this->repository = app(AccountRepositoryInterface::class);
|
||||
$this->repository->setUser($user);
|
||||
|
||||
$this->currencyRepository = app(CurrencyRepositoryInterface::class);
|
||||
$this->currencyRepository->setUser($user);
|
||||
|
||||
$this->opsRepository = app(OperationsRepositoryInterface::class);
|
||||
$this->opsRepository->setUser($user);
|
||||
|
||||
|
@@ -33,7 +33,7 @@ use Illuminate\Http\JsonResponse;
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
{
|
||||
public const RESOURCE_KEY = 'accounts';
|
||||
public const string RESOURCE_KEY = 'accounts';
|
||||
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
|
@@ -47,7 +47,7 @@ class ListController extends Controller
|
||||
{
|
||||
use TransactionFilter;
|
||||
|
||||
public const RESOURCE_KEY = 'accounts';
|
||||
public const string RESOURCE_KEY = 'accounts';
|
||||
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
@@ -81,7 +81,7 @@ class ListController extends Controller
|
||||
public function attachments(Account $account): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->repository->getAttachments($account);
|
||||
|
||||
$count = $collection->count();
|
||||
@@ -116,7 +116,7 @@ class ListController extends Controller
|
||||
$manager = $this->getManager();
|
||||
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of budgets. Count it and split it.
|
||||
$collection = $this->repository->getPiggyBanks($account);
|
||||
@@ -152,15 +152,9 @@ class ListController extends Controller
|
||||
*/
|
||||
public function transactions(Request $request, Account $account): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
|
||||
// user can overrule page size with limit parameter.
|
||||
$limit = $this->parameters->get('limit');
|
||||
if (null !== $limit && $limit > 0) {
|
||||
$pageSize = $limit;
|
||||
}
|
||||
$types = $this->mapTransactionTypes($this->parameters->get('type'));
|
||||
$manager = $this->getManager();
|
||||
/** @var User $admin */
|
||||
@@ -172,8 +166,11 @@ class ListController extends Controller
|
||||
$collector->setUser($admin)->setAccounts(new Collection([$account]))
|
||||
->withAPIInformation()->setLimit($pageSize)->setPage($this->parameters->get('page'))->setTypes($types);
|
||||
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
if (null !== $this->parameters->get('start')) {
|
||||
$collector->setStart($this->parameters->get('start'));
|
||||
}
|
||||
if (null !== $this->parameters->get('end')) {
|
||||
$collector->setEnd($this->parameters->get('end'));
|
||||
}
|
||||
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
|
@@ -43,7 +43,7 @@ class ShowController extends Controller
|
||||
{
|
||||
use AccountFilter;
|
||||
|
||||
public const RESOURCE_KEY = 'accounts';
|
||||
public const string RESOURCE_KEY = 'accounts';
|
||||
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
@@ -84,7 +84,7 @@ class ShowController extends Controller
|
||||
|
||||
// types to get, page size:
|
||||
$types = $this->mapAccountTypes($this->parameters->get('type'));
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of accounts. Count it and split it.
|
||||
$this->repository->resetAccountOrder();
|
||||
|
@@ -35,7 +35,7 @@ use League\Fractal\Resource\Item;
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
{
|
||||
public const RESOURCE_KEY = 'accounts';
|
||||
public const string RESOURCE_KEY = 'accounts';
|
||||
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
|
@@ -29,16 +29,14 @@ use FireflyIII\Models\Account;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Transformers\AccountTransformer;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use League\Fractal\Resource\Item;
|
||||
use Preferences;
|
||||
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
{
|
||||
public const RESOURCE_KEY = 'accounts';
|
||||
public const string RESOURCE_KEY = 'accounts';
|
||||
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
@@ -73,13 +71,13 @@ class UpdateController extends Controller
|
||||
*/
|
||||
public function update(UpdateRequest $request, Account $account): JsonResponse
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
app('log')->debug(sprintf('Now in %s', __METHOD__));
|
||||
$data = $request->getUpdateData();
|
||||
$data['type'] = config('firefly.shortNamesByFullName.' . $account->accountType->type);
|
||||
$account = $this->repository->update($account, $data);
|
||||
$manager = $this->getManager();
|
||||
$account->refresh();
|
||||
Preferences::mark();
|
||||
app('preferences')->mark();
|
||||
|
||||
/** @var AccountTransformer $transformer */
|
||||
$transformer = app(AccountTransformer::class);
|
||||
|
@@ -123,7 +123,7 @@ class ShowController extends Controller
|
||||
$manager = $this->getManager();
|
||||
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of attachments. Count it and split it.
|
||||
$collection = $this->repository->get();
|
||||
|
@@ -34,7 +34,6 @@ use FireflyIII\Transformers\AttachmentTransformer;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use League\Fractal\Resource\Item;
|
||||
|
||||
/**
|
||||
@@ -78,7 +77,7 @@ class StoreController extends Controller
|
||||
*/
|
||||
public function store(StoreRequest $request): JsonResponse
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
app('log')->debug(sprintf('Now in %s', __METHOD__));
|
||||
$data = $request->getAll();
|
||||
$attachment = $this->repository->store($data);
|
||||
$manager = $this->getManager();
|
||||
@@ -107,7 +106,7 @@ class StoreController extends Controller
|
||||
$helper = app(AttachmentHelperInterface::class);
|
||||
$body = $request->getContent();
|
||||
if ('' === $body) {
|
||||
Log::error('Body of attachment is empty.');
|
||||
app('log')->error('Body of attachment is empty.');
|
||||
|
||||
return response()->json([], 422);
|
||||
}
|
||||
|
@@ -76,7 +76,7 @@ class ShowController extends Controller
|
||||
$manager = $this->getManager();
|
||||
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
$start = $this->parameters->get('start');
|
||||
$end = $this->parameters->get('end');
|
||||
|
@@ -80,7 +80,7 @@ class ListController extends Controller
|
||||
public function attachments(Bill $bill): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->repository->getAttachments($bill);
|
||||
|
||||
$count = $collection->count();
|
||||
@@ -116,7 +116,7 @@ class ListController extends Controller
|
||||
$manager = $this->getManager();
|
||||
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of budgets. Count it and split it.
|
||||
$collection = $this->repository->getRulesForBill($bill);
|
||||
@@ -151,7 +151,7 @@ class ListController extends Controller
|
||||
*/
|
||||
public function transactions(Request $request, Bill $bill): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
|
||||
@@ -177,9 +177,11 @@ class ListController extends Controller
|
||||
// set types of transactions to return.
|
||||
->setTypes($types);
|
||||
|
||||
// do parameter stuff on new group collector.
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
if (null !== $this->parameters->get('start')) {
|
||||
$collector->setStart($this->parameters->get('start'));
|
||||
}
|
||||
if (null !== $this->parameters->get('end')) {
|
||||
$collector->setEnd($this->parameters->get('end'));
|
||||
}
|
||||
|
||||
// get paginator.
|
||||
|
@@ -73,7 +73,7 @@ class ShowController extends Controller
|
||||
$this->repository->correctOrder();
|
||||
$bills = $this->repository->getBills();
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$count = $bills->count();
|
||||
$bills = $bills->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
|
||||
$paginator = new LengthAwarePaginator($bills, $count, $pageSize, $this->parameters->get('page'));
|
||||
|
@@ -82,7 +82,7 @@ class ListController extends Controller
|
||||
public function attachments(Budget $budget): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->repository->getAttachments($budget);
|
||||
|
||||
$count = $collection->count();
|
||||
@@ -116,7 +116,7 @@ class ListController extends Controller
|
||||
public function budgetLimits(Budget $budget): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$this->parameters->set('budget_id', $budget->id);
|
||||
$collection = $this->blRepository->getBudgetLimits($budget, $this->parameters->get('start'), $this->parameters->get('end'));
|
||||
$count = $collection->count();
|
||||
@@ -148,13 +148,7 @@ class ListController extends Controller
|
||||
*/
|
||||
public function transactions(Request $request, Budget $budget): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
|
||||
// user can overrule page size with limit parameter.
|
||||
$limit = $this->parameters->get('limit');
|
||||
if (null !== $limit && $limit > 0) {
|
||||
$pageSize = $limit;
|
||||
}
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
@@ -181,8 +175,11 @@ class ListController extends Controller
|
||||
// set types of transactions to return.
|
||||
->setTypes($types);
|
||||
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
if (null !== $this->parameters->get('start')) {
|
||||
$collector->setStart($this->parameters->get('start'));
|
||||
}
|
||||
if (null !== $this->parameters->get('end')) {
|
||||
$collector->setEnd($this->parameters->get('end'));
|
||||
}
|
||||
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
@@ -211,13 +208,7 @@ class ListController extends Controller
|
||||
*/
|
||||
public function withoutBudget(Request $request): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
|
||||
// user can overrule page size with limit parameter.
|
||||
$limit = $this->parameters->get('limit');
|
||||
if (null !== $limit && $limit > 0) {
|
||||
$pageSize = $limit;
|
||||
}
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
@@ -244,8 +235,11 @@ class ListController extends Controller
|
||||
// set types of transactions to return.
|
||||
->setTypes($types);
|
||||
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
if (null !== $this->parameters->get('start')) {
|
||||
$collector->setStart($this->parameters->get('start'));
|
||||
}
|
||||
if (null !== $this->parameters->get('end')) {
|
||||
$collector->setEnd($this->parameters->get('end'));
|
||||
}
|
||||
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
|
@@ -77,7 +77,7 @@ class ShowController extends Controller
|
||||
$manager = $this->getManager();
|
||||
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of budgets. Count it and split it.
|
||||
$collection = $this->repository->getBudgets();
|
||||
|
@@ -28,7 +28,6 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Api\TransactionFilter;
|
||||
use FireflyIII\Transformers\TransactionGroupTransformer;
|
||||
use FireflyIII\User;
|
||||
@@ -44,28 +43,6 @@ class ListController extends Controller
|
||||
{
|
||||
use TransactionFilter;
|
||||
|
||||
private BudgetLimitRepositoryInterface $blRepository;
|
||||
|
||||
/**
|
||||
* BudgetLimitController constructor.
|
||||
*
|
||||
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->middleware(
|
||||
function ($request, $next) {
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
$this->blRepository = app(BudgetLimitRepositoryInterface::class);
|
||||
$this->blRepository->setUser($user);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* This endpoint is documented at:
|
||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionByBudgetLimit
|
||||
@@ -80,7 +57,7 @@ class ListController extends Controller
|
||||
*/
|
||||
public function transactions(Request $request, Budget $budget, BudgetLimit $budgetLimit): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
|
||||
|
@@ -75,17 +75,15 @@ class ShowController extends Controller
|
||||
*
|
||||
* Display a listing of the budget limits for this budget.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Budget $budget
|
||||
* @param Budget $budget
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function index(Request $request, Budget $budget): JsonResponse
|
||||
public function index(Budget $budget): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$manager->parseIncludes('budget');
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->blRepository->getBudgetLimits($budget, $this->parameters->get('start'), $this->parameters->get('end'));
|
||||
$count = $collection->count();
|
||||
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
|
||||
@@ -111,13 +109,13 @@ class ShowController extends Controller
|
||||
* @param SameDateRequest $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function indexAll(SameDateRequest $request): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$manager->parseIncludes('budget');
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->blRepository->getAllBudgetLimits($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
$count = $collection->count();
|
||||
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
|
||||
@@ -138,16 +136,15 @@ class ShowController extends Controller
|
||||
* This endpoint is documented at:
|
||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/getBudgetLimit
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Budget $budget
|
||||
* @param BudgetLimit $budgetLimit
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function show(Request $request, Budget $budget, BudgetLimit $budgetLimit): JsonResponse
|
||||
public function show(Budget $budget, BudgetLimit $budgetLimit): JsonResponse
|
||||
{
|
||||
if ((int)$budget->id !== (int)$budgetLimit->budget_id) {
|
||||
if ($budget->id !== $budgetLimit->budget_id) {
|
||||
throw new FireflyException('20028: The budget limit does not belong to the budget.');
|
||||
}
|
||||
// continue!
|
||||
|
@@ -78,7 +78,7 @@ class UpdateController extends Controller
|
||||
*/
|
||||
public function update(UpdateRequest $request, Budget $budget, BudgetLimit $budgetLimit): JsonResponse
|
||||
{
|
||||
if ((int)$budget->id !== (int)$budgetLimit->budget_id) {
|
||||
if ($budget->id !== $budgetLimit->budget_id) {
|
||||
throw new FireflyException('20028: The budget limit does not belong to the budget.');
|
||||
}
|
||||
$data = $request->getAll();
|
||||
|
@@ -77,7 +77,7 @@ class ListController extends Controller
|
||||
public function attachments(Category $category): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->repository->getAttachments($category);
|
||||
|
||||
$count = $collection->count();
|
||||
@@ -112,7 +112,7 @@ class ListController extends Controller
|
||||
*/
|
||||
public function transactions(Request $request, Category $category): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
|
||||
@@ -138,8 +138,11 @@ class ListController extends Controller
|
||||
// set types of transactions to return.
|
||||
->setTypes($types);
|
||||
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
if (null !== $this->parameters->get('start')) {
|
||||
$collector->setStart($this->parameters->get('start'));
|
||||
}
|
||||
if (null !== $this->parameters->get('end')) {
|
||||
$collector->setEnd($this->parameters->get('end'));
|
||||
}
|
||||
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
|
@@ -73,7 +73,7 @@ class ShowController extends Controller
|
||||
$manager = $this->getManager();
|
||||
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of budgets. Count it and split it.
|
||||
$collection = $this->repository->getCategories();
|
||||
|
@@ -77,7 +77,7 @@ class ListController extends Controller
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
// get list of piggy banks. Count it and split it.
|
||||
$collection = $this->repository->getBills($objectGroup);
|
||||
$count = $collection->count();
|
||||
@@ -114,7 +114,7 @@ class ListController extends Controller
|
||||
$manager = $this->getManager();
|
||||
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of piggy banks. Count it and split it.
|
||||
$collection = $this->repository->getPiggyBanks($objectGroup);
|
||||
|
@@ -69,17 +69,14 @@ class ShowController extends Controller
|
||||
*
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
$this->repository->resetOrder();
|
||||
$collection = $this->repository->get();
|
||||
|
@@ -71,7 +71,7 @@ class ListController extends Controller
|
||||
public function attachments(PiggyBank $piggyBank): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->repository->getAttachments($piggyBank);
|
||||
|
||||
$count = $collection->count();
|
||||
@@ -105,7 +105,7 @@ class ListController extends Controller
|
||||
public function piggyBankEvents(PiggyBank $piggyBank): JsonResponse
|
||||
{
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$manager = $this->getManager();
|
||||
|
||||
$collection = $this->repository->getEvents($piggyBank);
|
||||
|
@@ -72,7 +72,7 @@ class ShowController extends Controller
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of budgets. Count it and split it.
|
||||
$collection = $this->repository->getPiggyBanks();
|
||||
|
@@ -77,7 +77,7 @@ class ListController extends Controller
|
||||
*/
|
||||
public function transactions(Request $request, Recurrence $recurrence): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
|
||||
@@ -105,9 +105,13 @@ class ListController extends Controller
|
||||
// set types of transactions to return.
|
||||
->setTypes($types);
|
||||
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
if (null !== $this->parameters->get('start')) {
|
||||
$collector->setStart($this->parameters->get('start'));
|
||||
}
|
||||
if (null !== $this->parameters->get('end')) {
|
||||
$collector->setEnd($this->parameters->get('end'));
|
||||
}
|
||||
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
$paginator->setPath(route('api.v1.transactions.index') . $this->buildParams());
|
||||
$transactions = $paginator->getCollection();
|
||||
|
@@ -73,7 +73,7 @@ class ShowController extends Controller
|
||||
$manager = $this->getManager();
|
||||
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of budgets. Count it and split it.
|
||||
$collection = $this->repository->get();
|
||||
|
@@ -77,7 +77,7 @@ class ShowController extends Controller
|
||||
$manager = $this->getManager();
|
||||
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of budgets. Count it and split it.
|
||||
$collection = $this->ruleRepository->getAll();
|
||||
|
@@ -75,7 +75,7 @@ class ListController extends Controller
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of budgets. Count it and split it.
|
||||
$collection = $this->ruleGroupRepository->getRules($group);
|
||||
|
@@ -75,7 +75,7 @@ class ShowController extends Controller
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of rule groups. Count it and split it.
|
||||
$collection = $this->ruleGroupRepository->get();
|
||||
|
@@ -80,7 +80,7 @@ class ListController extends Controller
|
||||
public function attachments(Tag $tag): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->repository->getAttachments($tag);
|
||||
|
||||
$count = $collection->count();
|
||||
@@ -114,7 +114,7 @@ class ListController extends Controller
|
||||
*/
|
||||
public function transactions(Request $request, Tag $tag): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
|
||||
@@ -139,8 +139,11 @@ class ListController extends Controller
|
||||
// set types of transactions to return.
|
||||
->setTypes($types);
|
||||
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
if (null !== $this->parameters->get('start')) {
|
||||
$collector->setStart($this->parameters->get('start'));
|
||||
}
|
||||
if (null !== $this->parameters->get('end')) {
|
||||
$collector->setEnd($this->parameters->get('end'));
|
||||
}
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
$paginator->setPath(route('api.v1.tags.transactions', [$tag->id]) . $this->buildParams());
|
||||
|
@@ -76,7 +76,7 @@ class ShowController extends Controller
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of budgets. Count it and split it.
|
||||
$collection = $this->repository->get();
|
||||
|
@@ -33,7 +33,6 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepository;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class DestroyController
|
||||
@@ -79,7 +78,7 @@ class DestroyController extends Controller
|
||||
*/
|
||||
public function destroy(TransactionGroup $transactionGroup): JsonResponse
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
app('log')->debug(sprintf('Now in %s', __METHOD__));
|
||||
// grab asset account(s) from group:
|
||||
$accounts = [];
|
||||
/** @var TransactionJournal $journal */
|
||||
@@ -100,7 +99,7 @@ class DestroyController extends Controller
|
||||
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
Log::debug(sprintf('Now going to trigger updated account event for account #%d', $account->id));
|
||||
app('log')->debug(sprintf('Now going to trigger updated account event for account #%d', $account->id));
|
||||
event(new UpdatedAccount($account));
|
||||
}
|
||||
|
||||
|
@@ -78,7 +78,7 @@ class ListController extends Controller
|
||||
public function attachments(TransactionGroup $transactionGroup): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = new Collection();
|
||||
foreach ($transactionGroup->transactionJournals as $transactionJournal) {
|
||||
$collection = $this->journalAPIRepository->getAttachments($transactionJournal)->merge($collection);
|
||||
@@ -114,7 +114,7 @@ class ListController extends Controller
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$collection = new Collection();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
foreach ($transactionGroup->transactionJournals as $transactionJournal) {
|
||||
$collection = $this->journalAPIRepository->getPiggyBankEvents($transactionJournal)->merge($collection);
|
||||
}
|
||||
@@ -152,7 +152,7 @@ class ListController extends Controller
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$collection = $this->journalAPIRepository->getJournalLinks($transactionJournal);
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$count = $collection->count();
|
||||
$journalLinks = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
|
||||
|
||||
|
@@ -58,7 +58,7 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
|
||||
@@ -80,7 +80,7 @@ class ShowController extends Controller
|
||||
->setPage($this->parameters->get('page'))
|
||||
// set types of transactions to return.
|
||||
->setTypes($types);
|
||||
if (null !== $this->parameters->get('start') && 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'));
|
||||
}
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
|
@@ -83,7 +83,7 @@ class StoreController extends Controller
|
||||
*/
|
||||
public function store(StoreRequest $request): JsonResponse
|
||||
{
|
||||
Log::debug('Now in API StoreController::store()');
|
||||
app('log')->debug('Now in API StoreController::store()');
|
||||
$data = $request->getAll();
|
||||
$data['user'] = auth()->user()->id;
|
||||
|
||||
@@ -92,19 +92,19 @@ class StoreController extends Controller
|
||||
|
||||
try {
|
||||
$transactionGroup = $this->groupRepository->store($data);
|
||||
} catch (DuplicateTransactionException $e) {
|
||||
} catch (DuplicateTransactionException $e) { // @phpstan-ignore-line
|
||||
app('log')->warning('Caught a duplicate transaction. Return error message.');
|
||||
$validator = Validator::make(
|
||||
['transactions' => [['description' => $e->getMessage()]]],
|
||||
['transactions.0.description' => new IsDuplicateTransaction()]
|
||||
);
|
||||
throw new ValidationException($validator, 0, $e);
|
||||
} catch (FireflyException $e) {
|
||||
throw new ValidationException($validator); // @phpstan-ignore-line
|
||||
} catch (FireflyException $e) { // @phpstan-ignore-line
|
||||
app('log')->warning('Caught an exception. Return error message.');
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
$message = sprintf('Internal exception: %s', $e->getMessage());
|
||||
$validator = Validator::make(['transactions' => [['description' => $message]]], ['transactions.0.description' => new IsDuplicateTransaction()]);
|
||||
throw new ValidationException($validator, 0, $e);
|
||||
throw new ValidationException($validator); // @phpstan-ignore-line
|
||||
}
|
||||
app('preferences')->mark();
|
||||
$applyRules = $data['apply_rules'] ?? true;
|
||||
|
@@ -32,7 +32,6 @@ use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface
|
||||
use FireflyIII\Transformers\TransactionGroupTransformer;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use League\Fractal\Resource\Item;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
@@ -77,7 +76,7 @@ class UpdateController extends Controller
|
||||
*/
|
||||
public function update(UpdateRequest $request, TransactionGroup $transactionGroup): JsonResponse
|
||||
{
|
||||
Log::debug('Now in update routine for transaction group!');
|
||||
app('log')->debug('Now in update routine for transaction group!');
|
||||
$data = $request->getAll();
|
||||
|
||||
$transactionGroup = $this->groupRepository->update($transactionGroup, $data);
|
||||
|
@@ -27,8 +27,8 @@ namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\Repositories\UserGroups\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Validator;
|
||||
|
@@ -38,7 +38,6 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
|
||||
use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Api\AccountFilter;
|
||||
@@ -65,26 +64,6 @@ class ListController extends Controller
|
||||
use AccountFilter;
|
||||
use TransactionFilter;
|
||||
|
||||
private CurrencyRepositoryInterface $repository;
|
||||
|
||||
/**
|
||||
* CurrencyRepository constructor.
|
||||
*
|
||||
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->middleware(
|
||||
function ($request, $next) {
|
||||
$this->repository = app(CurrencyRepositoryInterface::class);
|
||||
$this->repository->setUser(auth()->user());
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* This endpoint is documented at:
|
||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/currencies/listAccountByCurrency
|
||||
@@ -106,7 +85,7 @@ class ListController extends Controller
|
||||
|
||||
// types to get, page size:
|
||||
$types = $this->mapAccountTypes($this->parameters->get('type'));
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of accounts. Count it and split it.
|
||||
/** @var AccountRepositoryInterface $accountRepository */
|
||||
@@ -153,7 +132,7 @@ class ListController extends Controller
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of available budgets. Count it and split it.
|
||||
/** @var AvailableBudgetRepositoryInterface $abRepository */
|
||||
@@ -193,7 +172,7 @@ class ListController extends Controller
|
||||
|
||||
/** @var BillRepositoryInterface $billRepos */
|
||||
$billRepos = app(BillRepositoryInterface::class);
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$unfiltered = $billRepos->getBills();
|
||||
|
||||
// filter and paginate list:
|
||||
@@ -236,7 +215,7 @@ class ListController extends Controller
|
||||
$blRepository = app(BudgetLimitRepositoryInterface::class);
|
||||
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $blRepository->getAllBudgetLimitsByCurrency($currency, $this->parameters->get('start'), $this->parameters->get('end'));
|
||||
$count = $collection->count();
|
||||
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
|
||||
@@ -268,7 +247,7 @@ class ListController extends Controller
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of budgets. Count it and split it.
|
||||
/** @var RecurringRepositoryInterface $recurringRepos */
|
||||
@@ -276,8 +255,8 @@ class ListController extends Controller
|
||||
$unfiltered = $recurringRepos->getAll();
|
||||
|
||||
// filter selection
|
||||
$collection = $unfiltered->filter(
|
||||
static function (Recurrence $recurrence) use ($currency) {
|
||||
$collection = $unfiltered->filter(/** @phpstan-ignore-line */
|
||||
static function (Recurrence $recurrence) use ($currency) { // @phpstan-ignore-line
|
||||
/** @var RecurrenceTransaction $transaction */
|
||||
foreach ($recurrence->recurrenceTransactions as $transaction) {
|
||||
if ($transaction->transaction_currency_id === $currency->id || $transaction->foreign_currency_id === $currency->id) {
|
||||
@@ -319,15 +298,15 @@ class ListController extends Controller
|
||||
public function rules(TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of budgets. Count it and split it.
|
||||
/** @var RuleRepositoryInterface $ruleRepos */
|
||||
$ruleRepos = app(RuleRepositoryInterface::class);
|
||||
$unfiltered = $ruleRepos->getAll();
|
||||
|
||||
$collection = $unfiltered->filter(
|
||||
static function (Rule $rule) use ($currency) {
|
||||
$collection = $unfiltered->filter(/** @phpstan-ignore-line */
|
||||
static function (Rule $rule) use ($currency) { // @phpstan-ignore-line
|
||||
/** @var RuleTrigger $trigger */
|
||||
foreach ($rule->ruleTriggers as $trigger) {
|
||||
if ('currency_is' === $trigger->trigger_type && $currency->name === $trigger->trigger_value) {
|
||||
@@ -371,7 +350,7 @@ class ListController extends Controller
|
||||
*/
|
||||
public function transactions(Request $request, TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
|
||||
@@ -396,8 +375,11 @@ class ListController extends Controller
|
||||
->setPage($this->parameters->get('page'))
|
||||
// set types of transactions to return.
|
||||
->setTypes($types);
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
if (null !== $this->parameters->get('start')) {
|
||||
$collector->setStart($this->parameters->get('start'));
|
||||
}
|
||||
if (null !== $this->parameters->get('end')) {
|
||||
$collector->setEnd($this->parameters->get('end'));
|
||||
}
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
$paginator->setPath(route('api.v1.currencies.transactions', [$currency->code]) . $this->buildParams());
|
||||
|
@@ -27,10 +27,11 @@ namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\UserGroups\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Api\AccountFilter;
|
||||
use FireflyIII\Support\Http\Api\TransactionFilter;
|
||||
use FireflyIII\Transformers\CurrencyTransformer;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use JsonException;
|
||||
@@ -78,16 +79,15 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->repository->getAll();
|
||||
$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 = $this->getManager();
|
||||
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$this->parameters->set('defaultCurrency', $defaultCurrency);
|
||||
$manager = $this->getManager();
|
||||
|
||||
/** @var CurrencyTransformer $transformer */
|
||||
$transformer = app(CurrencyTransformer::class);
|
||||
@@ -113,10 +113,15 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function show(TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
$manager = $this->getManager();
|
||||
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$defaultCurrency = app('amount')->getDefaultCurrencyByUserGroup($user->userGroup);
|
||||
$this->parameters->set('defaultCurrency', $defaultCurrency);
|
||||
|
||||
// update fields with user info.
|
||||
$currency->refreshForUser($user);
|
||||
|
||||
/** @var CurrencyTransformer $transformer */
|
||||
$transformer = app(CurrencyTransformer::class);
|
||||
$transformer->setParameters($this->parameters);
|
||||
@@ -138,9 +143,13 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function showDefault(): JsonResponse
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
$manager = $this->getManager();
|
||||
$currency = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$this->parameters->set('defaultCurrency', $currency);
|
||||
$currency = app('amount')->getDefaultCurrencyByUserGroup($user->userGroup);
|
||||
|
||||
// update fields with user info.
|
||||
$currency->refreshForUser($user);
|
||||
|
||||
/** @var CurrencyTransformer $transformer */
|
||||
$transformer = app(CurrencyTransformer::class);
|
||||
|
@@ -27,10 +27,11 @@ namespace FireflyIII\Api\V1\Controllers\Models\TransactionCurrency;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\Models\TransactionCurrency\StoreRequest;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\UserGroups\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Api\AccountFilter;
|
||||
use FireflyIII\Support\Http\Api\TransactionFilter;
|
||||
use FireflyIII\Transformers\CurrencyTransformer;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use JsonException;
|
||||
use League\Fractal\Resource\Item;
|
||||
@@ -79,12 +80,14 @@ class StoreController extends Controller
|
||||
{
|
||||
$currency = $this->repository->store($request->getAll());
|
||||
if (true === $request->boolean('default')) {
|
||||
app('preferences')->set('currencyPreference', $currency->code);
|
||||
$this->repository->makeDefault($currency);
|
||||
app('preferences')->mark();
|
||||
}
|
||||
$manager = $this->getManager();
|
||||
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$this->parameters->set('defaultCurrency', $defaultCurrency);
|
||||
$manager = $this->getManager();
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
$currency->refreshForUser($user);
|
||||
|
||||
/** @var CurrencyTransformer $transformer */
|
||||
$transformer = app(CurrencyTransformer::class);
|
||||
|
@@ -28,10 +28,11 @@ use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\Models\TransactionCurrency\UpdateRequest;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\UserGroups\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Api\AccountFilter;
|
||||
use FireflyIII\Support\Http\Api\TransactionFilter;
|
||||
use FireflyIII\Transformers\CurrencyTransformer;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use JsonException;
|
||||
use League\Fractal\Resource\Item;
|
||||
@@ -82,11 +83,16 @@ class UpdateController extends Controller
|
||||
if ($this->repository->currencyInUse($currency)) {
|
||||
return response()->json([], 409);
|
||||
}
|
||||
// must not be the only one in use:
|
||||
if (1 === $this->repository->get()->count()) {
|
||||
return response()->json([], 409);
|
||||
}
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
$this->repository->disable($currency);
|
||||
$manager = $this->getManager();
|
||||
|
||||
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$this->parameters->set('defaultCurrency', $defaultCurrency);
|
||||
$currency->refreshForUser($user);
|
||||
|
||||
/** @var CurrencyTransformer $transformer */
|
||||
$transformer = app(CurrencyTransformer::class);
|
||||
@@ -110,14 +116,15 @@ class UpdateController extends Controller
|
||||
*/
|
||||
public function makeDefault(TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
$this->repository->enable($currency);
|
||||
$this->repository->makeDefault($currency);
|
||||
|
||||
app('preferences')->set('currencyPreference', $currency->code);
|
||||
app('preferences')->mark();
|
||||
|
||||
$manager = $this->getManager();
|
||||
|
||||
$this->parameters->set('defaultCurrency', $currency);
|
||||
$currency->refreshForUser($user);
|
||||
|
||||
/** @var CurrencyTransformer $transformer */
|
||||
$transformer = app(CurrencyTransformer::class);
|
||||
@@ -144,9 +151,10 @@ class UpdateController extends Controller
|
||||
{
|
||||
$this->repository->enable($currency);
|
||||
$manager = $this->getManager();
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
||||
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$this->parameters->set('defaultCurrency', $defaultCurrency);
|
||||
$currency->refreshForUser($user);
|
||||
|
||||
/** @var CurrencyTransformer $transformer */
|
||||
$transformer = app(CurrencyTransformer::class);
|
||||
@@ -172,18 +180,23 @@ class UpdateController extends Controller
|
||||
*/
|
||||
public function update(UpdateRequest $request, TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
$data = $request->getAll();
|
||||
$data = $request->getAll();
|
||||
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
||||
// safety catch on currency disablement.
|
||||
$set = $this->repository->get();
|
||||
if (array_key_exists('enabled', $data) && false === $data['enabled'] && 1 === count($set) && $set->first()->id === $currency->id) {
|
||||
return response()->json([], 409);
|
||||
|
||||
}
|
||||
$currency = $this->repository->update($currency, $data);
|
||||
|
||||
if (true === $request->boolean('default')) {
|
||||
app('preferences')->set('currencyPreference', $currency->code);
|
||||
app('preferences')->mark();
|
||||
}
|
||||
app('preferences')->mark();
|
||||
|
||||
$manager = $this->getManager();
|
||||
|
||||
$defaultCurrency = app('amount')->getDefaultCurrencyByUser(auth()->user());
|
||||
$this->parameters->set('defaultCurrency', $defaultCurrency);
|
||||
$currency->refreshForUser($user);
|
||||
|
||||
/** @var CurrencyTransformer $transformer */
|
||||
$transformer = app(CurrencyTransformer::class);
|
||||
|
@@ -85,7 +85,7 @@ class ShowController extends Controller
|
||||
$name = $request->get('name');
|
||||
|
||||
// types to get, page size:
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$linkType = $this->repository->findByName($name);
|
||||
|
||||
// get list of transaction links. Count it and split it.
|
||||
|
@@ -78,7 +78,7 @@ class ListController extends Controller
|
||||
*/
|
||||
public function transactions(Request $request, LinkType $linkType): JsonResponse
|
||||
{
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$type = $request->get('type') ?? 'default';
|
||||
$this->parameters->set('type', $type);
|
||||
|
||||
@@ -106,8 +106,11 @@ class ListController extends Controller
|
||||
->setPage($this->parameters->get('page'))
|
||||
// set types of transactions to return.
|
||||
->setTypes($types);
|
||||
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
if (null !== $this->parameters->get('start')) {
|
||||
$collector->setStart($this->parameters->get('start'));
|
||||
}
|
||||
if (null !== $this->parameters->get('end')) {
|
||||
$collector->setEnd($this->parameters->get('end'));
|
||||
}
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
$paginator->setPath(route('api.v1.transactions.index') . $this->buildParams());
|
||||
|
@@ -78,7 +78,7 @@ class ShowController extends Controller
|
||||
{
|
||||
// create some objects:
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
|
||||
// get list of accounts. Count it and split it.
|
||||
$collection = $this->repository->get();
|
||||
|
@@ -32,7 +32,6 @@ use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
|
||||
@@ -67,7 +66,7 @@ class AccountController extends Controller
|
||||
*/
|
||||
public function search(Request $request): JsonResponse | Response
|
||||
{
|
||||
Log::debug('Now in account search()');
|
||||
app('log')->debug('Now in account search()');
|
||||
$manager = $this->getManager();
|
||||
$query = trim((string)$request->get('query'));
|
||||
$field = trim((string)$request->get('field'));
|
||||
|
@@ -53,8 +53,7 @@ class TransactionController extends Controller
|
||||
$manager = $this->getManager();
|
||||
$fullQuery = (string)$request->get('query');
|
||||
$page = 0 === (int)$request->get('page') ? 1 : (int)$request->get('page');
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = 0 === (int)$request->get('limit') ? $pageSize : (int)$request->get('limit');
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$searcher->parseQuery($fullQuery);
|
||||
$searcher->setPage($page);
|
||||
$searcher->setLimit($pageSize);
|
||||
|
@@ -32,14 +32,13 @@ use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Helpers\Report\NetWorthInterface;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\OperationsRepositoryInterface;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Repositories\UserGroups\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
@@ -107,8 +106,8 @@ class BasicController extends Controller
|
||||
$balanceData = $this->getBalanceInformation($start, $end);
|
||||
$billData = $this->getBillInformation($start, $end);
|
||||
$spentData = $this->getLeftToSpendInfo($start, $end);
|
||||
$networthData = $this->getNetWorthInfo($start, $end);
|
||||
$total = array_merge($balanceData, $billData, $spentData, $networthData);
|
||||
$netWorthData = $this->getNetWorthInfo($start, $end);
|
||||
$total = array_merge($balanceData, $billData, $spentData, $netWorthData);
|
||||
|
||||
// give new keys
|
||||
$return = [];
|
||||
@@ -190,7 +189,7 @@ class BasicController extends Controller
|
||||
'key' => sprintf('balance-in-%s', $currency->code),
|
||||
'title' => trans('firefly.box_balance_in_currency', ['currency' => $currency->symbol]),
|
||||
'monetary_value' => $sums[$currencyId] ?? '0',
|
||||
'currency_id' => $currency->id,
|
||||
'currency_id' => (string)$currency->id,
|
||||
'currency_code' => $currency->code,
|
||||
'currency_symbol' => $currency->symbol,
|
||||
'currency_decimal_places' => $currency->decimal_places,
|
||||
@@ -203,7 +202,7 @@ class BasicController extends Controller
|
||||
'key' => sprintf('spent-in-%s', $currency->code),
|
||||
'title' => trans('firefly.box_spent_in_currency', ['currency' => $currency->symbol]),
|
||||
'monetary_value' => $expenses[$currencyId] ?? '0',
|
||||
'currency_id' => $currency->id,
|
||||
'currency_id' => (string)$currency->id,
|
||||
'currency_code' => $currency->code,
|
||||
'currency_symbol' => $currency->symbol,
|
||||
'currency_decimal_places' => $currency->decimal_places,
|
||||
@@ -215,7 +214,7 @@ class BasicController extends Controller
|
||||
'key' => sprintf('earned-in-%s', $currency->code),
|
||||
'title' => trans('firefly.box_earned_in_currency', ['currency' => $currency->symbol]),
|
||||
'monetary_value' => $incomes[$currencyId] ?? '0',
|
||||
'currency_id' => $currency->id,
|
||||
'currency_id' => (string)$currency->id,
|
||||
'currency_code' => $currency->code,
|
||||
'currency_symbol' => $currency->symbol,
|
||||
'currency_decimal_places' => $currency->decimal_places,
|
||||
@@ -236,6 +235,7 @@ class BasicController extends Controller
|
||||
*/
|
||||
private function getBillInformation(Carbon $start, Carbon $end): array
|
||||
{
|
||||
app('log')->debug(sprintf('Now in getBillInformation("%s", "%s")', $start->format('Y-m-d'), $end->format('Y-m-d-')));
|
||||
/*
|
||||
* Since both this method and the chart use the exact same data, we can suffice
|
||||
* with calling the one method in the bill repository that will get this amount.
|
||||
@@ -253,7 +253,7 @@ class BasicController extends Controller
|
||||
'key' => sprintf('bills-paid-in-%s', $info['code']),
|
||||
'title' => trans('firefly.box_bill_paid_in_currency', ['currency' => $info['symbol']]),
|
||||
'monetary_value' => $amount,
|
||||
'currency_id' => $info['id'],
|
||||
'currency_id' => (string)$info['id'],
|
||||
'currency_code' => $info['code'],
|
||||
'currency_symbol' => $info['symbol'],
|
||||
'currency_decimal_places' => $info['decimal_places'],
|
||||
@@ -272,7 +272,7 @@ class BasicController extends Controller
|
||||
'key' => sprintf('bills-unpaid-in-%s', $info['code']),
|
||||
'title' => trans('firefly.box_bill_unpaid_in_currency', ['currency' => $info['symbol']]),
|
||||
'monetary_value' => $amount,
|
||||
'currency_id' => $info['id'],
|
||||
'currency_id' => (string)$info['id'],
|
||||
'currency_code' => $info['code'],
|
||||
'currency_symbol' => $info['symbol'],
|
||||
'currency_decimal_places' => $info['decimal_places'],
|
||||
@@ -281,7 +281,7 @@ class BasicController extends Controller
|
||||
'sub_title' => '',
|
||||
];
|
||||
}
|
||||
|
||||
app('log')->debug(sprintf('Done with getBillInformation("%s", "%s")', $start->format('Y-m-d'), $end->format('Y-m-d-')));
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ class BasicController extends Controller
|
||||
|
||||
foreach ($spent as $row) {
|
||||
// either an amount was budgeted or 0 is available.
|
||||
$amount = $available[$row['currency_id']] ?? '0';
|
||||
$amount = (string)($available[$row['currency_id']] ?? '0');
|
||||
$spentInCurrency = $row['sum'];
|
||||
$leftToSpend = bcadd($amount, $spentInCurrency);
|
||||
|
||||
@@ -316,7 +316,7 @@ class BasicController extends Controller
|
||||
'key' => sprintf('left-to-spend-in-%s', $row['currency_code']),
|
||||
'title' => trans('firefly.box_left_to_spend_in_currency', ['currency' => $row['currency_symbol']]),
|
||||
'monetary_value' => $leftToSpend,
|
||||
'currency_id' => $row['currency_id'],
|
||||
'currency_id' => (string)$row['currency_id'],
|
||||
'currency_code' => $row['currency_code'],
|
||||
'currency_symbol' => $row['currency_symbol'],
|
||||
'currency_decimal_places' => $row['currency_decimal_places'],
|
||||
@@ -367,30 +367,30 @@ class BasicController extends Controller
|
||||
}
|
||||
);
|
||||
|
||||
$netWorthSet = $netWorthHelper->getNetWorthByCurrency($filtered, $date);
|
||||
$netWorthSet = $netWorthHelper->byAccounts($filtered, $date);
|
||||
$return = [];
|
||||
foreach ($netWorthSet as $data) {
|
||||
/** @var TransactionCurrency $currency */
|
||||
$currency = $data['currency'];
|
||||
$amount = $data['balance'];
|
||||
foreach ($netWorthSet as $key => $data) {
|
||||
if ('native' === $key) {
|
||||
continue;
|
||||
}
|
||||
$amount = $data['balance'];
|
||||
if (0 === bccomp($amount, '0')) {
|
||||
continue;
|
||||
}
|
||||
// return stuff
|
||||
$return[] = [
|
||||
'key' => sprintf('net-worth-in-%s', $currency->code),
|
||||
'title' => trans('firefly.box_net_worth_in_currency', ['currency' => $currency->symbol]),
|
||||
'key' => sprintf('net-worth-in-%s', $data['currency_code']),
|
||||
'title' => trans('firefly.box_net_worth_in_currency', ['currency' => $data['currency_symbol']]),
|
||||
'monetary_value' => $amount,
|
||||
'currency_id' => $currency->id,
|
||||
'currency_code' => $currency->code,
|
||||
'currency_symbol' => $currency->symbol,
|
||||
'currency_decimal_places' => $currency->decimal_places,
|
||||
'value_parsed' => app('amount')->formatAnything($currency, $data['balance'], false),
|
||||
'currency_id' => (string)$data['currency_id'],
|
||||
'currency_code' => $data['currency_code'],
|
||||
'currency_symbol' => $data['currency_symbol'],
|
||||
'currency_decimal_places' => $data['currency_decimal_places'],
|
||||
'value_parsed' => app('amount')->formatFlat($data['currency_symbol'], $data['currency_decimal_places'], $data['balance'], false),
|
||||
'local_icon' => 'line-chart',
|
||||
'sub_title' => '',
|
||||
];
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@@ -29,7 +29,6 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\Support\Binder\EitherConfigKey;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Validator;
|
||||
@@ -70,8 +69,8 @@ class ConfigurationController extends Controller
|
||||
try {
|
||||
$dynamicData = $this->getDynamicConfiguration();
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
throw new FireflyException('200030: Could not load config variables.', 0, $e);
|
||||
}
|
||||
$staticData = $this->getStaticConfiguration();
|
||||
|
@@ -27,7 +27,6 @@ use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\System\CronRequest;
|
||||
use FireflyIII\Support\Http\Controllers\CronRunner;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
@@ -43,18 +42,17 @@ class CronController extends Controller
|
||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/about/getCron
|
||||
*
|
||||
* @param CronRequest $request
|
||||
* @param string $token
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function cron(CronRequest $request, string $token): JsonResponse
|
||||
public function cron(CronRequest $request): JsonResponse
|
||||
{
|
||||
$config = $request->getAll();
|
||||
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
Log::debug(sprintf('Date is %s', $config['date']->toIsoString()));
|
||||
app('log')->debug(sprintf('Now in %s', __METHOD__));
|
||||
app('log')->debug(sprintf('Date is %s', $config['date']->toIsoString()));
|
||||
$return = [];
|
||||
$return['recurring_transactions'] = $this->runRecurring($config['force'], $config['date']);
|
||||
$return['auto_budgets'] = $this->runAutoBudget($config['force'], $config['date']);
|
||||
|
@@ -33,7 +33,6 @@ use FireflyIII\Transformers\UserTransformer;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use League\Fractal\Resource\Item;
|
||||
@@ -101,7 +100,7 @@ class UserController extends Controller
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
// user preferences
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$manager = $this->getManager();
|
||||
|
||||
// build collection
|
||||
@@ -192,7 +191,7 @@ class UserController extends Controller
|
||||
|
||||
// can only update 'blocked' when user is admin.
|
||||
if (!$this->repository->hasRole(auth()->user(), 'owner')) {
|
||||
Log::debug('Quietly drop fields "blocked" and "blocked_code" from request.');
|
||||
app('log')->debug('Quietly drop fields "blocked" and "blocked_code" from request.');
|
||||
unset($data['blocked'], $data['blocked_code']);
|
||||
}
|
||||
|
||||
|
@@ -41,8 +41,8 @@ use League\Fractal\Resource\Item;
|
||||
*/
|
||||
class PreferencesController extends Controller
|
||||
{
|
||||
public const DATE_FORMAT = 'Y-m-d';
|
||||
public const RESOURCE_KEY = 'preferences';
|
||||
public const string DATE_FORMAT = 'Y-m-d';
|
||||
public const string RESOURCE_KEY = 'preferences';
|
||||
|
||||
/**
|
||||
* This endpoint is documented at:
|
||||
@@ -58,7 +58,7 @@ class PreferencesController extends Controller
|
||||
$collection = app('preferences')->all();
|
||||
$manager = $this->getManager();
|
||||
$count = $collection->count();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$preferences = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
|
||||
|
||||
// make paginator:
|
||||
|
@@ -41,7 +41,7 @@ use League\Fractal\Resource\Item;
|
||||
*/
|
||||
class AttemptController extends Controller
|
||||
{
|
||||
public const RESOURCE_KEY = 'webhook_attempts';
|
||||
public const string RESOURCE_KEY = 'webhook_attempts';
|
||||
private WebhookRepositoryInterface $repository;
|
||||
|
||||
/**
|
||||
@@ -76,7 +76,7 @@ class AttemptController extends Controller
|
||||
}
|
||||
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->repository->getAttempts($message);
|
||||
$count = $collection->count();
|
||||
$attempts = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
|
||||
|
@@ -40,7 +40,7 @@ use League\Fractal\Resource\Item;
|
||||
*/
|
||||
class MessageController extends Controller
|
||||
{
|
||||
public const RESOURCE_KEY = 'webhook_messages';
|
||||
public const string RESOURCE_KEY = 'webhook_messages';
|
||||
private WebhookRepositoryInterface $repository;
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ class MessageController extends Controller
|
||||
public function index(Webhook $webhook): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->repository->getMessages($webhook);
|
||||
|
||||
$count = $collection->count();
|
||||
|
@@ -43,7 +43,7 @@ use League\Fractal\Resource\Item;
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
{
|
||||
public const RESOURCE_KEY = 'webhooks';
|
||||
public const string RESOURCE_KEY = 'webhooks';
|
||||
private WebhookRepositoryInterface $repository;
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ class ShowController extends Controller
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$collection = $this->repository->all();
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$count = $collection->count();
|
||||
$webhooks = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
|
||||
|
||||
|
@@ -35,7 +35,7 @@ use League\Fractal\Resource\Item;
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
{
|
||||
public const RESOURCE_KEY = 'webhooks';
|
||||
public const string RESOURCE_KEY = 'webhooks';
|
||||
private WebhookRepositoryInterface $repository;
|
||||
|
||||
/**
|
||||
|
@@ -33,8 +33,8 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
*/
|
||||
class AutocompleteRequest extends FormRequest
|
||||
{
|
||||
use ConvertsDataTypes;
|
||||
use ChecksLogin;
|
||||
use ConvertsDataTypes;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
@@ -46,8 +46,6 @@ class AutocompleteRequest extends FormRequest
|
||||
if ('' !== $types) {
|
||||
$array = explode(',', $types);
|
||||
}
|
||||
$limit = $this->convertInteger('limit');
|
||||
$limit = 0 === $limit ? 10 : $limit;
|
||||
|
||||
// remove 'initial balance' from allowed types. its internal
|
||||
$array = array_diff($array, [AccountType::INITIAL_BALANCE, AccountType::RECONCILIATION]);
|
||||
@@ -56,7 +54,6 @@ class AutocompleteRequest extends FormRequest
|
||||
'types' => $array,
|
||||
'query' => $this->convertString('query'),
|
||||
'date' => $this->getCarbonDate('date'),
|
||||
'limit' => $limit,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -66,7 +63,6 @@ class AutocompleteRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'limit' => 'min:0|max:1337',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,6 @@ use FireflyIII\Support\Request\ChecksLogin;
|
||||
use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||
use FireflyIII\Validation\Api\Data\Bulk\ValidatesBulkTransactionQuery;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Validation\Validator;
|
||||
use JsonException;
|
||||
|
||||
@@ -55,7 +54,7 @@ class TransactionRequest extends FormRequest
|
||||
];
|
||||
} catch (JsonException $e) {
|
||||
// dont really care. the validation should catch invalid json.
|
||||
Log::error($e->getMessage());
|
||||
app('log')->error($e->getMessage());
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
@@ -35,8 +35,8 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
*/
|
||||
class DateRequest extends FormRequest
|
||||
{
|
||||
use ConvertsDataTypes;
|
||||
use ChecksLogin;
|
||||
use ConvertsDataTypes;
|
||||
|
||||
/**
|
||||
* Get all data from the request.
|
||||
|
@@ -32,8 +32,8 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
*/
|
||||
class DestroyRequest extends FormRequest
|
||||
{
|
||||
use ConvertsDataTypes;
|
||||
use ChecksLogin;
|
||||
use ConvertsDataTypes;
|
||||
|
||||
/**
|
||||
* Get all data from the request.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user