chore: reformat code.

This commit is contained in:
James Cole
2023-06-21 12:34:58 +02:00
parent 8d87abde64
commit 3dcb35710b
799 changed files with 23319 additions and 22173 deletions

View File

@@ -1,250 +1,250 @@
parameters: parameters:
indentation: spaces indentation: spaces
file_extensions: file_extensions:
- php - php
exclude_files: exclude_files:
- fixtures/* - fixtures/*
- fixtures*/* - fixtures*/*
- temp/* - temp/*
- tmp/* - tmp/*
services: services:
# Checkers bellow aim on 1:1 copy of https://nette.org/en/coding-standard # Checkers bellow aim on 1:1 copy of https://nette.org/en/coding-standard
# General rules - https://nette.org/en/coding-standard#toc-general-rules # General rules - https://nette.org/en/coding-standard#toc-general-rules
# use tabs over spaces # use tabs over spaces
# PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowSpaceIndentSniff: ~ # PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowSpaceIndentSniff: ~
# PHP code must use only UTF-8 without BOM # PHP code must use only UTF-8 without BOM
PhpCsFixer\Fixer\Basic\EncodingFixer: ~ PhpCsFixer\Fixer\Basic\EncodingFixer: ~
# <?php opening tag # <?php opening tag
PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer: ~ PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer: ~
# Ensure there is no code on the same line as the PHP open tag. # Ensure there is no code on the same line as the PHP open tag.
PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer: ~ PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer: ~
# The closing ?> tag must be omitted from files containing only PHP. # The closing ?> tag must be omitted from files containing only PHP.
PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer: ~ PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer: ~
# There must not be trailing whitespace at the end of lines. # There must not be trailing whitespace at the end of lines.
PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer: ~ PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer: ~
# ...and at the end of blank lines. # ...and at the end of blank lines.
PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer: ~ PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer: ~
# All files must end with a single blank line. # All files must end with a single blank line.
PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer: ~ PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer: ~
# File name should match class name if possible. # File name should match class name if possible.
PhpCsFixer\Fixer\Basic\Psr4Fixer: ~ PhpCsFixer\Fixer\Basic\Psr4Fixer: ~
# Enforces using shorthand scalar typehint variants in phpDocs: `int` instead of `integer` and `bool` instead of `boolean` # Enforces using shorthand scalar typehint variants in phpDocs: `int` instead of `integer` and `bool` instead of `boolean`
SlevomatCodingStandard\Sniffs\TypeHints\LongTypeHintsSniff: ~ SlevomatCodingStandard\Sniffs\TypeHints\LongTypeHintsSniff: ~
# File Header - https://nette.org/en/coding-standard#toc-file-header # File Header - https://nette.org/en/coding-standard#toc-file-header
# empty line before namespace # empty line before namespace
PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer: ~ PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer: ~
# 1 Use statement per line # 1 Use statement per line
PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer: ~ PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer: ~
# Use statements are alphabetically ordered # Use statements are alphabetically ordered
PhpCsFixer\Fixer\Import\OrderedImportsFixer: ~ PhpCsFixer\Fixer\Import\OrderedImportsFixer: ~
# disallow group use declarations use FooLibrary\Bar\Baz\{ ClassA, ClassB, ClassC, ClassD as Fizbo } # disallow group use declarations use FooLibrary\Bar\Baz\{ ClassA, ClassB, ClassC, ClassD as Fizbo }
SlevomatCodingStandard\Sniffs\Namespaces\DisallowGroupUseSniff: ~ SlevomatCodingStandard\Sniffs\Namespaces\DisallowGroupUseSniff: ~
# Disallows leading backslash in use statement: use \Foo\Bar; # Disallows leading backslash in use statement: use \Foo\Bar;
SlevomatCodingStandard\Sniffs\Namespaces\UseDoesNotStartWithBackslashSniff: ~ SlevomatCodingStandard\Sniffs\Namespaces\UseDoesNotStartWithBackslashSniff: ~
# Looks for unused imports from other namespaces. # Looks for unused imports from other namespaces.
Nette\CodingStandard\Sniffs\Namespaces\UnusedUsesSniff: Nette\CodingStandard\Sniffs\Namespaces\UnusedUsesSniff:
searchAnnotations: yes searchAnnotations: yes
ignoredAnnotationNames: ['@testCase'] ignoredAnnotationNames: [ '@testCase' ]
ignoredAnnotations: ['@internal'] ignoredAnnotations: [ '@internal' ]
# Language Construct (should be placed before some other fixers) # Language Construct (should be placed before some other fixers)
# Functions should be used with `$strict` param set to `true` # Functions should be used with `$strict` param set to `true`
PhpCsFixer\Fixer\Strict\StrictParamFixer: ~ PhpCsFixer\Fixer\Strict\StrictParamFixer: ~
# replaces is_null(parameter) expression with `null === parameter`. # replaces is_null(parameter) expression with `null === parameter`.
PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer: PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer:
use_yoda_style: true use_yoda_style: true
# Calling `unset` on multiple items should be done in one call. # Calling `unset` on multiple items should be done in one call.
PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveUnsetsFixer: ~ PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveUnsetsFixer: ~
# Replace all `<>` with `!=`. # Replace all `<>` with `!=`.
PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer: ~ PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer: ~
# Include/Require and file path should be divided with a single space. File path should not be placed under brackets. # Include/Require and file path should be divided with a single space. File path should not be placed under brackets.
PhpCsFixer\Fixer\ControlStructure\IncludeFixer: ~ PhpCsFixer\Fixer\ControlStructure\IncludeFixer: ~
# Requires short ternary operator ?: when possible # Requires short ternary operator ?: when possible
SlevomatCodingStandard\Sniffs\ControlStructures\RequireShortTernaryOperatorSniff: ~ SlevomatCodingStandard\Sniffs\ControlStructures\RequireShortTernaryOperatorSniff: ~
# Arrays - https://nette.org/en/coding-standard#toc-arrays # Arrays - https://nette.org/en/coding-standard#toc-arrays
# use short array fixes # use short array fixes
PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer: PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer:
syntax: short syntax: short
# use trailing command in last array element # use trailing command in last array element
PhpCsFixer\Fixer\ArrayNotation\TrailingCommaInMultilineArrayFixer: ~ PhpCsFixer\Fixer\ArrayNotation\TrailingCommaInMultilineArrayFixer: ~
# PHP single-line arrays should not have trailing comma. # PHP single-line arrays should not have trailing comma.
# PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer: ~ # PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer: ~
# In array declaration, there MUST NOT be a whitespace before each comma. # In array declaration, there MUST NOT be a whitespace before each comma.
PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer: ~ PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer: ~
# Arrays should be formatted like function/method arguments, without leading or trailing single line space. # Arrays should be formatted like function/method arguments, without leading or trailing single line space.
PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer: ~ PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer: ~
# In array declaration, there MUST be a whitespace after each comma. # In array declaration, there MUST be a whitespace after each comma.
PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer: ~ PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer: ~
# Strings # Strings
# Convert `heredoc` to `nowdoc` where possible. # Convert `heredoc` to `nowdoc` where possible.
PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer: ~ PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer: ~
# Convert double quotes to single quotes for simple strings. # Convert double quotes to single quotes for simple strings.
PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer: ~ PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer: ~
# Keywords and True/False/Null - https://nette.org/en/coding-standard#toc-keywords-and-true-false-null # Keywords and True/False/Null - https://nette.org/en/coding-standard#toc-keywords-and-true-false-null
# PHP keywords must be in lower case # PHP keywords must be in lower case
PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer: ~ PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer: ~
# The PHP constants `true`, `false`, and `null` MUST be in lower case # The PHP constants `true`, `false`, and `null` MUST be in lower case
PhpCsFixer\Fixer\Casing\LowercaseConstantsFixer: ~ PhpCsFixer\Fixer\Casing\LowercaseConstantsFixer: ~
# Method and Functions Calls - https://nette.org/en/coding-standard#toc-method-and-function-calls # Method and Functions Calls - https://nette.org/en/coding-standard#toc-method-and-function-calls
# Function defined by PHP should be called using the correct casing # Function defined by PHP should be called using the correct casing
PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer: ~ PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer: ~
# In the argument list, there must be one space after each comma, and there must no be a space before each comma # In the argument list, there must be one space after each comma, and there must no be a space before each comma
PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer: ~ PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer: ~
# This sniff checks that there are two blank lines between functions declarations and single between signatures. # This sniff checks that there are two blank lines between functions declarations and single between signatures.
#Nette\CodingStandard\Sniffs\WhiteSpace\FunctionSpacingSniff: ~ #Nette\CodingStandard\Sniffs\WhiteSpace\FunctionSpacingSniff: ~
# Classes - https://nette.org/en/coding-standard#toc-classes # Classes - https://nette.org/en/coding-standard#toc-classes
# Inside a classy element "self" should be preferred to the class name itself. # Inside a classy element "self" should be preferred to the class name itself.
PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer: ~ PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer: ~
# class element order: constants, properties, from public to private # class element order: constants, properties, from public to private
PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer: PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer:
order: order:
- use_trait - use_trait
- constant - constant
- constant_public - constant_public
- constant_protected - constant_protected
- constant_private - constant_private
- property_public - property_public
- property_protected - property_protected
- property_private - property_private
# Constants - https://nette.org/en/coding-standard#toc-constants # Constants - https://nette.org/en/coding-standard#toc-constants
# constant names are CAPITALIZED (manuall fixing only :() # constant names are CAPITALIZED (manuall fixing only :()
PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff: ~ PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff: ~
# Class Properties - https://nette.org/en/coding-standard#toc-class-properties # Class Properties - https://nette.org/en/coding-standard#toc-class-properties
# There MUST NOT be more than one property declared per statement. # There MUST NOT be more than one property declared per statement.
PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer: PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer:
elements: ['property'] elements: [ 'property' ]
# Methods - https://nette.org/en/coding-standard#toc-methods # Methods - https://nette.org/en/coding-standard#toc-methods
# They must be declared in camelCase. # They must be declared in camelCase.
PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff: ~ PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff: ~
# Checks that there's a single space between a typehint and a parameter name and no whitespace between a nullability symbol and a typehint # Checks that there's a single space between a typehint and a parameter name and no whitespace between a nullability symbol and a typehint
SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSpacingSniff: ~ SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSpacingSniff: ~
# Spaces should be properly placed in a function declaration. # Spaces should be properly placed in a function declaration.
PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer: ~ PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer: ~
# In function arguments there must not be arguments with default values before non-default ones. # In function arguments there must not be arguments with default values before non-default ones.
PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer: ~ PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer: ~
# Constans, Class Properties, Methods # Constans, Class Properties, Methods
# Constants and Properties should be separated by 1 blank line # Constants and Properties should be separated by 1 blank line
#PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer: #PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer:
# elements: [const, property] # elements: [const, property]
# Last property and 1st method should be separated by 2 spaces # Last property and 1st method should be separated by 2 spaces
Nette\CodingStandard\Fixer\ClassNotation\LastPropertyAndFirstMethodSeparationFixer: Nette\CodingStandard\Fixer\ClassNotation\LastPropertyAndFirstMethodSeparationFixer:
space_count: 2 space_count: 2
# Control Statements - https://nette.org/en/coding-standard#toc-control-statements # Control Statements - https://nette.org/en/coding-standard#toc-control-statements
# The keyword `elseif` should be used instead of `else if` so that all control keywords look like single words. # The keyword `elseif` should be used instead of `else if` so that all control keywords look like single words.
PhpCsFixer\Fixer\ControlStructure\ElseifFixer: ~ PhpCsFixer\Fixer\ControlStructure\ElseifFixer: ~
# Remove useless semicolon statements. # Remove useless semicolon statements.
PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer: ~ PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer: ~
# Remove trailing commas in list() calls. # Remove trailing commas in list() calls.
PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer: ~ PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer: ~
# Removes unneeded parentheses around control statements. # Removes unneeded parentheses around control statements.
PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer: ~ PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer: ~
# A case should be followed by a colon and not a semicolon. # A case should be followed by a colon and not a semicolon.
PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer: ~ PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer: ~
# The structure body must be indented once. # The structure body must be indented once.
# The closing brace must be on the next line after the body. # The closing brace must be on the next line after the body.
# There should not be more than one statement per line. # There should not be more than one statement per line.
#Nette\CodingStandard\Fixer\Basic\BracesFixer: #Nette\CodingStandard\Fixer\Basic\BracesFixer:
# allow_single_line_closure: true # allow_single_line_closure: true
# changes if (1 === $cond) to if ($cond === 1) # changes if (1 === $cond) to if ($cond === 1)
#SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff: ~ #SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff: ~
# finds unreachable catch blocks: # finds unreachable catch blocks:
SlevomatCodingStandard\Sniffs\Exceptions\DeadCatchSniff: ~ SlevomatCodingStandard\Sniffs\Exceptions\DeadCatchSniff: ~
# Casting # Casting
# A single space or none should be between cast and variable (int) $val # A single space or none should be between cast and variable (int) $val
PhpCsFixer\Fixer\CastNotation\CastSpacesFixer: ~ PhpCsFixer\Fixer\CastNotation\CastSpacesFixer: ~
# Cast should be written in lower case. # Cast should be written in lower case.
PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer: ~ PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer: ~
# Replaces `intval`, `floatval`, `doubleval`, `strval` and `boolval` function calls with according type casting operator # Replaces `intval`, `floatval`, `doubleval`, `strval` and `boolval` function calls with according type casting operator
PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer: ~ PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer: ~
# Short cast `bool` using double exclamation mark should not be used # Short cast `bool` using double exclamation mark should not be used
PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer: ~ PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer: ~
# Cast `(boolean)` and `(integer)` should be written as `(bool)` and `(int)`, `(double)` and `(real)` as `(float)` # Cast `(boolean)` and `(integer)` should be written as `(bool)` and `(int)`, `(double)` and `(real)` as `(float)`
PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer: ~ PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer: ~
# Language Whitespace # Language Whitespace
# Binary operators should be surrounded by at least one space. DO NOT USE # Binary operators should be surrounded by at least one space. DO NOT USE
#PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer: ~ #PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer: ~
# Unary operators should be placed adjacent to their operands. # Unary operators should be placed adjacent to their operands.
PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer: ~ PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer: ~
# No space after the opening parenthesis and before the closing parenthesis # No space after the opening parenthesis and before the closing parenthesis
PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer: ~ PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer: ~
# There MUST NOT be spaces around offset braces $a[0] # There MUST NOT be spaces around offset braces $a[0]
PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer: ~ PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer: ~
# There should not be space before or after object `T_OBJECT_OPERATOR` `->`. # There should not be space before or after object `T_OBJECT_OPERATOR` `->`.
PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer: ~ PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer: ~
# Standardize spaces around ternary operator. # Standardize spaces around ternary operator.
PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer: ~ PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer: ~
# Concatenation $a . $b should be spaced according configuration # Concatenation $a . $b should be spaced according configuration
PhpCsFixer\Fixer\Operator\ConcatSpaceFixer: PhpCsFixer\Fixer\Operator\ConcatSpaceFixer:
spacing: one spacing: one
# Removes extra spaces between colon and case value. # Removes extra spaces between colon and case value.
PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer: ~ PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer: ~
# Comments # Comments
# Docblocks should have the same indentation as the documented subject. # Docblocks should have the same indentation as the documented subject.
PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer: ~ PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer: ~
# There should not be any empty comments. # There should not be any empty comments.
PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer: ~ PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer: ~
# There should not be empty PHPDoc blocks. # There should not be empty PHPDoc blocks.
#PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer: ~ #PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer: ~
# Phpdocs should start and end with content, excluding the very first and last line of the docblocks. # Phpdocs should start and end with content, excluding the very first and last line of the docblocks.
PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer: ~ PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer: ~
# Single-line comments comments with only one line of actual content should use the `//` syntax. # Single-line comments comments with only one line of actual content should use the `//` syntax.
PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer: PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer:
comment_types: ['hash'] comment_types: [ 'hash' ]
# Require comments with single-line content to be written as one-liners # Require comments with single-line content to be written as one-liners
SlevomatCodingStandard\Sniffs\Commenting\RequireOneLinePropertyDocCommentSniff: ~ SlevomatCodingStandard\Sniffs\Commenting\RequireOneLinePropertyDocCommentSniff: ~
# Properties MUST not be explicitly initialized with `null`. # Properties MUST not be explicitly initialized with `null`.
#PhpCsFixer\Fixer\ClassNotation\NoNullPropertyInitializationFixer: ~ #PhpCsFixer\Fixer\ClassNotation\NoNullPropertyInitializationFixer: ~
PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer: PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer:
comment_text: 'break omitted' comment_text: 'break omitted'
# declare(strict_types=1); # declare(strict_types=1);
PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer: ~ PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer: ~
# Enforces consistent formatting of return typehints: function foo(): ?int # Enforces consistent formatting of return typehints: function foo(): ?int
SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSpacingSniff: ~ SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSpacingSniff: ~
# Use `null` coalescing operator `??` where possible. # Use `null` coalescing operator `??` where possible.
PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer: ~ PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer: ~
Nette\CodingStandard\Fixer\ClassNotation\ClassAndTraitVisibilityRequiredFixer: Nette\CodingStandard\Fixer\ClassNotation\ClassAndTraitVisibilityRequiredFixer:
elements: ['const', 'property', 'method'] elements: [ 'const', 'property', 'method' ]
# short list() syntax [] # short list() syntax []
PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer: PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer:
syntax: short syntax: short

View File

@@ -22,12 +22,12 @@
$current = __DIR__; $current = __DIR__;
$paths = [ $paths = [
$current.'/../../app', $current . '/../../app',
$current.'/../../config', $current . '/../../config',
$current.'/../../database', $current . '/../../database',
$current.'/../../routes', $current . '/../../routes',
$current.'/../../tests', $current . '/../../tests',
$current.'/../../resources/lang', $current . '/../../resources/lang',
]; ];
$finder = PhpCsFixer\Finder::create() $finder = PhpCsFixer\Finder::create()
@@ -36,9 +36,9 @@ $finder = PhpCsFixer\Finder::create()
$config = new PhpCsFixer\Config(); $config = new PhpCsFixer\Config();
return $config->setRules([ return $config->setRules([
'@PSR12' => true, '@PSR12' => true,
'declare_strict_types' => true, 'declare_strict_types' => true,
'strict_param' => true, 'strict_param' => true,
'array_syntax' => ['syntax' => 'short'], 'array_syntax' => ['syntax' => 'short'],
]) ])
->setFinder($finder); ->setFinder($finder);

View File

@@ -1,5 +1,5 @@
{ {
"require": { "require": {
"friendsofphp/php-cs-fixer": "^3.12" "friendsofphp/php-cs-fixer": "^3.12"
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -30,12 +30,9 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# clean up php code # clean up php code
cd $SCRIPT_DIR/php-cs-fixer cd $SCRIPT_DIR/php-cs-fixer
composer update composer update --quiet
rm -f .php-cs-fixer.cache rm -f .php-cs-fixer.cache
echo 'Removed cache...'
echo 'Running...'
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 --allow-risky=yes
echo 'Done!'
cd $SCRIPT_DIR/.. cd $SCRIPT_DIR/..
exit 0 exit 0

37
.ci/phpmd.sh Normal file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
#
# phpmd.sh
# Copyright (c) 2023 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 )"
cd $SCRIPT_DIR/phpmd
composer update --quiet
./vendor/bin/phpmd \
$SCRIPT_DIR/../app text phpmd.xml \
--exclude $SCRIPT_DIR/../app/resources/** \
--exclude $SCRIPT_DIR/../app/frontend/** \
--exclude $SCRIPT_DIR/../app/public/** \
--exclude $SCRIPT_DIR/../app/vendor/** \
cd $SCRIPT_DIR/..
exit 0

1
.ci/phpmd/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
vendor

5
.ci/phpmd/composer.json Normal file
View File

@@ -0,0 +1,5 @@
{
"require-dev": {
"phpmd/phpmd": "^2.13"
}
}

1012
.ci/phpmd/composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

52
.ci/phpmd/phpmd.xml Normal file
View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
<!--
Commando vanuit firefly directory:
phpmd database,app,tests html /gdrive-all/development/phpmd/phpmd.xml > public/report.html
-->
<!-- 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/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" />
<!-- no this one -->
<!--<rule ref="rulesets/cleancode.xml/StaticAccess" />-->
</ruleset>

View File

@@ -143,6 +143,7 @@ MAIL_FROM=changeme@example.com
MAIL_USERNAME=null MAIL_USERNAME=null
MAIL_PASSWORD=null MAIL_PASSWORD=null
MAIL_ENCRYPTION=null MAIL_ENCRYPTION=null
MAIL_SENDMAIL_COMMAND=
# Other mail drivers: # Other mail drivers:
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE # If you use Docker or similar, you can set these variables from a file by appending them with _FILE

View File

@@ -2,7 +2,10 @@
## Our Pledge ## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making
participation in our project and our community a harassment-free experience for everyone, regardless of age, body size,
disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race,
religion, or sexual identity and orientation.
## Our Standards ## Our Standards
@@ -24,23 +27,35 @@ Examples of unacceptable behavior by participants include:
## Our Responsibilities ## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take
appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope ## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the
project or its community. Examples of representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed representative at an online or offline
event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement ## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at james@firefly-iii.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
james@firefly-iii.org. The project team will review and investigate all complaints, and will respond in a way that it
deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the
reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
repercussions as determined by other members of the project's leadership.
## Attribution ## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available
at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org [homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/ [version]: http://contributor-covenant.org/version/1/4/

View File

@@ -5,7 +5,7 @@ updates:
- package-ecosystem: "composer" - package-ecosystem: "composer"
directory: "/" # Location of package manifests directory: "/" # Location of package manifests
target-branch: develop target-branch: develop
labels: ["bug"] labels: [ "bug" ]
versioning-strategy: increase versioning-strategy: increase
schedule: schedule:
interval: "weekly" interval: "weekly"
@@ -14,15 +14,15 @@ updates:
- package-ecosystem: "npm" - package-ecosystem: "npm"
directory: "/" directory: "/"
target-branch: develop target-branch: develop
labels: ["bug"] labels: [ "bug" ]
versioning-strategy: increase versioning-strategy: increase
schedule: schedule:
interval: "weekly" interval: "weekly"
- package-ecosystem: "github-actions" - package-ecosystem: "github-actions"
directory: "/" directory: "/"
target-branch: develop target-branch: develop
labels: ["bug"] labels: [ "bug" ]
versioning-strategy: increase versioning-strategy: increase
schedule: schedule:
interval: "weekly" interval: "weekly"

View File

@@ -2,9 +2,11 @@
Sometimes bugs reported to Firefly III are configuration and system problems on the user's side. Sometimes bugs reported to Firefly III are configuration and system problems on the user's side.
If you run into any of the following problems, there's a good chance it's not a Firefly III issue, but a configuration issue. If you run into any of the following problems, there's a good chance it's not a Firefly III issue, but a configuration
issue.
- ⚠️ Firefly III can't connect to the database when starting or the password is wrong, even though you're sure it's correct. - ⚠️ Firefly III can't connect to the database when starting or the password is wrong, even though you're sure it's
correct.
- ⚠️ Errors about a missing `APP_KEY` or other encryption/hash problems - ⚠️ Errors about a missing `APP_KEY` or other encryption/hash problems
- ⚠️ You can't login due to `419` errors (page expired) - ⚠️ You can't login due to `419` errors (page expired)
- ⚠️ Any `500` error when starting Firefly III - ⚠️ Any `500` error when starting Firefly III
@@ -13,4 +15,6 @@ If you run into any of the following problems, there's a good chance it's not a
- ⚠️ Firefly III does not work behind your reverse proxy - ⚠️ Firefly III does not work behind your reverse proxy
- ⚠️ You can't connect to the Data Importer due to 404's or authentication issues. - ⚠️ You can't connect to the Data Importer due to 404's or authentication issues.
If you run into an issue like this, please start a [discussion](https://github.com/firefly-iii/firefly-iii/discussions) or chat on [Gitter.im](https://gitter.im/firefly-iii/firefly-iii). There's a good chance it's not a bug but something we can fix rather quickly :+1: If you run into an issue like this, please start a [discussion](https://github.com/firefly-iii/firefly-iii/discussions)
or chat on [Gitter.im](https://gitter.im/firefly-iii/firefly-iii). There's a good chance it's not a bug but something we
can fix rather quickly :+1:

View File

@@ -11,8 +11,8 @@ Fixes issue # (if relevant)
Changes in this pull request: Changes in this pull request:
- -
- -
- -
@JC5 @JC5

8
.github/support.md vendored
View File

@@ -4,12 +4,13 @@
## Reporting an issue ## Reporting an issue
First of all: thank you for reporting a bug instead of ditching the tool altogether. Bugs have a lot of priority! First of all: thank you for reporting a bug instead of ditching the tool altogether. Bugs have a lot of priority!
1. Open bugs will have open issues, so search for one first. 1. Open bugs will have open issues, so search for one first.
2. If your feature request is already there, vote on it with :+1: or :-1: reactions. 2. If your feature request is already there, vote on it with :+1: or :-1: reactions.
3. Do NOT hijack old issues with the bug you found, open your own issue. 3. Do NOT hijack old issues with the bug you found, open your own issue.
4. If relevant, take the time and see if the [demo site](https://demo.firefly-iii.org/) is also suffering from your issue. 4. If relevant, take the time and see if the [demo site](https://demo.firefly-iii.org/) is also suffering from your
issue.
5. If relevant, read the [documentation](https://docs.firefly-iii.org/). 5. If relevant, read the [documentation](https://docs.firefly-iii.org/).
Please follow these guidelines when opening new issues: Please follow these guidelines when opening new issues:
@@ -25,7 +26,8 @@ Only then [create a new issue](https://github.com/firefly-iii/firefly-iii/issues
## Issue closure and abandonment policy ## Issue closure and abandonment policy
- Issues can be converted into discussions if it's not a bug or feature request. - Issues can be converted into discussions if it's not a bug or feature request.
- Features that won't be implemented will be labelled "wontfix". [This isn't personal](https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/what-its-not/). - Features that won't be implemented will be labelled "
wontfix". [This isn't personal](https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/what-its-not/).
- Issues can be closed if they're duplicates of other issues. - Issues can be closed if they're duplicates of other issues.
- Issues can be closed if the answer is in the FAQ. - Issues can be closed if the answer is in the FAQ.
- Issues will be closed automatically after 14 days. - Issues will be closed automatically after 14 days.

View File

@@ -7,17 +7,16 @@ jobs:
auto_comment: auto_comment:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- - uses: aws-actions/closed-issue-message@v1
uses: aws-actions/closed-issue-message@v1
with: with:
message: | message: |
Hi there! This is an automatic reply. `Share and enjoy` Hi there! This is an automatic reply. `Share and enjoy`
This issue is now 🔒 closed. Please be aware that closed issues are **not** watched. 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. - 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.
- Follow-up questions must be posted in a new [discussion](https://github.com/firefly-iii/firefly-iii/discussions/) - 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 will get **no response**.
Thank you for your contributions. Thank you for your contributions.
repo-token: "${{ secrets.GITHUB_TOKEN }}" repo-token: "${{ secrets.GITHUB_TOKEN }}"

View File

@@ -1,5 +1,5 @@
name: 'Dependency Review' name: 'Dependency Review'
on: [pull_request] on: [ pull_request ]
permissions: permissions:
contents: read contents: read

View File

@@ -67,7 +67,7 @@ class AccountController extends Controller
* Documentation for this endpoint: * Documentation for this endpoint:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getAccountsAC * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getAccountsAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
* @throws JsonException * @throws JsonException

View File

@@ -60,7 +60,7 @@ class BillController extends Controller
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getBillsAC * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getBillsAC
* TODO expand API to add active field. * TODO expand API to add active field.
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -59,7 +59,7 @@ class BudgetController extends Controller
* Documentation for this endpoint is at: * Documentation for this endpoint is at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getBudgetsAC * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getBudgetsAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -59,7 +59,7 @@ class CategoryController extends Controller
* Documentation for this endpoint is at: * Documentation for this endpoint is at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getCategoriesAC * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getCategoriesAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -59,7 +59,7 @@ class CurrencyController extends Controller
* Documentation for this endpoint is at: * Documentation for this endpoint is at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getCurrenciesAC * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getCurrenciesAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -87,7 +87,7 @@ class CurrencyController extends Controller
* Documentation for this endpoint is at: * Documentation for this endpoint is at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getCurrenciesCodeAC * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getCurrenciesCodeAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
* @deprecated * @deprecated

View File

@@ -59,7 +59,7 @@ class ObjectGroupController extends Controller
* Documentation for this endpoint is at: * Documentation for this endpoint is at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getObjectGroupsAC * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getObjectGroupsAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -63,7 +63,7 @@ class PiggyBankController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getPiggiesAC * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getPiggiesAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -98,7 +98,7 @@ class PiggyBankController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getPiggiesBalanceAC * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getPiggiesBalanceAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -57,7 +57,7 @@ class RecurrenceController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getRecurringAC * * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getRecurringAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -56,7 +56,7 @@ class RuleController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getRulesAC * * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getRulesAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -56,7 +56,7 @@ class RuleGroupController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getRuleGroupsAC * * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getRuleGroupsAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -59,7 +59,7 @@ class TagController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getTagAC * * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getTagAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -64,7 +64,7 @@ class TransactionController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getTransactionsAC * * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getTransactionsAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -94,7 +94,7 @@ class TransactionController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getTransactionsIDAC * * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getTransactionsIDAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -55,7 +55,7 @@ class TransactionTypeController extends Controller
* This endpoint is documented at * This endpoint is documented at
* * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getTransactionTypesAC * * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/autocomplete/getTransactionTypesAC
* *
* @param AutocompleteRequest $request * @param AutocompleteRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -76,7 +76,7 @@ class AccountController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/charts/getChartAccountOverview * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/charts/getChartAccountOverview
* *
* @param DateRequest $request * @param DateRequest $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException

View File

@@ -74,42 +74,6 @@ abstract class Controller extends BaseController
); );
} }
/**
* Method to help build URL's.
*
* @return string
*/
final protected function buildParams(): string
{
$return = '?';
$params = [];
foreach ($this->parameters as $key => $value) {
if ('page' === $key) {
continue;
}
if ($value instanceof Carbon) {
$params[$key] = $value->format('Y-m-d');
continue;
}
$params[$key] = $value;
}
return $return.http_build_query($params);
}
/**
* @return Manager
*/
final protected function getManager(): Manager
{
// create some objects:
$manager = new Manager();
$baseUrl = request()->getSchemeAndHttpHost().'/api/v1';
$manager->setSerializer(new JsonApiSerializer($baseUrl));
return $manager;
}
/** /**
* Method to grab all parameters from the URL. * Method to grab all parameters from the URL.
* *
@@ -144,7 +108,7 @@ abstract class Controller extends BaseController
if (null !== $date) { if (null !== $date) {
try { try {
$obj = Carbon::parse($date); $obj = Carbon::parse($date);
} catch (InvalidDateException|InvalidFormatException $e) { } catch (InvalidDateException | InvalidFormatException $e) {
// don't care // don't care
app('log')->warning( app('log')->warning(
sprintf( sprintf(
@@ -178,7 +142,7 @@ abstract class Controller extends BaseController
} }
/** /**
* @param ParameterBag $bag * @param ParameterBag $bag
* *
* @return ParameterBag * @return ParameterBag
*/ */
@@ -211,4 +175,40 @@ abstract class Controller extends BaseController
return $bag; return $bag;
} }
/**
* Method to help build URL's.
*
* @return string
*/
final protected function buildParams(): string
{
$return = '?';
$params = [];
foreach ($this->parameters as $key => $value) {
if ('page' === $key) {
continue;
}
if ($value instanceof Carbon) {
$params[$key] = $value->format('Y-m-d');
continue;
}
$params[$key] = $value;
}
return $return . http_build_query($params);
}
/**
* @return Manager
*/
final protected function getManager(): Manager
{
// create some objects:
$manager = new Manager();
$baseUrl = request()->getSchemeAndHttpHost() . '/api/v1';
$manager->setSerializer(new JsonApiSerializer($baseUrl));
return $manager;
}
} }

View File

@@ -64,7 +64,7 @@ class TransactionController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/bulkUpdateTransactions * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/bulkUpdateTransactions
* *
* @param TransactionRequest $request * @param TransactionRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -89,7 +89,7 @@ class TransactionController extends Controller
} }
/** /**
* @param array $params * @param array $params
* *
* @return bool * @return bool
*/ */

View File

@@ -58,7 +58,7 @@ class DestroyController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/destroyData * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/destroyData
* *
* @param DestroyRequest $request * @param DestroyRequest $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -202,7 +202,92 @@ class DestroyController extends Controller
} }
/** /**
* @param array $types *
*/
private function destroyBudgets(): void
{
/** @var AvailableBudgetRepositoryInterface $abRepository */
$abRepository = app(AvailableBudgetRepositoryInterface::class);
$abRepository->destroyAll();
/** @var BudgetLimitRepositoryInterface $blRepository */
$blRepository = app(BudgetLimitRepositoryInterface::class);
$blRepository->destroyAll();
/** @var BudgetRepositoryInterface $budgetRepository */
$budgetRepository = app(BudgetRepositoryInterface::class);
$budgetRepository->destroyAll();
}
/**
*
*/
private function destroyBills(): void
{
/** @var BillRepositoryInterface $repository */
$repository = app(BillRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyPiggyBanks(): void
{
/** @var PiggyBankRepositoryInterface $repository */
$repository = app(PiggyBankRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyRules(): void
{
/** @var RuleGroupRepositoryInterface $repository */
$repository = app(RuleGroupRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyRecurringTransactions(): void
{
/** @var RecurringRepositoryInterface $repository */
$repository = app(RecurringRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyCategories(): void
{
/** @var CategoryRepositoryInterface $categoryRepos */
$categoryRepos = app(CategoryRepositoryInterface::class);
$categoryRepos->destroyAll();
}
/**
*
*/
private function destroyTags(): void
{
/** @var TagRepositoryInterface $tagRepository */
$tagRepository = app(TagRepositoryInterface::class);
$tagRepository->destroyAll();
}
private function destroyObjectGroups(): void
{
/** @var ObjectGroupRepositoryInterface $repository */
$repository = app(ObjectGroupRepositoryInterface::class);
$repository->deleteAll();
}
/**
* @param array $types
*/ */
private function destroyAccounts(array $types): void private function destroyAccounts(array $types): void
{ {
@@ -227,92 +312,7 @@ class DestroyController extends Controller
} }
/** /**
* * @param array $types
*/
private function destroyBills(): void
{
/** @var BillRepositoryInterface $repository */
$repository = app(BillRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyBudgets(): void
{
/** @var AvailableBudgetRepositoryInterface $abRepository */
$abRepository = app(AvailableBudgetRepositoryInterface::class);
$abRepository->destroyAll();
/** @var BudgetLimitRepositoryInterface $blRepository */
$blRepository = app(BudgetLimitRepositoryInterface::class);
$blRepository->destroyAll();
/** @var BudgetRepositoryInterface $budgetRepository */
$budgetRepository = app(BudgetRepositoryInterface::class);
$budgetRepository->destroyAll();
}
/**
*
*/
private function destroyCategories(): void
{
/** @var CategoryRepositoryInterface $categoryRepos */
$categoryRepos = app(CategoryRepositoryInterface::class);
$categoryRepos->destroyAll();
}
private function destroyObjectGroups(): void
{
/** @var ObjectGroupRepositoryInterface $repository */
$repository = app(ObjectGroupRepositoryInterface::class);
$repository->deleteAll();
}
/**
*
*/
private function destroyPiggyBanks(): void
{
/** @var PiggyBankRepositoryInterface $repository */
$repository = app(PiggyBankRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyRecurringTransactions(): void
{
/** @var RecurringRepositoryInterface $repository */
$repository = app(RecurringRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyRules(): void
{
/** @var RuleGroupRepositoryInterface $repository */
$repository = app(RuleGroupRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyTags(): void
{
/** @var TagRepositoryInterface $tagRepository */
$tagRepository = app(TagRepositoryInterface::class);
$tagRepository->destroyAll();
}
/**
* @param array $types
*/ */
private function destroyTransactions(array $types): void private function destroyTransactions(array $types): void
{ {

View File

@@ -57,7 +57,7 @@ class ExportController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportAccounts * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportAccounts
* *
* @param ExportRequest $request * @param ExportRequest $request
* *
* @return LaravelResponse * @return LaravelResponse
* @throws FireflyException * @throws FireflyException
@@ -70,139 +70,7 @@ class ExportController extends Controller
} }
/** /**
* This endpoint is documented at: * @param string $key
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportBills
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function bills(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportBills(true);
return $this->returnExport('bills');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportBudgets
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function budgets(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportBudgets(true);
return $this->returnExport('budgets');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportCategories
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function categories(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportCategories(true);
return $this->returnExport('categories');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportPiggies
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function piggyBanks(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportPiggies(true);
return $this->returnExport('piggies');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportRecurring
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function recurring(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportRecurring(true);
return $this->returnExport('recurrences');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportRules
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function rules(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportRules(true);
return $this->returnExport('rules');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportTags
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function tags(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportTags(true);
return $this->returnExport('tags');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportTransactions
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function transactions(ExportRequest $request): LaravelResponse
{
$params = $request->getAll();
$this->exporter->setStart($params['start']);
$this->exporter->setEnd($params['end']);
$this->exporter->setAccounts($params['accounts']);
$this->exporter->setExportTransactions(true);
return $this->returnExport('transactions');
}
/**
* @param string $key
* *
* @return LaravelResponse * @return LaravelResponse
* @throws FireflyException * @throws FireflyException
@@ -218,7 +86,7 @@ class ExportController extends Controller
$response $response
->header('Content-Description', 'File Transfer') ->header('Content-Description', 'File Transfer')
->header('Content-Type', 'application/octet-stream') ->header('Content-Type', 'application/octet-stream')
->header('Content-Disposition', 'attachment; filename='.$fileName) ->header('Content-Disposition', 'attachment; filename=' . $fileName)
->header('Content-Transfer-Encoding', 'binary') ->header('Content-Transfer-Encoding', 'binary')
->header('Connection', 'Keep-Alive') ->header('Connection', 'Keep-Alive')
->header('Expires', '0') ->header('Expires', '0')
@@ -228,4 +96,136 @@ class ExportController extends Controller
return $response; return $response;
} }
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportBills
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function bills(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportBills(true);
return $this->returnExport('bills');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportBudgets
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function budgets(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportBudgets(true);
return $this->returnExport('budgets');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportCategories
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function categories(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportCategories(true);
return $this->returnExport('categories');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportPiggies
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function piggyBanks(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportPiggies(true);
return $this->returnExport('piggies');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportRecurring
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function recurring(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportRecurring(true);
return $this->returnExport('recurrences');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportRules
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function rules(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportRules(true);
return $this->returnExport('rules');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportTags
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function tags(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportTags(true);
return $this->returnExport('tags');
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/exportTransactions
*
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws FireflyException
*/
public function transactions(ExportRequest $request): LaravelResponse
{
$params = $request->getAll();
$this->exporter->setStart($params['start']);
$this->exporter->setEnd($params['end']);
$this->exporter->setAccounts($params['accounts']);
$this->exporter->setExportTransactions(true);
return $this->returnExport('transactions');
}
} }

View File

@@ -76,7 +76,7 @@ class AccountController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightExpenseAsset * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightExpenseAsset
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -107,7 +107,7 @@ class AccountController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightExpenseExpense * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightExpenseExpense
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -61,7 +61,7 @@ class BillController extends Controller
* *
* Expenses per bill, possibly filtered by bill and account. * Expenses per bill, possibly filtered by bill and account.
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -124,7 +124,7 @@ class BillController extends Controller
* *
* Expenses for no bill filtered by account. * Expenses for no bill filtered by account.
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -68,7 +68,7 @@ class BudgetController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightExpenseBudget * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightExpenseBudget
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -105,7 +105,7 @@ class BudgetController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightExpenseNoBudget * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightExpenseNoBudget
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -69,7 +69,7 @@ class CategoryController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferCategory * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferCategory
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -106,7 +106,7 @@ class CategoryController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferNoCategory * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferNoCategory
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -38,7 +38,7 @@ class PeriodController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightExpenseTotal * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightExpenseTotal
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -60,7 +60,7 @@ class TagController extends Controller
* *
* Expenses for no tag filtered by account. * Expenses for no tag filtered by account.
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -113,7 +113,7 @@ class TagController extends Controller
* *
* Expenses per tag, possibly filtered by tag and account. * Expenses per tag, possibly filtered by tag and account.
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -76,7 +76,7 @@ class AccountController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightIncomeAsset * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightIncomeAsset
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -106,7 +106,7 @@ class AccountController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightIncomeRevenue * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightIncomeRevenue
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -69,7 +69,7 @@ class CategoryController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightIncomeCategory * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightIncomeCategory
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -106,7 +106,7 @@ class CategoryController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightIncomeNoCategory * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightIncomeNoCategory
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -38,7 +38,7 @@ class PeriodController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightIncomeTotal * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightIncomeTotal
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -61,7 +61,7 @@ class TagController extends Controller
* *
* Expenses for no tag filtered by account. * Expenses for no tag filtered by account.
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -117,7 +117,7 @@ class TagController extends Controller
* *
* Expenses per tag, possibly filtered by tag and account. * Expenses per tag, possibly filtered by tag and account.
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -61,7 +61,7 @@ class AccountController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransfers * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransfers
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -68,7 +68,7 @@ class CategoryController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferCategory * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferCategory
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -105,7 +105,7 @@ class CategoryController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferNoCategory * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferNoCategory
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -38,7 +38,7 @@ class PeriodController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferTotal * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferTotal
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -58,7 +58,7 @@ class TagController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferNoTag * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/insight/insightTransferNoTag
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -114,7 +114,7 @@ class TagController extends Controller
* *
* Transfers per tag, possibly filtered by tag and account. * Transfers per tag, possibly filtered by tag and account.
* *
* @param GenericRequest $request * @param GenericRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -61,7 +61,7 @@ class DestroyController extends Controller
* *
* Remove the specified resource from storage. * Remove the specified resource from storage.
* *
* @param Account $account * @param Account $account
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -73,7 +73,7 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/accounts/listAttachmentByAccount * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/accounts/listAttachmentByAccount
* *
* @param Account $account * @param Account $account
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -89,7 +89,7 @@ class ListController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.accounts.attachments', [$account->id]).$this->buildParams()); $paginator->setPath(route('api.v1.accounts.attachments', [$account->id]) . $this->buildParams());
/** @var AttachmentTransformer $transformer */ /** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class); $transformer = app(AttachmentTransformer::class);
@@ -105,7 +105,7 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/accounts/listPiggyBankByAccount * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/accounts/listPiggyBankByAccount
* *
* @param Account $account * @param Account $account
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -125,7 +125,7 @@ class ListController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($piggyBanks, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($piggyBanks, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.accounts.piggy-banks', [$account->id]).$this->buildParams()); $paginator->setPath(route('api.v1.accounts.piggy-banks', [$account->id]) . $this->buildParams());
/** @var PiggyBankTransformer $transformer */ /** @var PiggyBankTransformer $transformer */
$transformer = app(PiggyBankTransformer::class); $transformer = app(PiggyBankTransformer::class);
@@ -144,8 +144,8 @@ class ListController extends Controller
* Show all transaction groups related to the account. * Show all transaction groups related to the account.
* *
* *
* @param Request $request * @param Request $request
* @param Account $account * @param Account $account
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -177,7 +177,7 @@ class ListController extends Controller
} }
$paginator = $collector->getPaginatedGroups(); $paginator = $collector->getPaginatedGroups();
$paginator->setPath(route('api.v1.accounts.transactions', [$account->id]).$this->buildParams()); $paginator->setPath(route('api.v1.accounts.transactions', [$account->id]) . $this->buildParams());
$groups = $paginator->getCollection(); $groups = $paginator->getCollection();
/** @var TransactionGroupTransformer $transformer */ /** @var TransactionGroupTransformer $transformer */

View File

@@ -71,7 +71,7 @@ class ShowController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @param Request $request * @param Request $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -98,7 +98,7 @@ class ShowController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($accounts, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($accounts, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.accounts.index').$this->buildParams()); $paginator->setPath(route('api.v1.accounts.index') . $this->buildParams());
/** @var AccountTransformer $transformer */ /** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class); $transformer = app(AccountTransformer::class);
@@ -116,7 +116,7 @@ class ShowController extends Controller
* *
* Show single instance. * Show single instance.
* *
* @param Account $account * @param Account $account
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -63,7 +63,7 @@ class StoreController extends Controller
* *
* Store a new instance. * Store a new instance.
* *
* @param StoreRequest $request * @param StoreRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -66,8 +66,8 @@ class UpdateController extends Controller
* *
* Update account. * Update account.
* *
* @param UpdateRequest $request * @param UpdateRequest $request
* @param Account $account * @param Account $account
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -75,7 +75,7 @@ class UpdateController extends Controller
{ {
Log::debug(sprintf('Now in %s', __METHOD__)); Log::debug(sprintf('Now in %s', __METHOD__));
$data = $request->getUpdateData(); $data = $request->getUpdateData();
$data['type'] = config('firefly.shortNamesByFullName.'.$account->accountType->type); $data['type'] = config('firefly.shortNamesByFullName.' . $account->accountType->type);
$account = $this->repository->update($account, $data); $account = $this->repository->update($account, $data);
$manager = $this->getManager(); $manager = $this->getManager();
$account->refresh(); $account->refresh();

View File

@@ -65,7 +65,7 @@ class DestroyController extends Controller
* Remove the specified resource from storage. * Remove the specified resource from storage.
* *
* *
* @param Attachment $attachment * @param Attachment $attachment
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -71,7 +71,7 @@ class ShowController extends Controller
* *
* Download an attachment. * Download an attachment.
* *
* @param Attachment $attachment * @param Attachment $attachment
* *
* @return LaravelResponse * @return LaravelResponse
* @throws FireflyException * @throws FireflyException
@@ -96,7 +96,7 @@ class ShowController extends Controller
$response $response
->header('Content-Description', 'File Transfer') ->header('Content-Description', 'File Transfer')
->header('Content-Type', 'application/octet-stream') ->header('Content-Type', 'application/octet-stream')
->header('Content-Disposition', 'attachment; filename='.$quoted) ->header('Content-Disposition', 'attachment; filename=' . $quoted)
->header('Content-Transfer-Encoding', 'binary') ->header('Content-Transfer-Encoding', 'binary')
->header('Connection', 'Keep-Alive') ->header('Connection', 'Keep-Alive')
->header('Expires', '0') ->header('Expires', '0')
@@ -132,7 +132,7 @@ class ShowController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.attachments.index').$this->buildParams()); $paginator->setPath(route('api.v1.attachments.index') . $this->buildParams());
/** @var AttachmentTransformer $transformer */ /** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class); $transformer = app(AttachmentTransformer::class);
@@ -150,7 +150,7 @@ class ShowController extends Controller
* *
* Display the specified resource. * Display the specified resource.
* *
* @param Attachment $attachment * @param Attachment $attachment
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -71,7 +71,7 @@ class StoreController extends Controller
* *
* Store a newly created resource in storage. * Store a newly created resource in storage.
* *
* @param StoreRequest $request * @param StoreRequest $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -96,8 +96,8 @@ class StoreController extends Controller
* Upload an attachment. * Upload an attachment.
* *
* *
* @param Request $request * @param Request $request
* @param Attachment $attachment * @param Attachment $attachment
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -67,8 +67,8 @@ class UpdateController extends Controller
* *
* Update the specified resource in storage. * Update the specified resource in storage.
* *
* @param UpdateRequest $request * @param UpdateRequest $request
* @param Attachment $attachment * @param Attachment $attachment
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -88,7 +88,7 @@ class ShowController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($availableBudgets, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($availableBudgets, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.available-budgets.index').$this->buildParams()); $paginator->setPath(route('api.v1.available-budgets.index') . $this->buildParams());
/** @var AvailableBudgetTransformer $transformer */ /** @var AvailableBudgetTransformer $transformer */
$transformer = app(AvailableBudgetTransformer::class); $transformer = app(AvailableBudgetTransformer::class);
@@ -106,7 +106,7 @@ class ShowController extends Controller
* *
* Display the specified resource. * Display the specified resource.
* *
* @param AvailableBudget $availableBudget * @param AvailableBudget $availableBudget
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -59,7 +59,7 @@ class DestroyController extends Controller
* *
* Remove the specified resource from storage. * Remove the specified resource from storage.
* *
* @param Bill $bill * @param Bill $bill
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -72,7 +72,7 @@ class ListController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @param Bill $bill * @param Bill $bill
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -88,7 +88,7 @@ class ListController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.bills.attachments', [$bill->id]).$this->buildParams()); $paginator->setPath(route('api.v1.bills.attachments', [$bill->id]) . $this->buildParams());
/** @var AttachmentTransformer $transformer */ /** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class); $transformer = app(AttachmentTransformer::class);
@@ -106,7 +106,7 @@ class ListController extends Controller
* *
* List all of them. * List all of them.
* *
* @param Bill $bill * @param Bill $bill
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -125,7 +125,7 @@ class ListController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($rules, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($rules, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.bills.rules', [$bill->id]).$this->buildParams()); $paginator->setPath(route('api.v1.bills.rules', [$bill->id]) . $this->buildParams());
/** @var RuleTransformer $transformer */ /** @var RuleTransformer $transformer */
$transformer = app(RuleTransformer::class); $transformer = app(RuleTransformer::class);
@@ -142,9 +142,9 @@ class ListController extends Controller
* *
* Show all transactions. * Show all transactions.
* *
* @param Request $request * @param Request $request
* *
* @param Bill $bill * @param Bill $bill
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -184,7 +184,7 @@ class ListController extends Controller
// get paginator. // get paginator.
$paginator = $collector->getPaginatedGroups(); $paginator = $collector->getPaginatedGroups();
$paginator->setPath(route('api.v1.bills.transactions', [$bill->id]).$this->buildParams()); $paginator->setPath(route('api.v1.bills.transactions', [$bill->id]) . $this->buildParams());
$transactions = $paginator->getCollection(); $transactions = $paginator->getCollection();
/** @var TransactionGroupTransformer $transformer */ /** @var TransactionGroupTransformer $transformer */

View File

@@ -94,7 +94,7 @@ class ShowController extends Controller
* *
* Show the specified bill. * Show the specified bill.
* *
* @param Bill $bill * @param Bill $bill
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -65,7 +65,7 @@ class StoreController extends Controller
* *
* Store a bill. * Store a bill.
* *
* @param StoreRequest $request * @param StoreRequest $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException

View File

@@ -62,8 +62,8 @@ class UpdateController extends Controller
* *
* Update a bill. * Update a bill.
* *
* @param UpdateRequest $request * @param UpdateRequest $request
* @param Bill $bill * @param Bill $bill
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -59,7 +59,7 @@ class DestroyController extends Controller
* *
* Remove the specified resource from storage. * Remove the specified resource from storage.
* *
* @param Budget $budget * @param Budget $budget
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -74,7 +74,7 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listAttachmentByBudget * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listAttachmentByBudget
* *
* @param Budget $budget * @param Budget $budget
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -90,7 +90,7 @@ class ListController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budgets.attachments', [$budget->id]).$this->buildParams()); $paginator->setPath(route('api.v1.budgets.attachments', [$budget->id]) . $this->buildParams());
/** @var AttachmentTransformer $transformer */ /** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class); $transformer = app(AttachmentTransformer::class);
@@ -108,7 +108,7 @@ class ListController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @param Budget $budget * @param Budget $budget
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -122,7 +122,7 @@ class ListController extends Controller
$count = $collection->count(); $count = $collection->count();
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); $budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
$paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budgets.budget-limits', [$budget->id]).$this->buildParams()); $paginator->setPath(route('api.v1.budgets.budget-limits', [$budget->id]) . $this->buildParams());
/** @var BudgetLimitTransformer $transformer */ /** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class); $transformer = app(BudgetLimitTransformer::class);
@@ -139,9 +139,9 @@ class ListController extends Controller
* *
* Show all transactions. * Show all transactions.
* *
* @param Request $request * @param Request $request
* *
* @param Budget $budget * @param Budget $budget
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -186,7 +186,7 @@ class ListController extends Controller
} }
$paginator = $collector->getPaginatedGroups(); $paginator = $collector->getPaginatedGroups();
$paginator->setPath(route('api.v1.budgets.transactions', [$budget->id]).$this->buildParams()); $paginator->setPath(route('api.v1.budgets.transactions', [$budget->id]) . $this->buildParams());
$transactions = $paginator->getCollection(); $transactions = $paginator->getCollection();
/** @var TransactionGroupTransformer $transformer */ /** @var TransactionGroupTransformer $transformer */
@@ -204,7 +204,7 @@ class ListController extends Controller
* *
* Show all transactions. * Show all transactions.
* *
* @param Request $request * @param Request $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -249,7 +249,7 @@ class ListController extends Controller
} }
$paginator = $collector->getPaginatedGroups(); $paginator = $collector->getPaginatedGroups();
$paginator->setPath(route('api.v1.budgets.without-budget').$this->buildParams()); $paginator->setPath(route('api.v1.budgets.without-budget') . $this->buildParams());
$transactions = $paginator->getCollection(); $transactions = $paginator->getCollection();
/** @var TransactionGroupTransformer $transformer */ /** @var TransactionGroupTransformer $transformer */

View File

@@ -86,7 +86,7 @@ class ShowController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($budgets, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($budgets, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budgets.index').$this->buildParams()); $paginator->setPath(route('api.v1.budgets.index') . $this->buildParams());
/** @var BudgetTransformer $transformer */ /** @var BudgetTransformer $transformer */
$transformer = app(BudgetTransformer::class); $transformer = app(BudgetTransformer::class);
@@ -101,7 +101,7 @@ class ShowController extends Controller
/** /**
* Show a budget. * Show a budget.
* *
* @param Budget $budget * @param Budget $budget
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -62,7 +62,7 @@ class StoreController extends Controller
* *
* Store a budget. * Store a budget.
* *
* @param StoreRequest $request * @param StoreRequest $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException

View File

@@ -62,8 +62,8 @@ class UpdateController extends Controller
* *
* Update a budget. * Update a budget.
* *
* @param UpdateRequest $request * @param UpdateRequest $request
* @param Budget $budget * @param Budget $budget
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -64,8 +64,8 @@ class DestroyController extends Controller
* *
* Remove the specified resource from storage. * Remove the specified resource from storage.
* *
* @param Budget $budget * @param Budget $budget
* @param BudgetLimit $budgetLimit * @param BudgetLimit $budgetLimit
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException

View File

@@ -71,9 +71,9 @@ class ListController extends Controller
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionByBudgetLimit * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/listTransactionByBudgetLimit
* Show all transactions. * Show all transactions.
* *
* @param Request $request * @param Request $request
* @param Budget $budget * @param Budget $budget
* @param BudgetLimit $budgetLimit * @param BudgetLimit $budgetLimit
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -109,7 +109,7 @@ class ListController extends Controller
$collector->setRange($budgetLimit->start_date, $budgetLimit->end_date); $collector->setRange($budgetLimit->start_date, $budgetLimit->end_date);
$collector->setTypes($types); $collector->setTypes($types);
$paginator = $collector->getPaginatedGroups(); $paginator = $collector->getPaginatedGroups();
$paginator->setPath(route('api.v1.budgets.limits.transactions', [$budget->id, $budgetLimit->id]).$this->buildParams()); $paginator->setPath(route('api.v1.budgets.limits.transactions', [$budget->id, $budgetLimit->id]) . $this->buildParams());
$transactions = $paginator->getCollection(); $transactions = $paginator->getCollection();
/** @var TransactionGroupTransformer $transformer */ /** @var TransactionGroupTransformer $transformer */

View File

@@ -75,8 +75,8 @@ class ShowController extends Controller
* *
* Display a listing of the budget limits for this budget. * Display a listing of the budget limits for this budget.
* *
* @param Request $request * @param Request $request
* @param Budget $budget * @param Budget $budget
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -90,7 +90,7 @@ class ShowController extends Controller
$count = $collection->count(); $count = $collection->count();
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); $budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
$paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budgets.limits.index', [$budget->id]).$this->buildParams()); $paginator->setPath(route('api.v1.budgets.limits.index', [$budget->id]) . $this->buildParams());
/** @var BudgetLimitTransformer $transformer */ /** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class); $transformer = app(BudgetLimitTransformer::class);
@@ -108,7 +108,7 @@ class ShowController extends Controller
* *
* Display a listing of the budget limits for this budget. * Display a listing of the budget limits for this budget.
* *
* @param SameDateRequest $request * @param SameDateRequest $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -122,7 +122,7 @@ class ShowController extends Controller
$count = $collection->count(); $count = $collection->count();
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); $budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
$paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budget-limits.index').$this->buildParams()); $paginator->setPath(route('api.v1.budget-limits.index') . $this->buildParams());
/** @var BudgetLimitTransformer $transformer */ /** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class); $transformer = app(BudgetLimitTransformer::class);
@@ -138,9 +138,9 @@ class ShowController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/getBudgetLimit * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/getBudgetLimit
* *
* @param Request $request * @param Request $request
* @param Budget $budget * @param Budget $budget
* @param BudgetLimit $budgetLimit * @param BudgetLimit $budgetLimit
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException

View File

@@ -65,8 +65,8 @@ class StoreController extends Controller
* *
* Store a newly created resource in storage. * Store a newly created resource in storage.
* *
* @param StoreRequest $request * @param StoreRequest $request
* @param Budget $budget * @param Budget $budget
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -69,9 +69,9 @@ class UpdateController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/updateBudgetLimit * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/budgets/updateBudgetLimit
* *
* @param UpdateRequest $request * @param UpdateRequest $request
* @param Budget $budget * @param Budget $budget
* @param BudgetLimit $budgetLimit * @param BudgetLimit $budgetLimit
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException

View File

@@ -59,7 +59,7 @@ class DestroyController extends Controller
* *
* Remove the specified resource from storage. * Remove the specified resource from storage.
* *
* @param Category $category * @param Category $category
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -69,7 +69,7 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/categories/listAttachmentByCategory * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/categories/listAttachmentByCategory
* *
* @param Category $category * @param Category $category
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -85,7 +85,7 @@ class ListController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.categories.attachments', [$category->id]).$this->buildParams()); $paginator->setPath(route('api.v1.categories.attachments', [$category->id]) . $this->buildParams());
/** @var AttachmentTransformer $transformer */ /** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class); $transformer = app(AttachmentTransformer::class);
@@ -103,9 +103,9 @@ class ListController extends Controller
* *
* Show all transactions. * Show all transactions.
* *
* @param Request $request * @param Request $request
* *
* @param Category $category * @param Category $category
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -143,7 +143,7 @@ class ListController extends Controller
} }
$paginator = $collector->getPaginatedGroups(); $paginator = $collector->getPaginatedGroups();
$paginator->setPath(route('api.v1.categories.transactions', [$category->id]).$this->buildParams()); $paginator->setPath(route('api.v1.categories.transactions', [$category->id]) . $this->buildParams());
$transactions = $paginator->getCollection(); $transactions = $paginator->getCollection();
/** @var TransactionGroupTransformer $transformer */ /** @var TransactionGroupTransformer $transformer */

View File

@@ -82,7 +82,7 @@ class ShowController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($categories, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($categories, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.categories.index').$this->buildParams()); $paginator->setPath(route('api.v1.categories.index') . $this->buildParams());
/** @var CategoryTransformer $transformer */ /** @var CategoryTransformer $transformer */
$transformer = app(CategoryTransformer::class); $transformer = app(CategoryTransformer::class);
@@ -99,7 +99,7 @@ class ShowController extends Controller
* *
* Show the category. * Show the category.
* *
* @param Category $category * @param Category $category
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -62,7 +62,7 @@ class StoreController extends Controller
* *
* Store new category. * Store new category.
* *
* @param StoreRequest $request * @param StoreRequest $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException

View File

@@ -62,8 +62,8 @@ class UpdateController extends Controller
* *
* Update the category. * Update the category.
* *
* @param UpdateRequest $request * @param UpdateRequest $request
* @param Category $category * @param Category $category
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -62,7 +62,7 @@ class DestroyController extends Controller
* *
* Remove the specified resource from storage. * Remove the specified resource from storage.
* *
* @param ObjectGroup $objectGroup * @param ObjectGroup $objectGroup
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -68,7 +68,7 @@ class ListController extends Controller
* *
* List all bills in this object group * List all bills in this object group
* *
* @param ObjectGroup $objectGroup * @param ObjectGroup $objectGroup
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -85,7 +85,7 @@ class ListController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($bills, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($bills, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.currencies.bills', [$objectGroup->id]).$this->buildParams()); $paginator->setPath(route('api.v1.currencies.bills', [$objectGroup->id]) . $this->buildParams());
/** @var BillTransformer $transformer */ /** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class); $transformer = app(BillTransformer::class);
@@ -103,7 +103,7 @@ class ListController extends Controller
* *
* List all piggies under the object group. * List all piggies under the object group.
* *
* @param ObjectGroup $objectGroup * @param ObjectGroup $objectGroup
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -123,7 +123,7 @@ class ListController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($piggyBanks, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($piggyBanks, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.object-groups.piggy-banks', [$objectGroup->id]).$this->buildParams()); $paginator->setPath(route('api.v1.object-groups.piggy-banks', [$objectGroup->id]) . $this->buildParams());
/** @var PiggyBankTransformer $transformer */ /** @var PiggyBankTransformer $transformer */
$transformer = app(PiggyBankTransformer::class); $transformer = app(PiggyBankTransformer::class);

View File

@@ -69,7 +69,7 @@ class ShowController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
* *
* @param Request $request * @param Request $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -88,7 +88,7 @@ class ShowController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($objectGroups, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($objectGroups, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.object-groups.index').$this->buildParams()); $paginator->setPath(route('api.v1.object-groups.index') . $this->buildParams());
/** @var ObjectGroupTransformer $transformer */ /** @var ObjectGroupTransformer $transformer */
$transformer = app(ObjectGroupTransformer::class); $transformer = app(ObjectGroupTransformer::class);
@@ -106,7 +106,7 @@ class ShowController extends Controller
* *
* Show single instance. * Show single instance.
* *
* @param ObjectGroup $objectGroup * @param ObjectGroup $objectGroup
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -63,8 +63,8 @@ class UpdateController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/object_groups/updateObjectGroup * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/object_groups/updateObjectGroup
* *
* @param UpdateRequest $request * @param UpdateRequest $request
* @param ObjectGroup $objectGroup * @param ObjectGroup $objectGroup
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -59,7 +59,7 @@ class DestroyController extends Controller
* *
* Delete the resource. * Delete the resource.
* *
* @param PiggyBank $piggyBank * @param PiggyBank $piggyBank
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -63,7 +63,7 @@ class ListController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAttachmentByPiggyBank * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAttachmentByPiggyBank
* *
* @param PiggyBank $piggyBank * @param PiggyBank $piggyBank
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -79,7 +79,7 @@ class ListController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.piggy-banks.attachments', [$piggyBank->id]).$this->buildParams()); $paginator->setPath(route('api.v1.piggy-banks.attachments', [$piggyBank->id]) . $this->buildParams());
/** @var AttachmentTransformer $transformer */ /** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class); $transformer = app(AttachmentTransformer::class);
@@ -97,7 +97,7 @@ class ListController extends Controller
* *
* List single resource. * List single resource.
* *
* @param PiggyBank $piggyBank * @param PiggyBank $piggyBank
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -114,7 +114,7 @@ class ListController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($events, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($events, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.piggy-banks.events', [$piggyBank->id]).$this->buildParams()); $paginator->setPath(route('api.v1.piggy-banks.events', [$piggyBank->id]) . $this->buildParams());
/** @var PiggyBankEventTransformer $transformer */ /** @var PiggyBankEventTransformer $transformer */
$transformer = app(PiggyBankEventTransformer::class); $transformer = app(PiggyBankEventTransformer::class);

View File

@@ -81,7 +81,7 @@ class ShowController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($piggyBanks, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($piggyBanks, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.piggy-banks.index').$this->buildParams()); $paginator->setPath(route('api.v1.piggy-banks.index') . $this->buildParams());
/** @var PiggyBankTransformer $transformer */ /** @var PiggyBankTransformer $transformer */
$transformer = app(PiggyBankTransformer::class); $transformer = app(PiggyBankTransformer::class);
@@ -99,7 +99,7 @@ class ShowController extends Controller
* *
* List single resource. * List single resource.
* *
* @param PiggyBank $piggyBank * @param PiggyBank $piggyBank
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -62,7 +62,7 @@ class StoreController extends Controller
* *
* Store new object. * Store new object.
* *
* @param StoreRequest $request * @param StoreRequest $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException

View File

@@ -62,8 +62,8 @@ class UpdateController extends Controller
* *
* Update piggy bank. * Update piggy bank.
* *
* @param UpdateRequest $request * @param UpdateRequest $request
* @param PiggyBank $piggyBank * @param PiggyBank $piggyBank
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -59,7 +59,7 @@ class DestroyController extends Controller
* *
* Delete the resource. * Delete the resource.
* *
* @param Recurrence $recurrence * @param Recurrence $recurrence
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -69,8 +69,8 @@ class ListController extends Controller
* *
* Show transactions for this recurrence. * Show transactions for this recurrence.
* *
* @param Request $request * @param Request $request
* @param Recurrence $recurrence * @param Recurrence $recurrence
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException
@@ -109,7 +109,7 @@ class ListController extends Controller
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end')); $collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
} }
$paginator = $collector->getPaginatedGroups(); $paginator = $collector->getPaginatedGroups();
$paginator->setPath(route('api.v1.transactions.index').$this->buildParams()); $paginator->setPath(route('api.v1.transactions.index') . $this->buildParams());
$transactions = $paginator->getCollection(); $transactions = $paginator->getCollection();
/** @var TransactionGroupTransformer $transformer */ /** @var TransactionGroupTransformer $transformer */

View File

@@ -82,7 +82,7 @@ class ShowController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($piggyBanks, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($piggyBanks, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.recurrences.index').$this->buildParams()); $paginator->setPath(route('api.v1.recurrences.index') . $this->buildParams());
/** @var RecurrenceTransformer $transformer */ /** @var RecurrenceTransformer $transformer */
$transformer = app(RecurrenceTransformer::class); $transformer = app(RecurrenceTransformer::class);
@@ -100,7 +100,7 @@ class ShowController extends Controller
* *
* List single resource. * List single resource.
* *
* @param Recurrence $recurrence * @param Recurrence $recurrence
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -62,7 +62,7 @@ class StoreController extends Controller
* *
* Store new object. * Store new object.
* *
* @param StoreRequest $request * @param StoreRequest $request
* *
* @return JsonResponse * @return JsonResponse
* @throws FireflyException * @throws FireflyException

View File

@@ -62,8 +62,8 @@ class UpdateController extends Controller
* *
* Update single recurrence. * Update single recurrence.
* *
* @param UpdateRequest $request * @param UpdateRequest $request
* @param Recurrence $recurrence * @param Recurrence $recurrence
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -63,7 +63,7 @@ class DestroyController extends Controller
* *
* Delete the resource. * Delete the resource.
* *
* @param Rule $rule * @param Rule $rule
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -86,7 +86,7 @@ class ShowController extends Controller
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($rules, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($rules, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.rules.index').$this->buildParams()); $paginator->setPath(route('api.v1.rules.index') . $this->buildParams());
/** @var RuleTransformer $transformer */ /** @var RuleTransformer $transformer */
$transformer = app(RuleTransformer::class); $transformer = app(RuleTransformer::class);
@@ -104,7 +104,7 @@ class ShowController extends Controller
* *
* List single resource. * List single resource.
* *
* @param Rule $rule * @param Rule $rule
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -65,7 +65,7 @@ class StoreController extends Controller
* *
* Store new object. * Store new object.
* *
* @param StoreRequest $request * @param StoreRequest $request
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -69,8 +69,8 @@ class TriggerController extends Controller
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rules/testRule * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/rules/testRule
* *
* @param TestRequest $request * @param TestRequest $request
* @param Rule $rule * @param Rule $rule
* *
* @return JsonResponse * @return JsonResponse
*/ */
@@ -102,7 +102,7 @@ class TriggerController extends Controller
$count = $transactions->count(); $count = $transactions->count();
$paginator = new LengthAwarePaginator($transactions, $count, 31337, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($transactions, $count, 31337, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.rules.test', [$rule->id]).$this->buildParams()); $paginator->setPath(route('api.v1.rules.test', [$rule->id]) . $this->buildParams());
// resulting list is presented as JSON thing. // resulting list is presented as JSON thing.
$manager = $this->getManager(); $manager = $this->getManager();
@@ -122,8 +122,8 @@ class TriggerController extends Controller
* *
* Execute the given rule group on a set of existing transactions. * Execute the given rule group on a set of existing transactions.
* *
* @param TriggerRequest $request * @param TriggerRequest $request
* @param Rule $rule * @param Rule $rule
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -66,8 +66,8 @@ class UpdateController extends Controller
* *
* Update a rule. * Update a rule.
* *
* @param UpdateRequest $request * @param UpdateRequest $request
* @param Rule $rule * @param Rule $rule
* *
* @return JsonResponse * @return JsonResponse
*/ */

View File

@@ -63,7 +63,7 @@ class DestroyController extends Controller
* *
* Delete the resource. * Delete the resource.
* *
* @param RuleGroup $ruleGroup * @param RuleGroup $ruleGroup
* *
* @return JsonResponse * @return JsonResponse
*/ */

Some files were not shown because too many files have changed in this diff Show More