Compare commits
No commits in common. "1b2473aa83cf1c2f96a017033063a7eac76f7a56" and "4ac9c728de07355a43ac33401b541fe8140e979c" have entirely different histories.
1b2473aa83
...
4ac9c728de
|
@ -1,6 +0,0 @@
|
|||
# define your env variables for the test env here
|
||||
KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
SYMFONY_DEPRECATIONS_HELPER=999999
|
||||
PANTHER_APP_ENV=panther
|
||||
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
|
10
.gitignore
vendored
10
.gitignore
vendored
|
@ -4,13 +4,3 @@
|
|||
/var/
|
||||
/vendor/
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> phpunit/phpunit ###
|
||||
/phpunit.xml
|
||||
.phpunit.result.cache
|
||||
###< phpunit/phpunit ###
|
||||
|
||||
# PHP CS Fixer
|
||||
tools/vendor/
|
||||
/.php-cs-fixer.php
|
||||
/.php-cs-fixer.cache
|
||||
|
|
|
@ -1,545 +0,0 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Nexus\CsConfig\Factory;
|
||||
use PhpCsFixer\{Config, Finder};
|
||||
|
||||
$finder = Finder::create()
|
||||
->in(__DIR__)
|
||||
->exclude('var')
|
||||
->exclude('vendor');
|
||||
|
||||
return (new Config())
|
||||
->setRiskyAllowed(TRUE)
|
||||
->setFinder($finder)
|
||||
->setRules([
|
||||
'align_multiline_comment' => false,
|
||||
'array_indentation' => true,
|
||||
'array_push' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'assign_null_coalescing_to_coalesce_equal' => true,
|
||||
'backtick_to_shell_exec' => true,
|
||||
'binary_operator_spaces' => [
|
||||
'default' => 'single_space',
|
||||
'operators' => [
|
||||
'=' => 'align_single_space_minimal',
|
||||
'=>' => 'align_single_space_minimal',
|
||||
'||' => 'align_single_space_minimal',
|
||||
'.=' => 'align_single_space_minimal',
|
||||
],
|
||||
],
|
||||
'blank_line_after_namespace' => true,
|
||||
'blank_line_after_opening_tag' => false,
|
||||
'blank_line_before_statement' => [
|
||||
'statements' => [
|
||||
'case',
|
||||
'continue',
|
||||
'declare',
|
||||
'default',
|
||||
'do',
|
||||
'exit',
|
||||
'for',
|
||||
'foreach',
|
||||
'goto',
|
||||
'return',
|
||||
'switch',
|
||||
'throw',
|
||||
'try',
|
||||
'while',
|
||||
'yield',
|
||||
'yield_from',
|
||||
],
|
||||
],
|
||||
'braces' => [
|
||||
'allow_single_line_anonymous_class_with_empty_body' => true,
|
||||
'allow_single_line_closure' => true,
|
||||
'position_after_anonymous_constructs' => 'same',
|
||||
'position_after_control_structures' => 'same',
|
||||
'position_after_functions_and_oop_constructs' => 'next',
|
||||
],
|
||||
'cast_spaces' => ['space' => 'single'],
|
||||
'class_attributes_separation' => [
|
||||
'elements' => [
|
||||
'const' => 'none',
|
||||
'property' => 'none',
|
||||
'method' => 'one',
|
||||
'trait_import' => 'none',
|
||||
],
|
||||
],
|
||||
'class_definition' => [
|
||||
'multi_line_extends_each_single_line' => true,
|
||||
'single_item_single_line' => true,
|
||||
'single_line' => true,
|
||||
'space_before_parenthesis' => true,
|
||||
],
|
||||
'class_reference_name_casing' => true,
|
||||
'clean_namespace' => true,
|
||||
'combine_consecutive_issets' => true,
|
||||
'combine_consecutive_unsets' => true,
|
||||
'combine_nested_dirname' => true,
|
||||
'comment_to_phpdoc' => [
|
||||
'ignored_tags' => [
|
||||
'todo',
|
||||
'codeCoverageIgnore',
|
||||
'codeCoverageIgnoreStart',
|
||||
'codeCoverageIgnoreEnd',
|
||||
'phpstan-ignore-line',
|
||||
'phpstan-ignore-next-line',
|
||||
],
|
||||
],
|
||||
'compact_nullable_typehint' => true,
|
||||
'concat_space' => ['spacing' => 'one'],
|
||||
'constant_case' => ['case' => 'upper'],
|
||||
'control_structure_continuation_position' => ['position' => 'same_line'],
|
||||
'date_time_immutable' => false,
|
||||
'declare_equal_normalize' => ['space' => 'none'],
|
||||
'declare_parentheses' => true,
|
||||
'declare_strict_types' => true,
|
||||
'dir_constant' => true,
|
||||
'doctrine_annotation_array_assignment' => false,
|
||||
'doctrine_annotation_braces' => false,
|
||||
'doctrine_annotation_indentation' => false,
|
||||
'doctrine_annotation_spaces' => false,
|
||||
'echo_tag_syntax' => [
|
||||
'format' => 'short',
|
||||
'long_function' => 'echo',
|
||||
'shorten_simple_statements_only' => false,
|
||||
],
|
||||
'elseif' => false,
|
||||
'empty_loop_body' => ['style' => 'braces'],
|
||||
'empty_loop_condition' => ['style' => 'while'],
|
||||
'encoding' => true,
|
||||
'ereg_to_preg' => true,
|
||||
'error_suppression' => [
|
||||
'mute_deprecation_error' => true,
|
||||
'noise_remaining_usages' => false,
|
||||
'noise_remaining_usages_exclude' => [],
|
||||
],
|
||||
'escape_implicit_backslashes' => [
|
||||
'double_quoted' => true,
|
||||
'heredoc_syntax' => true,
|
||||
'single_quoted' => false,
|
||||
],
|
||||
'explicit_indirect_variable' => true,
|
||||
'explicit_string_variable' => true,
|
||||
'final_class' => false,
|
||||
'final_internal_class' => [
|
||||
'annotation_exclude' => ['@no-final'],
|
||||
'annotation_include' => ['@internal'],
|
||||
'consider_absent_docblock_as_internal_class' => false,
|
||||
],
|
||||
'final_public_method_for_abstract_class' => false,
|
||||
'fopen_flag_order' => true,
|
||||
'fopen_flags' => ['b_mode' => true],
|
||||
'full_opening_tag' => true,
|
||||
'fully_qualified_strict_types' => true,
|
||||
'function_declaration' => ['closure_function_spacing' => 'one'],
|
||||
'function_to_constant' => [
|
||||
'functions' => [
|
||||
'get_called_class',
|
||||
'get_class',
|
||||
'get_class_this',
|
||||
'php_sapi_name',
|
||||
'phpversion',
|
||||
'pi',
|
||||
],
|
||||
],
|
||||
'function_typehint_space' => true,
|
||||
'general_phpdoc_annotation_remove' => [
|
||||
'annotations' => [
|
||||
'author',
|
||||
'package',
|
||||
'subpackage',
|
||||
],
|
||||
],
|
||||
'general_phpdoc_tag_rename' => [
|
||||
'case_sensitive' => false,
|
||||
'fix_annotation' => true,
|
||||
'fix_inline' => true,
|
||||
'replacements' => ['inheritDocs' => 'inheritDoc'],
|
||||
],
|
||||
'get_class_to_class_keyword' => false,
|
||||
'global_namespace_import' => [
|
||||
'import_constants' => false,
|
||||
'import_functions' => false,
|
||||
'import_classes' => true,
|
||||
],
|
||||
'group_import' => true,
|
||||
'header_comment' => false, // false by default
|
||||
'heredoc_indentation' => ['indentation' => 'start_plus_one'],
|
||||
'heredoc_to_nowdoc' => true,
|
||||
'implode_call' => true,
|
||||
'include' => true,
|
||||
'increment_style' => ['style' => 'post'],
|
||||
'indentation_type' => true,
|
||||
'integer_literal_case' => true,
|
||||
'is_null' => true,
|
||||
'lambda_not_used_import' => true,
|
||||
'line_ending' => true,
|
||||
'linebreak_after_opening_tag' => false,
|
||||
'list_syntax' => ['syntax' => 'short'],
|
||||
'logical_operators' => true,
|
||||
'lowercase_cast' => true,
|
||||
'lowercase_keywords' => true,
|
||||
'lowercase_static_reference' => true,
|
||||
'magic_constant_casing' => true,
|
||||
'magic_method_casing' => true,
|
||||
'mb_str_functions' => false,
|
||||
'method_argument_space' => [
|
||||
'after_heredoc' => false,
|
||||
'keep_multiple_spaces_after_comma' => false,
|
||||
'on_multiline' => 'ensure_fully_multiline',
|
||||
],
|
||||
'method_chaining_indentation' => true,
|
||||
'modernize_strpos' => false, // requires 8.0+
|
||||
'modernize_types_casting' => true,
|
||||
'multiline_comment_opening_closing' => true,
|
||||
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
|
||||
'native_constant_invocation' => false,
|
||||
'native_function_casing' => true,
|
||||
'native_function_invocation' => false,
|
||||
'native_function_type_declaration_casing' => true,
|
||||
'new_with_braces' => true,
|
||||
'no_alias_functions' => ['sets' => ['@all']],
|
||||
'no_alias_language_construct_call' => true,
|
||||
'no_alternative_syntax' => ['fix_non_monolithic_code' => false],
|
||||
'no_binary_string' => true,
|
||||
'no_blank_lines_after_class_opening' => true,
|
||||
'no_blank_lines_after_phpdoc' => true,
|
||||
'no_blank_lines_before_namespace' => false, // conflicts with `single_blank_line_before_namespace`
|
||||
'no_break_comment' => ['comment_text' => 'no break'],
|
||||
'no_closing_tag' => true,
|
||||
'no_empty_comment' => true,
|
||||
'no_empty_phpdoc' => true,
|
||||
'no_empty_statement' => true,
|
||||
'no_extra_blank_lines' => ['tokens' => ['extra']],
|
||||
'no_homoglyph_names' => true,
|
||||
'no_leading_import_slash' => true,
|
||||
'no_leading_namespace_whitespace' => true,
|
||||
'no_mixed_echo_print' => ['use' => 'echo'],
|
||||
'no_multiline_whitespace_around_double_arrow' => true,
|
||||
'no_null_property_initialization' => true,
|
||||
'no_php4_constructor' => true,
|
||||
'no_short_bool_cast' => true,
|
||||
'no_singleline_whitespace_before_semicolons' => true,
|
||||
'no_space_around_double_colon' => true,
|
||||
'no_spaces_after_function_name' => true,
|
||||
'no_spaces_around_offset' => ['positions' => ['inside', 'outside']],
|
||||
'no_spaces_inside_parenthesis' => true,
|
||||
'no_superfluous_elseif' => true,
|
||||
'no_superfluous_phpdoc_tags' => [
|
||||
'allow_mixed' => true,
|
||||
'allow_unused_params' => true,
|
||||
'remove_inheritdoc' => false,
|
||||
],
|
||||
'no_trailing_comma_in_list_call' => true,
|
||||
'no_trailing_comma_in_singleline_array' => true,
|
||||
'no_trailing_whitespace' => true,
|
||||
'no_trailing_whitespace_in_comment' => true,
|
||||
'no_trailing_whitespace_in_string' => true,
|
||||
'no_unneeded_control_parentheses' => [
|
||||
'statements' => [
|
||||
'break',
|
||||
'clone',
|
||||
'continue',
|
||||
'echo_print',
|
||||
'return',
|
||||
'switch_case',
|
||||
'yield',
|
||||
],
|
||||
],
|
||||
'no_unneeded_curly_braces' => ['namespaces' => true],
|
||||
'no_unneeded_final_method' => ['private_methods' => true],
|
||||
'no_unneeded_import_alias' => true,
|
||||
'no_unreachable_default_argument_value' => true,
|
||||
'no_unset_cast' => true,
|
||||
'no_unset_on_property' => false,
|
||||
'no_unused_imports' => true,
|
||||
'no_useless_else' => true,
|
||||
'no_useless_return' => true,
|
||||
'no_useless_sprintf' => true,
|
||||
'no_whitespace_before_comma_in_array' => ['after_heredoc' => true],
|
||||
'no_whitespace_in_blank_line' => true,
|
||||
'non_printable_character' => ['use_escape_sequences_in_strings' => true],
|
||||
'normalize_index_brace' => true,
|
||||
'not_operator_with_space' => false,
|
||||
'not_operator_with_successor_space' => true,
|
||||
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true],
|
||||
'object_operator_without_whitespace' => true,
|
||||
'octal_notation' => false, // requires 8.1+
|
||||
'operator_linebreak' => ['only_booleans' => true, 'position' => 'beginning'],
|
||||
'ordered_class_elements' => [
|
||||
'order' => [
|
||||
'use_trait',
|
||||
'constant',
|
||||
'property',
|
||||
'method',
|
||||
],
|
||||
'sort_algorithm' => 'none',
|
||||
],
|
||||
'ordered_imports' => [
|
||||
'sort_algorithm' => 'alpha',
|
||||
'imports_order' => ['class', 'function', 'const'],
|
||||
],
|
||||
'ordered_interfaces' => false,
|
||||
'ordered_traits' => false,
|
||||
'php_unit_construct' => [
|
||||
'assertions' => [
|
||||
'assertSame',
|
||||
'assertEquals',
|
||||
'assertNotEquals',
|
||||
'assertNotSame',
|
||||
],
|
||||
],
|
||||
'php_unit_dedicate_assert' => ['target' => 'newest'],
|
||||
'php_unit_dedicate_assert_internal_type' => ['target' => 'newest'],
|
||||
'php_unit_expectation' => ['target' => 'newest'],
|
||||
'php_unit_fqcn_annotation' => true,
|
||||
'php_unit_internal_class' => ['types' => ['normal', 'final']],
|
||||
'php_unit_method_casing' => ['case' => 'camel_case'],
|
||||
'php_unit_mock' => ['target' => 'newest'],
|
||||
'php_unit_mock_short_will_return' => true,
|
||||
'php_unit_namespaced' => ['target' => 'newest'],
|
||||
'php_unit_no_expectation_annotation' => [
|
||||
'target' => 'newest',
|
||||
'use_class_const' => true,
|
||||
],
|
||||
'php_unit_set_up_tear_down_visibility' => true,
|
||||
'php_unit_size_class' => false,
|
||||
'php_unit_strict' => [
|
||||
'assertions' => [
|
||||
'assertAttributeEquals',
|
||||
'assertAttributeNotEquals',
|
||||
'assertEquals',
|
||||
'assertNotEquals',
|
||||
],
|
||||
],
|
||||
'php_unit_test_annotation' => ['style' => 'prefix'],
|
||||
'php_unit_test_case_static_method_calls' => [
|
||||
'call_type' => 'this',
|
||||
'methods' => [],
|
||||
],
|
||||
'php_unit_test_class_requires_covers' => false,
|
||||
'phpdoc_add_missing_param_annotation' => ['only_untyped' => true],
|
||||
'phpdoc_align' => [
|
||||
'align' => 'vertical',
|
||||
'tags' => [
|
||||
'method',
|
||||
'param',
|
||||
'property',
|
||||
'return',
|
||||
'throws',
|
||||
'type',
|
||||
'var',
|
||||
],
|
||||
],
|
||||
'phpdoc_annotation_without_dot' => false,
|
||||
'phpdoc_indent' => true,
|
||||
'phpdoc_inline_tag_normalizer' => [
|
||||
'tags' => [
|
||||
'example',
|
||||
'id',
|
||||
'internal',
|
||||
'inheritdoc',
|
||||
'inheritdocs',
|
||||
'link',
|
||||
'source',
|
||||
'toc',
|
||||
'tutorial',
|
||||
],
|
||||
],
|
||||
'phpdoc_line_span' => [
|
||||
'const' => 'multi',
|
||||
'method' => 'multi',
|
||||
'property' => 'multi',
|
||||
],
|
||||
'phpdoc_no_access' => true,
|
||||
'phpdoc_no_alias_tag' => [
|
||||
'replacements' => [
|
||||
'property-read' => 'property',
|
||||
'property-write' => 'property',
|
||||
'type' => 'var',
|
||||
'link' => 'see',
|
||||
],
|
||||
],
|
||||
'phpdoc_no_empty_return' => false,
|
||||
'phpdoc_no_package' => true,
|
||||
'phpdoc_no_useless_inheritdoc' => true,
|
||||
'phpdoc_order' => true,
|
||||
'phpdoc_order_by_value' => [
|
||||
'annotations' => [
|
||||
'author',
|
||||
'covers',
|
||||
'coversNothing',
|
||||
'dataProvider',
|
||||
'depends',
|
||||
'group',
|
||||
'internal',
|
||||
'method',
|
||||
'property',
|
||||
'property-read',
|
||||
'property-write',
|
||||
'requires',
|
||||
'throws',
|
||||
'uses',
|
||||
],
|
||||
],
|
||||
'phpdoc_return_self_reference' => [
|
||||
'replacements' => [
|
||||
'this' => '$this',
|
||||
'@this' => '$this',
|
||||
'$self' => 'self',
|
||||
'@self' => 'self',
|
||||
'$static' => 'static',
|
||||
'@static' => 'static',
|
||||
],
|
||||
],
|
||||
'phpdoc_scalar' => [
|
||||
'types' => [
|
||||
'boolean',
|
||||
'callback',
|
||||
'double',
|
||||
'integer',
|
||||
'real',
|
||||
'str',
|
||||
],
|
||||
],
|
||||
'phpdoc_separation' => true,
|
||||
'phpdoc_single_line_var_spacing' => true,
|
||||
'phpdoc_summary' => false,
|
||||
'phpdoc_tag_casing' => ['tags' => ['inheritDoc']],
|
||||
'phpdoc_tag_type' => ['tags' => ['inheritDoc' => 'inline']],
|
||||
'phpdoc_to_comment' => false,
|
||||
'phpdoc_to_param_type' => false,
|
||||
'phpdoc_to_property_type' => false,
|
||||
'phpdoc_to_return_type' => false,
|
||||
'phpdoc_trim' => true,
|
||||
'phpdoc_trim_consecutive_blank_line_separation' => true,
|
||||
'phpdoc_types' => ['groups' => ['simple', 'alias', 'meta']],
|
||||
'phpdoc_types_order' => [
|
||||
'null_adjustment' => 'always_last',
|
||||
'sort_algorithm' => 'alpha',
|
||||
],
|
||||
'phpdoc_var_annotation_correct_order' => true,
|
||||
'phpdoc_var_without_name' => true,
|
||||
'pow_to_exponentiation' => true,
|
||||
'protected_to_private' => true,
|
||||
'psr_autoloading' => ['dir' => null],
|
||||
'random_api_migration' => [
|
||||
'replacements' => [
|
||||
'getrandmax' => 'mt_getrandmax',
|
||||
'rand' => 'mt_rand',
|
||||
'srand' => 'mt_srand',
|
||||
],
|
||||
],
|
||||
'regular_callable_call' => true,
|
||||
'return_assignment' => true,
|
||||
'return_type_declaration' => ['space_before' => 'none'],
|
||||
'self_accessor' => false,
|
||||
'self_static_accessor' => true,
|
||||
'semicolon_after_instruction' => false,
|
||||
'set_type_to_cast' => true,
|
||||
'short_scalar_cast' => true,
|
||||
'simple_to_complex_string_variable' => true,
|
||||
'simplified_if_return' => true,
|
||||
'simplified_null_return' => false,
|
||||
'single_blank_line_at_eof' => true,
|
||||
'single_blank_line_before_namespace' => true,
|
||||
'single_class_element_per_statement' => ['elements' => ['const', 'property']],
|
||||
'single_import_per_statement' => false,
|
||||
'single_line_after_imports' => true,
|
||||
'single_line_comment_style' => ['comment_types' => ['asterisk', 'hash']],
|
||||
'single_line_throw' => false,
|
||||
'single_quote' => ['strings_containing_single_quote_chars' => false],
|
||||
'single_space_after_construct' => [
|
||||
'constructs' => [
|
||||
'abstract',
|
||||
'as',
|
||||
'attribute',
|
||||
'break',
|
||||
'case',
|
||||
'catch',
|
||||
'class',
|
||||
'clone',
|
||||
'comment',
|
||||
'const',
|
||||
'const_import',
|
||||
'continue',
|
||||
'do',
|
||||
'echo',
|
||||
'else',
|
||||
'elseif',
|
||||
'extends',
|
||||
'final',
|
||||
'finally',
|
||||
'for',
|
||||
'foreach',
|
||||
'function',
|
||||
'function_import',
|
||||
'global',
|
||||
'goto',
|
||||
'if',
|
||||
'implements',
|
||||
'include',
|
||||
'include_once',
|
||||
'instanceof',
|
||||
'insteadof',
|
||||
'interface',
|
||||
'match',
|
||||
'named_argument',
|
||||
'new',
|
||||
'open_tag_with_echo',
|
||||
'php_doc',
|
||||
'php_open',
|
||||
'print',
|
||||
'private',
|
||||
'protected',
|
||||
'public',
|
||||
'require',
|
||||
'require_once',
|
||||
'return',
|
||||
'static',
|
||||
'throw',
|
||||
'trait',
|
||||
'try',
|
||||
'use',
|
||||
'use_lambda',
|
||||
'use_trait',
|
||||
'var',
|
||||
'while',
|
||||
'yield',
|
||||
'yield_from',
|
||||
],
|
||||
],
|
||||
'single_trait_insert_per_statement' => true,
|
||||
'space_after_semicolon' => ['remove_in_empty_for_expressions' => true],
|
||||
'standardize_increment' => true,
|
||||
'standardize_not_equals' => true,
|
||||
'static_lambda' => true,
|
||||
'strict_comparison' => true,
|
||||
'strict_param' => true,
|
||||
'string_length_to_empty' => true,
|
||||
'string_line_ending' => true,
|
||||
'switch_case_semicolon_to_colon' => true,
|
||||
'switch_case_space' => true,
|
||||
'switch_continue_to_break' => true,
|
||||
'ternary_operator_spaces' => true,
|
||||
'ternary_to_elvis_operator' => true,
|
||||
'ternary_to_null_coalescing' => true,
|
||||
'trailing_comma_in_multiline' => [
|
||||
'after_heredoc' => true,
|
||||
'elements' => ['arrays'],
|
||||
],
|
||||
'trim_array_spaces' => true,
|
||||
'types_spaces' => ['space' => 'none'],
|
||||
'unary_operator_spaces' => true,
|
||||
'use_arrow_functions' => true,
|
||||
'visibility_required' => ['elements' => ['const', 'method', 'property']],
|
||||
'void_return' => false, // changes method signature
|
||||
'whitespace_after_comma_in_array' => true,
|
||||
'yoda_style' => [
|
||||
'equal' => false,
|
||||
'identical' => null,
|
||||
'less_and_greater' => false,
|
||||
'always_move_variable' => false,
|
||||
],
|
||||
]);
|
|
@ -2,37 +2,28 @@
|
|||
"type": "project",
|
||||
"license": "proprietary",
|
||||
"require": {
|
||||
"php": "^8.1.0",
|
||||
"composer/package-versions-deprecated": "1.11.99.5",
|
||||
"doctrine/doctrine-bundle": "^2",
|
||||
"doctrine/doctrine-migrations-bundle": "^3.2.2",
|
||||
"doctrine/orm": "^2",
|
||||
"sensio/framework-extra-bundle": "^6.2.6",
|
||||
"symfony/form": "^6.0.3",
|
||||
"php": "^7.4.0",
|
||||
"sensio/framework-extra-bundle": "^5.2",
|
||||
"symfony/debug-pack": "^1.0",
|
||||
"symfony/form": "^5.1",
|
||||
"symfony/maker-bundle": "^1.0",
|
||||
"symfony/monolog-bundle": "^3.0",
|
||||
"symfony/translation": "^6.0.3",
|
||||
"symfony/twig-bundle": "^6.0",
|
||||
"symfony/validator": "^6.0.3",
|
||||
"symfony/yaml": "^6.0.3",
|
||||
"twig/twig": "^2.12|^3.0"
|
||||
"symfony/orm-pack": "^1.0",
|
||||
"symfony/translation": "^5.1",
|
||||
"symfony/twig-pack": "1.0.0",
|
||||
"symfony/validator": "^5.1",
|
||||
"symfony/yaml": "^5.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"roave/security-advisories": "dev-master",
|
||||
"symfony/dotenv": "^6.0.3",
|
||||
"symfony/flex": "^2.1.6",
|
||||
"symfony/stopwatch": "^6.0.3",
|
||||
"symfony/web-profiler-bundle": "^6.0"
|
||||
"symfony/debug": "^4.4.9",
|
||||
"symfony/dotenv": "^5.1",
|
||||
"symfony/flex": "^1.0"
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": {
|
||||
"*": "dist"
|
||||
},
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"symfony/flex": true
|
||||
}
|
||||
"sort-packages": true
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
6258
composer.lock
generated
6258
composer.lock
generated
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,13 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
return [
|
||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => TRUE],
|
||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => TRUE],
|
||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => TRUE],
|
||||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => TRUE],
|
||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => TRUE, 'test' => TRUE],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => TRUE],
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => TRUE],
|
||||
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => TRUE],
|
||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
||||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
|
||||
];
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
framework:
|
||||
cache:
|
||||
# Unique name of your app: used to compute stable namespaces for cache keys.
|
||||
#prefix_seed: your_vendor_name/app_name
|
||||
|
||||
# The "app" cache stores to the filesystem by default.
|
||||
# The data in this cache should persist between deploys.
|
||||
# Other options include:
|
||||
|
||||
# Redis
|
||||
#app: cache.adapter.redis
|
||||
#default_redis_provider: redis://localhost
|
||||
|
||||
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
|
||||
#app: cache.adapter.apcu
|
||||
|
||||
# Namespaced pools use the above "app" backend by default
|
||||
#pools:
|
||||
#my.dedicated.cache: null
|
4
config/packages/dev/debug.yaml
Normal file
4
config/packages/dev/debug.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
debug:
|
||||
# Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser.
|
||||
# See the "server:dump" command to start a new server.
|
||||
dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"
|
|
@ -24,7 +24,7 @@ doctrine:
|
|||
mappings:
|
||||
App:
|
||||
is_bundle: false
|
||||
type: attribute
|
||||
type: annotation
|
||||
dir: '%kernel.project_dir%/src/Entity'
|
||||
prefix: 'App\Entity'
|
||||
alias: App
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
doctrine_migrations:
|
||||
migrations_paths:
|
||||
- '%kernel.project_dir%/src/Migrations'
|
||||
dir_name: '%kernel.project_dir%/src/Migrations'
|
||||
# namespace is arbitrary but should be different from App\Migrations
|
||||
# as migrations classes should NOT be autoloaded
|
||||
# namespace: DoctrineMigrations
|
||||
namespace: DoctrineMigrations
|
||||
|
|
|
@ -9,7 +9,6 @@ framework:
|
|||
session:
|
||||
# With this config, PHP's native session handling is used
|
||||
handler_id: ~
|
||||
#storage_id: session.storage.factory.native
|
||||
|
||||
#esi: ~
|
||||
#fragments: ~
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
# As of Symfony 5.1, deprecations are logged in the dedicated "deprecation" channel when it exists
|
||||
#monolog:
|
||||
# channels: [deprecation]
|
||||
# handlers:
|
||||
# deprecation:
|
||||
# type: stream
|
||||
# channels: [deprecation]
|
||||
# path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
|
|
@ -1,3 +0,0 @@
|
|||
framework:
|
||||
router:
|
||||
strict_requirements: null
|
|
@ -1,2 +0,0 @@
|
|||
twig:
|
||||
strict_variables: true
|
|
@ -1,5 +0,0 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
if (file_exists(dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php')) {
|
||||
require dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php';
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
#index:
|
||||
# path: /
|
||||
# controller: App\Controller\DefaultController::index
|
|
@ -1,3 +0,0 @@
|
|||
_errors:
|
||||
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
|
||||
prefix: /_error
|
19
justfile
19
justfile
|
@ -1,19 +0,0 @@
|
|||
# Lists the available actions
|
||||
default:
|
||||
@just --list
|
||||
|
||||
# Runs rector, showing what changes will be make
|
||||
rector-dry-run:
|
||||
tools/vendor/bin/rector process --config=tools/rector.php --dry-run src
|
||||
|
||||
# Runs rector, and updates the files
|
||||
rector:
|
||||
tools/vendor/bin/rector process --config=tools/rector.php src
|
||||
|
||||
# Check code formatting
|
||||
check-fmt:
|
||||
tools/vendor/bin/php-cs-fixer fix --dry-run --verbose
|
||||
|
||||
# Fix code formatting
|
||||
fmt:
|
||||
tools/vendor/bin/php-cs-fixer fix --verbose
|
0
migrations/.gitignore
vendored
0
migrations/.gitignore
vendored
|
@ -1,42 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
convertDeprecationsToExceptions="false"
|
||||
>
|
||||
<php>
|
||||
<ini name="display_errors" value="1" />
|
||||
<ini name="error_reporting" value="-1" />
|
||||
<server name="APP_ENV" value="test" force="true" />
|
||||
<server name="SHELL_VERBOSITY" value="-1" />
|
||||
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
|
||||
<server name="SYMFONY_PHPUNIT_VERSION" value="9.5" />
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="Project Test Suite">
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<coverage processUncoveredFiles="true">
|
||||
<include>
|
||||
<directory suffix=".php">src</directory>
|
||||
</include>
|
||||
</coverage>
|
||||
|
||||
<listeners>
|
||||
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
|
||||
</listeners>
|
||||
|
||||
<!-- Run `composer require symfony/panther` before enabling this extension -->
|
||||
<!--
|
||||
<extensions>
|
||||
<extension class="Symfony\Component\Panther\ServerExtension" />
|
||||
</extensions>
|
||||
-->
|
||||
</phpunit>
|
|
@ -1,15 +1,13 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
use App\Kernel;
|
||||
use Symfony\Component\Dotenv\Dotenv;
|
||||
use Symfony\Component\ErrorHandler\Debug;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
require dirname(__DIR__).'/vendor/autoload.php';
|
||||
|
||||
(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env');
|
||||
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
|
||||
|
||||
if ($_SERVER['APP_DEBUG']) {
|
||||
umask(0000);
|
||||
|
@ -17,11 +15,11 @@ if ($_SERVER['APP_DEBUG']) {
|
|||
Debug::enable();
|
||||
}
|
||||
|
||||
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? FALSE) {
|
||||
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) {
|
||||
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST);
|
||||
}
|
||||
|
||||
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? FALSE) {
|
||||
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) {
|
||||
Request::setTrustedHosts([$trustedHosts]);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<?php
|
||||
|
||||
if (file_exists(__DIR__.'/../var/cache/dev/App_KernelDevDebugContainer.preload.php')) {
|
||||
require __DIR__.'/../var/cache/dev/App_KernelDevDebugContainer.preload.php';
|
||||
}
|
0
src/Controller/.gitignore
vendored
0
src/Controller/.gitignore
vendored
|
@ -5,17 +5,18 @@ namespace App\Controller;
|
|||
use App\Entity\Camera;
|
||||
use App\Form\CameraType;
|
||||
use Doctrine\ORM\ORMInvalidArgumentException;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use LogicException;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Camera controller.
|
||||
*
|
||||
* @Route("camera")
|
||||
*/
|
||||
#[Route(path: 'camera')]
|
||||
class CameraController extends AbstractController
|
||||
{
|
||||
use FormControllerTrait;
|
||||
|
@ -23,19 +24,17 @@ class CameraController extends AbstractController
|
|||
protected const ENTITY = Camera::class;
|
||||
protected const FORM = CameraType::class;
|
||||
|
||||
public function __construct(private readonly ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all camera entities.
|
||||
*
|
||||
* @Route("/", name="camera_index", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/', name: 'camera_index', methods: ['GET'])]
|
||||
public function indexAction(): Response
|
||||
{
|
||||
$em = $this->managerRegistry->getManager();
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$receivedItems = $em->getRepository(self::ENTITY)->findBy([
|
||||
'received' => TRUE,
|
||||
'received' => true
|
||||
], [
|
||||
'isWorking' => 'ASC',
|
||||
'brand' => 'ASC',
|
||||
|
@ -43,12 +42,13 @@ class CameraController extends AbstractController
|
|||
'model' => 'ASC',
|
||||
]);
|
||||
$newItems = $em->getRepository(self::ENTITY)->findBy([
|
||||
'received' => FALSE,
|
||||
'received' => false
|
||||
], [
|
||||
'brand' => 'ASC',
|
||||
'mount' => 'ASC',
|
||||
'model' => 'ASC',
|
||||
]);
|
||||
|
||||
$working = array_filter($receivedItems, [$this, 'isWorking']);
|
||||
$notWorking = array_filter($receivedItems, [$this, 'isNotWorking']);
|
||||
|
||||
|
@ -61,18 +61,20 @@ class CameraController extends AbstractController
|
|||
|
||||
/**
|
||||
* Creates a new camera entity.
|
||||
*
|
||||
* @Route("/new", name="camera_new", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/new', name: 'camera_new', methods: ['GET', 'POST'])]
|
||||
public function newAction(Request $request): RedirectResponse|Response
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
return $this->itemCreate($request, 'camera/new.html.twig', 'camera', 'camera_show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a camera entity.
|
||||
*
|
||||
* @Route("/{id}", name="camera_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'camera_show', methods: ['GET'])]
|
||||
public function showAction(Camera $camera): Response
|
||||
public function showAction(Camera $camera)
|
||||
{
|
||||
return $this->itemView($camera, 'camera/show.html.twig', 'camera');
|
||||
}
|
||||
|
@ -80,10 +82,10 @@ class CameraController extends AbstractController
|
|||
/**
|
||||
* Displays a form to edit an existing camera entity.
|
||||
*
|
||||
* @throws LogicException
|
||||
* @Route("/{id}/edit", name="camera_edit", methods={"GET", "POST"})
|
||||
* @throws \LogicException
|
||||
*/
|
||||
#[Route(path: '/{id}/edit', name: 'camera_edit', methods: ['GET', 'POST'])]
|
||||
public function editAction(Request $request, Camera $camera): RedirectResponse|Response
|
||||
public function editAction(Request $request, Camera $camera)
|
||||
{
|
||||
return $this->itemUpdate($request, $camera, 'camera/edit.html.twig', 'camera', 'camera_show');
|
||||
}
|
||||
|
@ -91,9 +93,9 @@ class CameraController extends AbstractController
|
|||
/**
|
||||
* Deletes a camera entity.
|
||||
*
|
||||
* @throws LogicException
|
||||
* @Route("/{id}", name="camera_delete", methods={"DELETE"})
|
||||
* @throws \LogicException
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'camera_delete', methods: ['DELETE'])]
|
||||
public function deleteAction(Request $request, Camera $camera): RedirectResponse
|
||||
{
|
||||
return $this->itemDelete($request, $camera, 'camera_index');
|
||||
|
@ -102,10 +104,13 @@ class CameraController extends AbstractController
|
|||
/**
|
||||
* Moves a camera to the previouslyOwned table
|
||||
*
|
||||
* @throws LogicException
|
||||
* @Route("/{id}/deacquire", name="camera_deacquire", methods={"POST"})
|
||||
* @param Request $request
|
||||
* @param Camera $camera
|
||||
* @throws \LogicException
|
||||
* @throws ORMInvalidArgumentException
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/{id}/deacquire', name: 'camera_deacquire', methods: ['POST'])]
|
||||
public function deacquireAction(Request $request, Camera $camera): RedirectResponse
|
||||
{
|
||||
return $this->itemDeacquire($request, $camera, 'previously-owned-camera_index');
|
||||
|
@ -127,6 +132,8 @@ class CameraController extends AbstractController
|
|||
* Creates a form to move
|
||||
*
|
||||
* @param Camera $camera The camera entity
|
||||
*
|
||||
* @return FormInterface
|
||||
*/
|
||||
private function createDeacquireForm(Camera $camera): FormInterface
|
||||
{
|
||||
|
@ -140,6 +147,6 @@ class CameraController extends AbstractController
|
|||
|
||||
private function isNotWorking(Camera $camera): bool
|
||||
{
|
||||
return ! $this->isWorking($camera);
|
||||
return !$this->isWorking($camera);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,13 +4,15 @@ namespace App\Controller;
|
|||
|
||||
use App\Entity\CameraType;
|
||||
use App\Form\CameraTypeType;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
#[Route(path: 'camera-type')]
|
||||
/**
|
||||
* Cameratype controller.
|
||||
*
|
||||
* @Route("camera-type")
|
||||
*/
|
||||
class CameraTypeController extends AbstractController
|
||||
{
|
||||
use FormControllerTrait;
|
||||
|
@ -18,15 +20,12 @@ class CameraTypeController extends AbstractController
|
|||
protected const ENTITY = CameraType::class;
|
||||
protected const FORM = CameraTypeType::class;
|
||||
|
||||
public function __construct(private readonly ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all cameraType entities.
|
||||
*
|
||||
* @Route("/", name="camera-type_index", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/', name: 'camera-type_index', methods: ['GET'])]
|
||||
public function indexAction(): Response
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->itemListView('cameratype/index.html.twig', 'cameraTypes', [
|
||||
'type' => 'ASC',
|
||||
|
@ -35,44 +34,52 @@ class CameraTypeController extends AbstractController
|
|||
|
||||
/**
|
||||
* Creates a new cameraType entity.
|
||||
*
|
||||
* @Route("/new", name="camera-type_new", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/new', name: 'camera-type_new', methods: ['GET', 'POST'])]
|
||||
public function newAction(Request $request): Response
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
return $this->itemCreate($request, 'cameratype/new.html.twig', 'cameraType', 'camera-type_show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a cameraType entity.
|
||||
*
|
||||
* @Route("/{id}", name="camera-type_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'camera-type_show', methods: ['GET'])]
|
||||
public function showAction(CameraType $cameraType): Response
|
||||
public function showAction(CameraType $cameraType)
|
||||
{
|
||||
return $this->itemView($cameraType, 'cameratype/show.html.twig', 'cameraType');
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing cameraType entity.
|
||||
*
|
||||
* @Route("/{id}/edit", name="camera-type_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/{id}/edit', name: 'camera-type_edit', methods: ['GET', 'POST'])]
|
||||
public function editAction(Request $request, CameraType $cameraType): RedirectResponse|Response
|
||||
public function editAction(Request $request, CameraType $cameraType)
|
||||
{
|
||||
return $this->itemUpdate($request, $cameraType, 'cameratype/edit.html.twig', 'cameraType', 'camera-type_show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a cameraType entity.
|
||||
*
|
||||
* @Route("/{id}", name="camera-type_delete", methods={"DELETE"})
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'camera-type_delete', methods: ['DELETE'])]
|
||||
public function deleteAction(Request $request, CameraType $cameraType): RedirectResponse
|
||||
public function deleteAction(Request $request, CameraType $cameraType)
|
||||
{
|
||||
return $this->itemDelete($request, $cameraType, 'camera-type_index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a form to delete a cameraType entity.
|
||||
*
|
||||
* @param CameraType $cameraType The cameraType entity
|
||||
*
|
||||
* @return \Symfony\Component\Form\Form The form
|
||||
*/
|
||||
private function createDeleteForm(CameraType $cameraType): FormInterface
|
||||
private function createDeleteForm(CameraType $cameraType)
|
||||
{
|
||||
return $this->buildForm($cameraType, 'camera-type_delete', 'DELETE');
|
||||
}
|
||||
|
|
|
@ -3,12 +3,15 @@
|
|||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\{Request, Response};
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class DefaultController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/', name: 'homepage')]
|
||||
/**
|
||||
* @Route("/", name="homepage")
|
||||
*/
|
||||
public function indexAction(Request $request): Response
|
||||
{
|
||||
// replace this example code with whatever you need
|
||||
|
|
|
@ -5,17 +5,17 @@ namespace App\Controller;
|
|||
use App\Entity\Film;
|
||||
use App\Form\FilmType;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use LogicException;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Film controller.
|
||||
*
|
||||
* @Route("film")
|
||||
*/
|
||||
#[Route(path: 'film')]
|
||||
class FilmController extends AbstractController
|
||||
{
|
||||
use FormControllerTrait;
|
||||
|
@ -23,17 +23,16 @@ class FilmController extends AbstractController
|
|||
protected const ENTITY = Film::class;
|
||||
protected const FORM = FilmType::class;
|
||||
|
||||
public function __construct(private readonly ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all film entities.
|
||||
*
|
||||
* @Route("/", name="film_index", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/', name: 'film_index', methods: ['GET'])]
|
||||
public function indexAction(): Response
|
||||
{
|
||||
$repo = $this->managerRegistry->getManager()->getRepository(self::ENTITY);
|
||||
|
||||
$repo = $this->getDoctrine()->getManager()->getRepository(self::ENTITY);
|
||||
|
||||
$criteria = Criteria::create()
|
||||
->where(Criteria::expr()->gt('rollsInCamera', 0))
|
||||
->orderBy([
|
||||
|
@ -42,7 +41,9 @@ class FilmController extends AbstractController
|
|||
'rollsInCamera' => Criteria::DESC,
|
||||
'productLine' => Criteria::ASC,
|
||||
]);
|
||||
|
||||
$inCamera = $repo->matching($criteria);
|
||||
|
||||
$notInCamera = $repo->findBy([
|
||||
'rollsInCamera' => 0,
|
||||
], [
|
||||
|
@ -59,18 +60,20 @@ class FilmController extends AbstractController
|
|||
|
||||
/**
|
||||
* Creates a new film entity.
|
||||
*
|
||||
* @Route("/new", name="film_new", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/new', name: 'film_new', methods: ['GET', 'POST'])]
|
||||
public function newAction(Request $request): RedirectResponse|Response
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
return $this->itemCreate($request, 'film/new.html.twig', 'film', 'film_show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a film entity.
|
||||
*
|
||||
* @Route("/{id}", name="film_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'film_show', methods: ['GET'])]
|
||||
public function showAction(Film $film): Response
|
||||
public function showAction(Film $film)
|
||||
{
|
||||
return $this->itemView($film, 'film/show.html.twig', 'film');
|
||||
}
|
||||
|
@ -78,10 +81,10 @@ class FilmController extends AbstractController
|
|||
/**
|
||||
* Displays a form to edit an existing film entity.
|
||||
*
|
||||
* @throws LogicException
|
||||
* @Route("/{id}/edit", name="film_edit", methods={"GET", "POST"})
|
||||
* @throws \LogicException
|
||||
*/
|
||||
#[Route(path: '/{id}/edit', name: 'film_edit', methods: ['GET', 'POST'])]
|
||||
public function editAction(Request $request, Film $film): RedirectResponse|Response
|
||||
public function editAction(Request $request, Film $film)
|
||||
{
|
||||
return $this->itemUpdate($request, $film, 'film/edit.html.twig', 'film', 'film_show');
|
||||
}
|
||||
|
@ -89,10 +92,10 @@ class FilmController extends AbstractController
|
|||
/**
|
||||
* Deletes a film entity.
|
||||
*
|
||||
* @throws LogicException
|
||||
* @Route("/{id}", name="film_delete", methods={"DELETE"})
|
||||
* @throws \LogicException
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'film_delete', methods: ['DELETE'])]
|
||||
public function deleteAction(Request $request, Film $film): RedirectResponse
|
||||
public function deleteAction(Request $request, Film $film)
|
||||
{
|
||||
return $this->itemDelete($request, $film, 'film_index');
|
||||
}
|
||||
|
|
|
@ -4,16 +4,15 @@ namespace App\Controller;
|
|||
|
||||
use App\Entity\Flash;
|
||||
use App\Form\FlashType;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Flash controller.
|
||||
*
|
||||
* @Route("flash")
|
||||
*/
|
||||
#[Route(path: 'flash')]
|
||||
class FlashController extends AbstractController
|
||||
{
|
||||
use FormControllerTrait;
|
||||
|
@ -21,59 +20,64 @@ class FlashController extends AbstractController
|
|||
protected const ENTITY = Flash::class;
|
||||
protected const FORM = FlashType::class;
|
||||
|
||||
public function __construct(private readonly ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all flash entities.
|
||||
*
|
||||
* @Route("/", name="flash_index", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/', name: 'flash_index', methods: ['GET'])]
|
||||
public function indexAction(): Response
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->itemListView('flash/index.html.twig', 'flashes');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new flash entity.
|
||||
*
|
||||
* @Route("/new", name="flash_new", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/new', name: 'flash_new', methods: ['GET', 'POST'])]
|
||||
public function newAction(Request $request): RedirectResponse|Response
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
return $this->itemCreate($request, 'flash/new.html.twig', 'flash', 'flash_show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a flash entity.
|
||||
*
|
||||
* @Route("/{id}", name="flash_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'flash_show', methods: ['GET'])]
|
||||
public function showAction(Flash $flash): Response
|
||||
public function showAction(Flash $flash)
|
||||
{
|
||||
return $this->itemView($flash, 'flash/show.html.twig', 'flash');
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing flash entity.
|
||||
*
|
||||
* @Route("/{id}/edit", name="flash_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/{id}/edit', name: 'flash_edit', methods: ['GET', 'POST'])]
|
||||
public function editAction(Request $request, Flash $flash): RedirectResponse|Response
|
||||
public function editAction(Request $request, Flash $flash)
|
||||
{
|
||||
return $this->itemUpdate($request, $flash, 'flash/edit.html.twig', 'flash', 'flash_show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a flash entity.
|
||||
*
|
||||
* @Route("/{id}", name="flash_delete", methods={"DELETE"})
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'flash_delete', methods: ['DELETE'])]
|
||||
public function deleteAction(Request $request, Flash $flash): RedirectResponse
|
||||
public function deleteAction(Request $request, Flash $flash)
|
||||
{
|
||||
return $this->itemDelete($request, $flash, 'flash_index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a form to delete a flash entity.
|
||||
*
|
||||
* @param Flash $flash The flash entity
|
||||
*
|
||||
* @return \Symfony\Component\Form\FormInterface The form
|
||||
*/
|
||||
private function createDeleteForm(Flash $flash): FormInterface
|
||||
private function createDeleteForm(Flash $flash)
|
||||
{
|
||||
return $this->buildForm($flash, 'flash_delete', 'DELETE');
|
||||
}
|
||||
|
|
|
@ -2,18 +2,12 @@
|
|||
|
||||
namespace App\Controller;
|
||||
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
|
||||
|
||||
trait FormControllerTrait
|
||||
{
|
||||
private readonly ManagerRegistry $managerRegistry;
|
||||
use Symfony\Component\HttpFoundation\{Request, Response, RedirectResponse};
|
||||
|
||||
trait FormControllerTrait {
|
||||
/**
|
||||
* Create a form generator
|
||||
*
|
||||
* @param mixed $item
|
||||
*/
|
||||
protected function buildForm($item, string $actionRoute, string $method = 'POST'): FormInterface
|
||||
{
|
||||
|
@ -29,12 +23,13 @@ trait FormControllerTrait
|
|||
protected function itemCreate(Request $request, string $template, string $templateKey, string $redirectRoute)
|
||||
{
|
||||
$Entity = self::ENTITY;
|
||||
$item = new $Entity();
|
||||
$item = new $Entity;
|
||||
$form = $this->createForm(self::FORM, $item);
|
||||
$form->handleRequest($request);
|
||||
|
||||
// If creating the item
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
if ($form->isSubmitted() && $form->isValid())
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($item);
|
||||
$em->flush();
|
||||
|
@ -54,7 +49,7 @@ trait FormControllerTrait
|
|||
*/
|
||||
protected function itemListView(string $template, string $templateKey, array $sort = []): Response
|
||||
{
|
||||
$em = $this->managerRegistry->getManager();
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$items = $em->getRepository(self::ENTITY)->findBy([], $sort);
|
||||
|
||||
|
@ -65,8 +60,6 @@ trait FormControllerTrait
|
|||
|
||||
/**
|
||||
* View details for a specific item
|
||||
*
|
||||
* @param mixed $item
|
||||
*/
|
||||
protected function itemView($item, string $template, string $templateKey): Response
|
||||
{
|
||||
|
@ -84,8 +77,6 @@ trait FormControllerTrait
|
|||
|
||||
/**
|
||||
* Show edit form / update an item
|
||||
*
|
||||
* @param mixed $item
|
||||
*/
|
||||
protected function itemUpdate(Request $request, $item, string $template, string $templateKey, string $redirectRoute)
|
||||
{
|
||||
|
@ -93,7 +84,8 @@ trait FormControllerTrait
|
|||
$editForm->handleRequest($request);
|
||||
|
||||
// If updating the item
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
if ($editForm->isSubmitted() && $editForm->isValid())
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($item);
|
||||
$em->flush();
|
||||
|
@ -107,17 +99,20 @@ trait FormControllerTrait
|
|||
'edit_form' => $editForm->createView(),
|
||||
];
|
||||
|
||||
if (method_exists($this, 'createDeleteForm')) {
|
||||
if (method_exists($this, 'createDeleteForm'))
|
||||
{
|
||||
$deleteForm = $this->createDeleteForm($item);
|
||||
$templateData['delete_form'] = $deleteForm->createView();
|
||||
}
|
||||
|
||||
if (method_exists($this, 'createDeacquireForm')) {
|
||||
if (method_exists($this, 'createDeacquireForm'))
|
||||
{
|
||||
$deacquireForm = $this->createDeacquireForm($item);
|
||||
$templateData['deacquire_form'] = $deacquireForm->createView();
|
||||
}
|
||||
|
||||
if (method_exists($this, 'createReacquireForm')) {
|
||||
if (method_exists($this, 'createReacquireForm'))
|
||||
{
|
||||
$reacquireForm = $this->createReacquireForm($item);
|
||||
$templateData['reacquire_form'] = $reacquireForm->createView();
|
||||
}
|
||||
|
@ -127,8 +122,6 @@ trait FormControllerTrait
|
|||
|
||||
/**
|
||||
* Move an item to a previously_owned table
|
||||
*
|
||||
* @param mixed $item
|
||||
*/
|
||||
protected function itemDeacquire(Request $request, $item, string $redirectRoute): RedirectResponse
|
||||
{
|
||||
|
@ -143,8 +136,6 @@ trait FormControllerTrait
|
|||
|
||||
/**
|
||||
* Move an item from a previously_owned table back to the original table
|
||||
*
|
||||
* @param mixed $item
|
||||
*/
|
||||
protected function itemReacquire(Request $request, $item, string $redirectRoute): RedirectResponse
|
||||
{
|
||||
|
@ -159,8 +150,6 @@ trait FormControllerTrait
|
|||
|
||||
/**
|
||||
* Actually delete an item
|
||||
*
|
||||
* @param mixed $item
|
||||
*/
|
||||
protected function itemDelete(Request $request, $item, string $redirectRoute): RedirectResponse
|
||||
{
|
||||
|
@ -168,10 +157,11 @@ trait FormControllerTrait
|
|||
$form->handleRequest($request);
|
||||
|
||||
// if ($form->isSubmitted() && $form->isValid())
|
||||
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->remove($item);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute($redirectRoute);
|
||||
}
|
||||
|
|
|
@ -4,16 +4,16 @@ namespace App\Controller;
|
|||
|
||||
use App\Entity\Lenses;
|
||||
use App\Form\LensesType;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\{Request, RedirectResponse};
|
||||
|
||||
/**
|
||||
* Lens controller.
|
||||
*
|
||||
* @Route("lens")
|
||||
*/
|
||||
#[Route(path: 'lens')]
|
||||
class LensesController extends AbstractController
|
||||
{
|
||||
use FormControllerTrait;
|
||||
|
@ -21,19 +21,17 @@ class LensesController extends AbstractController
|
|||
protected const ENTITY = Lenses::class;
|
||||
protected const FORM = LensesType::class;
|
||||
|
||||
public function __construct(private readonly ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all lens entities.
|
||||
*
|
||||
* @Route("/", name="lens_index", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/', name: 'lens_index', methods: ['GET'])]
|
||||
public function indexAction(): Response
|
||||
public function indexAction()
|
||||
{
|
||||
$em = $this->managerRegistry->getManager();
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$receivedItems = $em->getRepository(self::ENTITY)->findBy([
|
||||
'received' => TRUE,
|
||||
'received' => true
|
||||
], [
|
||||
'brand' => 'ASC',
|
||||
'productLine' => 'ASC',
|
||||
|
@ -42,7 +40,7 @@ class LensesController extends AbstractController
|
|||
'maxFStop' => 'ASC',
|
||||
]);
|
||||
$newItems = $em->getRepository(self::ENTITY)->findBy([
|
||||
'received' => FALSE,
|
||||
'received' => false
|
||||
], [
|
||||
'brand' => 'ASC',
|
||||
'productLine' => 'ASC',
|
||||
|
@ -59,27 +57,30 @@ class LensesController extends AbstractController
|
|||
|
||||
/**
|
||||
* Creates a new lens entity.
|
||||
*
|
||||
* @Route("/new", name="lens_new", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/new', name: 'lens_new', methods: ['GET', 'POST'])]
|
||||
public function newAction(Request $request): RedirectResponse|Response
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
return $this->itemCreate($request, 'lenses/new.html.twig', 'lense', 'lens_show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a lens entity.
|
||||
*
|
||||
* @Route("/{id}", name="lens_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'lens_show', methods: ['GET'])]
|
||||
public function showAction(Lenses $lens): Response
|
||||
public function showAction(Lenses $lens)
|
||||
{
|
||||
return $this->itemView($lens, 'lenses/show.html.twig', 'lense');
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing lens entity.
|
||||
*
|
||||
* @Route("/{id}/edit", name="lens_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/{id}/edit', name: 'lens_edit', methods: ['GET', 'POST'])]
|
||||
public function editAction(Request $request, Lenses $lens): RedirectResponse|Response
|
||||
public function editAction(Request $request, Lenses $lens)
|
||||
{
|
||||
return $this->itemUpdate($request, $lens, 'lenses/edit.html.twig', 'lense', 'lens_show');
|
||||
}
|
||||
|
@ -87,21 +88,22 @@ class LensesController extends AbstractController
|
|||
/**
|
||||
* Moves a camera to the previouslyOwned table
|
||||
*
|
||||
* @Route("/{id}/deacquire", name="lens_deacquire", methods={"POST"})
|
||||
* @param Request $request
|
||||
*
|
||||
* @param Lenses $lens
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/{id}/deacquire', name: 'lens_deacquire', methods: ['POST'])]
|
||||
public function deacquireAction(Request $request, Lenses $lens): RedirectResponse
|
||||
public function deacquireAction(Request $request, Lenses $lens)
|
||||
{
|
||||
return $this->itemDeacquire($request, $lens, 'previously-owned-lens_index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a lens entity.
|
||||
*
|
||||
* @Route("/{id}", name="lens_delete", methods={"DELETE"})
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'lens_delete', methods: ['DELETE'])]
|
||||
public function deleteAction(Request $request, Lenses $lens): RedirectResponse
|
||||
public function deleteAction(Request $request, Lenses $lens)
|
||||
{
|
||||
return $this->itemDelete($request, $lens, 'lens_index');
|
||||
}
|
||||
|
@ -118,10 +120,13 @@ class LensesController extends AbstractController
|
|||
return $this->buildForm($lens, 'lens_delete', 'DELETE');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a form to move
|
||||
*
|
||||
* @param Lenses $lens The lens entity
|
||||
*
|
||||
* @return FormInterface
|
||||
*/
|
||||
private function createDeacquireForm(Lenses $lens): FormInterface
|
||||
{
|
||||
|
|
|
@ -4,19 +4,16 @@ namespace App\Controller;
|
|||
|
||||
use App\Entity\PreviouslyOwnedCamera;
|
||||
use App\Form\PreviouslyOwnedCameraType;
|
||||
use Doctrine\ORM\ORMInvalidArgumentException;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use LogicException;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use UnexpectedValueException;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\{RedirectResponse, Request};
|
||||
|
||||
/**
|
||||
* Previouslyownedcamera controller.
|
||||
*
|
||||
* @Route("previously-owned-camera")
|
||||
*/
|
||||
#[Route(path: 'previously-owned-camera')]
|
||||
class PreviouslyOwnedCameraController extends AbstractController
|
||||
{
|
||||
use FormControllerTrait;
|
||||
|
@ -24,17 +21,13 @@ class PreviouslyOwnedCameraController extends AbstractController
|
|||
protected const ENTITY = PreviouslyOwnedCamera::class;
|
||||
protected const FORM = PreviouslyOwnedCameraType::class;
|
||||
|
||||
public function __construct(private readonly ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all previouslyOwnedCamera entities.
|
||||
*
|
||||
* @throws UnexpectedValueException
|
||||
* @Route("/", name="previously-owned-camera_index", methods={"GET"})
|
||||
* @throws \UnexpectedValueException
|
||||
*/
|
||||
#[Route(path: '/', name: 'previously-owned-camera_index', methods: ['GET'])]
|
||||
public function indexAction(): Response
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->itemListView('previouslyownedcamera/index.html.twig', 'previouslyOwnedCameras', [
|
||||
'brand' => 'ASC',
|
||||
|
@ -45,9 +38,10 @@ class PreviouslyOwnedCameraController extends AbstractController
|
|||
|
||||
/**
|
||||
* Finds and displays a previouslyOwnedCamera entity.
|
||||
*
|
||||
* @Route("/{id}", name="previously-owned-camera_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'previously-owned-camera_show', methods: ['GET'])]
|
||||
public function showAction(PreviouslyOwnedCamera $previouslyOwnedCamera): Response
|
||||
public function showAction(PreviouslyOwnedCamera $previouslyOwnedCamera)
|
||||
{
|
||||
return $this->itemView($previouslyOwnedCamera, 'previouslyownedcamera/show.html.twig', 'previouslyOwnedCamera');
|
||||
}
|
||||
|
@ -55,10 +49,10 @@ class PreviouslyOwnedCameraController extends AbstractController
|
|||
/**
|
||||
* Displays a form to edit an existing previouslyOwnedCamera entity.
|
||||
*
|
||||
* @throws LogicException
|
||||
* @Route("/{id}/edit", name="previously-owned-camera_edit", methods={"GET", "POST"})
|
||||
* @throws \LogicException
|
||||
*/
|
||||
#[Route(path: '/{id}/edit', name: 'previously-owned-camera_edit', methods: ['GET', 'POST'])]
|
||||
public function editAction(Request $request, PreviouslyOwnedCamera $previouslyOwnedCamera): RedirectResponse|Response
|
||||
public function editAction(Request $request, PreviouslyOwnedCamera $previouslyOwnedCamera)
|
||||
{
|
||||
return $this->itemUpdate($request, $previouslyOwnedCamera, 'previouslyownedcamera/edit.html.twig', 'previouslyOwnedCamera', 'previously-owned-camera_show');
|
||||
}
|
||||
|
@ -66,23 +60,25 @@ class PreviouslyOwnedCameraController extends AbstractController
|
|||
/**
|
||||
* Moves a camera to the previouslyOwned table
|
||||
*
|
||||
* @Route("/{id}/reacquire", name="previously-owned-camera_reacquire", methods={"POST"})
|
||||
* @param Request $request
|
||||
*
|
||||
* @throws LogicException
|
||||
* @throws ORMInvalidArgumentException
|
||||
*
|
||||
* @param PreviouslyOwnedCamera $camera
|
||||
* @throws \LogicException
|
||||
* @throws \Doctrine\ORM\ORMInvalidArgumentException
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/{id}/reacquire', name: 'previously-owned-camera_reacquire', methods: ['POST'])]
|
||||
public function reacquireAction(Request $request, PreviouslyOwnedCamera $camera): RedirectResponse
|
||||
{
|
||||
return $this->itemReacquire($request, $camera, 'camera_index');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a form to move
|
||||
*
|
||||
* @param PreviouslyOwnedCamera $camera The camera entity
|
||||
*
|
||||
* @return FormInterface
|
||||
*/
|
||||
private function createReacquireForm(PreviouslyOwnedCamera $camera): FormInterface
|
||||
{
|
||||
|
|
|
@ -4,58 +4,57 @@ namespace App\Controller;
|
|||
|
||||
use App\Entity\PreviouslyOwnedFlash;
|
||||
use App\Form\PreviouslyOwnedFlashType;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Previouslyownedflash controller.
|
||||
*
|
||||
* @Route("previously-owned-flash")
|
||||
*/
|
||||
#[Route(path: 'previously-owned-flash')]
|
||||
class PreviouslyOwnedFlashController extends AbstractController
|
||||
{
|
||||
use FormControllerTrait;
|
||||
|
||||
protected const ENTITY = PreviouslyOwnedFlash::class;
|
||||
protected const FORM = PreviouslyOwnedFlashType::class;
|
||||
|
||||
public function __construct(private readonly ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all previouslyOwnedFlash entities.
|
||||
*
|
||||
* @Route("/", name="previously-owned-flash_index", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/', name: 'previously-owned-flash_index', methods: ['GET'])]
|
||||
public function indexAction(): Response
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->itemListView('previouslyownedflash/index.html.twig', 'previouslyOwnedFlashes');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new previouslyOwnedFlash entity.
|
||||
*
|
||||
* @Route("/new", name="previously-owned-flash_new", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/new', name: 'previously-owned-flash_new', methods: ['GET', 'POST'])]
|
||||
public function newAction(Request $request): RedirectResponse|Response
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
return $this->itemCreate($request, 'previouslyownedflash/new.html.twig', 'previouslyOwnedFlash', 'previously-owned-flash_show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a previouslyOwnedFlash entity.
|
||||
*
|
||||
* @Route("/{id}", name="previously-owned-flash_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'previously-owned-flash_show', methods: ['GET'])]
|
||||
public function showAction(PreviouslyOwnedFlash $previouslyOwnedFlash): Response
|
||||
public function showAction(PreviouslyOwnedFlash $previouslyOwnedFlash)
|
||||
{
|
||||
return $this->itemView($previouslyOwnedFlash, 'previouslyownedcamera/show.html.twig', 'previouslyOwnedFlash');
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing previouslyOwnedFlash entity.
|
||||
*
|
||||
* @Route("/{id}/edit", name="previously-owned-flash_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/{id}/edit', name: 'previously-owned-flash_edit', methods: ['GET', 'POST'])]
|
||||
public function editAction(Request $request, PreviouslyOwnedFlash $previouslyOwnedFlash): RedirectResponse|Response
|
||||
public function editAction(Request $request, PreviouslyOwnedFlash $previouslyOwnedFlash)
|
||||
{
|
||||
return $this->itemUpdate($request, $previouslyOwnedFlash, 'previouslyownedflash/edit.html.twig', 'previouslyOwnedFlash', 'previously-owned-flash_show');
|
||||
}
|
||||
|
|
|
@ -4,12 +4,13 @@ namespace App\Controller;
|
|||
|
||||
use App\Entity\PreviouslyOwnedLenses;
|
||||
use App\Form\PreviouslyOwnedLensesType;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\{RedirectResponse, Request, Response};
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
#[Route(path: 'previously-owned-lens')]
|
||||
/**
|
||||
* @Route("previously-owned-lens")
|
||||
*/
|
||||
class PreviouslyOwnedLensesController extends AbstractController
|
||||
{
|
||||
use FormControllerTrait;
|
||||
|
@ -17,15 +18,12 @@ class PreviouslyOwnedLensesController extends AbstractController
|
|||
protected const ENTITY = PreviouslyOwnedLenses::class;
|
||||
protected const FORM = PreviouslyOwnedLensesType::class;
|
||||
|
||||
public function __construct(private readonly ManagerRegistry $managerRegistry)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all previouslyOwnedLense entities.
|
||||
*
|
||||
* @Route("/", name="previously-owned-lens_index", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/', name: 'previously-owned-lens_index', methods: ['GET'])]
|
||||
public function indexAction(): Response
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->itemListView('previouslyownedlenses/index.html.twig', 'previouslyOwnedLenses', [
|
||||
'brand' => 'ASC',
|
||||
|
@ -38,18 +36,20 @@ class PreviouslyOwnedLensesController extends AbstractController
|
|||
|
||||
/**
|
||||
* Finds and displays a previouslyOwnedLense entity.
|
||||
*
|
||||
* @Route("/{id}", name="previously-owned-lens_show", methods={"GET"})
|
||||
*/
|
||||
#[Route(path: '/{id}', name: 'previously-owned-lens_show', methods: ['GET'])]
|
||||
public function showAction(PreviouslyOwnedLenses $previouslyOwnedLens): Response
|
||||
public function showAction(PreviouslyOwnedLenses $previouslyOwnedLens)
|
||||
{
|
||||
return $this->itemView($previouslyOwnedLens, 'previouslyownedlenses/show.html.twig', 'previouslyOwnedLense');
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing previouslyOwnedLense entity.
|
||||
*
|
||||
* @Route("/{id}/edit", name="previously-owned-lens_edit", methods={"GET", "POST"})
|
||||
*/
|
||||
#[Route(path: '/{id}/edit', name: 'previously-owned-lens_edit', methods: ['GET', 'POST'])]
|
||||
public function editAction(Request $request, PreviouslyOwnedLenses $previouslyOwnedLens): RedirectResponse|Response
|
||||
public function editAction(Request $request, PreviouslyOwnedLenses $previouslyOwnedLens)
|
||||
{
|
||||
return $this->itemUpdate($request, $previouslyOwnedLens, 'previouslyownedlenses/edit.html.twig', 'previouslyOwnedLense', 'previously-owned-lens_show');
|
||||
}
|
||||
|
|
0
src/Entity/.gitignore
vendored
0
src/Entity/.gitignore
vendored
|
@ -6,13 +6,18 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
|
||||
/**
|
||||
* Battery Type
|
||||
*
|
||||
* @ORM\Table(name="battery_type", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
#[ORM\Table(name: 'battery_type', schema: 'camera')]
|
||||
#[ORM\Entity]
|
||||
class BatteryType
|
||||
{
|
||||
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
||||
private int $id;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||
*/
|
||||
private $id;
|
||||
}
|
||||
|
|
|
@ -2,22 +2,26 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\CameraRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera
|
||||
*
|
||||
* @ORM\Table(name="camera", schema="camera", indexes={
|
||||
@ORM\Index(name="IDX_747C826FC54C8C93", columns={"type_id"})
|
||||
})
|
||||
* @ORM\Entity(repositoryClass="App\Repository\CameraRepository")
|
||||
*/
|
||||
#[ORM\Table(name: 'camera', schema: 'camera')]
|
||||
#[ORM\Index(columns: ['type_id'], name: 'IDX_747C826FC54C8C93')]
|
||||
#[ORM\Entity(repositoryClass: CameraRepository::class)]
|
||||
class Camera
|
||||
{
|
||||
class Camera {
|
||||
use CameraTrait;
|
||||
|
||||
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
||||
#[ORM\SequenceGenerator(sequenceName: 'camera__id_seq', allocationSize: 1, initialValue: 1)]
|
||||
private int $id;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera__id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
}
|
||||
|
|
|
@ -2,215 +2,438 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Trait CameraTrait
|
||||
*
|
||||
* Shared columns for camera, and previously_owned_camera tables
|
||||
*
|
||||
* @package App\Entity
|
||||
*/
|
||||
trait CameraTrait
|
||||
{
|
||||
use PurchasePriceTrait;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: 'CameraType')]
|
||||
#[ORM\JoinColumn(name: 'type_id', referencedColumnName: 'id', nullable: FALSE)]
|
||||
private readonly CameraType $type;
|
||||
/**
|
||||
* @var CameraType
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="CameraType")
|
||||
* @ORM\JoinColumns({
|
||||
* @ORM\JoinColumn(name="type_id", referencedColumnName="id")
|
||||
* })
|
||||
*/
|
||||
private $type;
|
||||
|
||||
#[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: FALSE)]
|
||||
private readonly string $brand;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", length=64, nullable=false)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
#[ORM\Column(name: 'mount', type: 'string', length: 32, nullable: FALSE)]
|
||||
private readonly string $mount;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="mount", type="string", length=32, nullable=false)
|
||||
*/
|
||||
private $mount;
|
||||
|
||||
#[ORM\Column(name: 'model', type: 'string', length: 255, nullable: FALSE)]
|
||||
private readonly string $model;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", length=255, nullable=false)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
#[ORM\Column(name: 'is_digital', type: 'boolean', nullable: FALSE)]
|
||||
private readonly bool $isDigital;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_digital", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isDigital;
|
||||
|
||||
#[ORM\Column(name: 'crop_factor', type: 'decimal', precision: 10, scale: 0, nullable: FALSE)]
|
||||
private string $cropFactor = '1.0';
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="crop_factor", type="decimal", precision=10, scale=0, nullable=false)
|
||||
*/
|
||||
private $cropFactor = '1.0';
|
||||
|
||||
#[ORM\Column(name: 'is_working', type: 'boolean', nullable: FALSE)]
|
||||
private readonly bool $isWorking;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_working", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isWorking;
|
||||
|
||||
#[ORM\Column(name: 'notes', type: 'text', nullable: TRUE)]
|
||||
private readonly ?string $notes;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
#[ORM\Column(name: 'serial', type: 'string', length: 20, nullable: FALSE)]
|
||||
private readonly string $serial;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", length=20, nullable=false)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
#[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: FALSE)]
|
||||
private bool $formerlyOwned = FALSE;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
|
||||
*/
|
||||
private $formerlyOwned = false;
|
||||
|
||||
#[ORM\Column(name: 'battery_type', type: 'string', nullable: TRUE)]
|
||||
private readonly ?string $batteryType;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="money", nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
#[ORM\Column(name: 'film_format', type: 'string', nullable: TRUE)]
|
||||
private ?string $filmFormat = '135';
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="battery_type", type="string", nullable=true)
|
||||
*/
|
||||
private $batteryType;
|
||||
|
||||
#[ORM\Column(name: 'received', type: 'boolean', nullable: TRUE)]
|
||||
private ?bool $received = FALSE;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="film_format", type="string", nullable=true)
|
||||
*/
|
||||
private $filmFormat = '135';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=true)
|
||||
*/
|
||||
private $received = false;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setType(?CameraType $type = NULL): self
|
||||
/**
|
||||
* Set type
|
||||
*
|
||||
* @param CameraType $type
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setType(CameraType $type = null): self
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getType(): CameraType
|
||||
/**
|
||||
* Get type
|
||||
*
|
||||
* @return CameraType
|
||||
*/
|
||||
public function getType(): ?CameraType
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function setBrand(string $brand): self
|
||||
/**
|
||||
* Set brand
|
||||
*
|
||||
* @param string $brand
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setBrand($brand): self
|
||||
{
|
||||
$this->brand = $brand;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBrand(): string
|
||||
/**
|
||||
* Get brand
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBrand(): ?string
|
||||
{
|
||||
return $this->brand;
|
||||
}
|
||||
|
||||
public function setMount(string $mount): self
|
||||
/**
|
||||
* Set mount
|
||||
*
|
||||
* @param string $mount
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setMount($mount): self
|
||||
{
|
||||
$this->mount = $mount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMount(): string
|
||||
/**
|
||||
* Get mount
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMount(): ?string
|
||||
{
|
||||
return $this->mount;
|
||||
}
|
||||
|
||||
public function setModel(string $model): self
|
||||
/**
|
||||
* Set model
|
||||
*
|
||||
* @param string $model
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setModel($model): self
|
||||
{
|
||||
$this->model = $model;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getModel(): string
|
||||
/**
|
||||
* Get model
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModel(): ?string
|
||||
{
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
public function setIsDigital(bool $isDigital): self
|
||||
/**
|
||||
* Set isDigital
|
||||
*
|
||||
* @param boolean $isDigital
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setIsDigital($isDigital): self
|
||||
{
|
||||
$this->isDigital = $isDigital;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIsDigital(): bool
|
||||
/**
|
||||
* Get isDigital
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsDigital(): ?bool
|
||||
{
|
||||
return $this->isDigital;
|
||||
}
|
||||
|
||||
public function setCropFactor(string $cropFactor): self
|
||||
/**
|
||||
* Set cropFactor
|
||||
*
|
||||
* @param string $cropFactor
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setCropFactor($cropFactor): self
|
||||
{
|
||||
$this->cropFactor = $cropFactor;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cropFactor
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCropFactor(): string
|
||||
{
|
||||
return $this->cropFactor;
|
||||
}
|
||||
|
||||
public function setIsWorking(bool $isWorking): self
|
||||
/**
|
||||
* Set isWorking
|
||||
*
|
||||
* @param boolean $isWorking
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setIsWorking($isWorking): self
|
||||
{
|
||||
$this->isWorking = $isWorking;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIsWorking(): bool
|
||||
/**
|
||||
* Get isWorking
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsWorking(): ?bool
|
||||
{
|
||||
return $this->isWorking;
|
||||
}
|
||||
|
||||
public function setNotes(string $notes): self
|
||||
/**
|
||||
* Set notes
|
||||
*
|
||||
* @param string $notes
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setNotes($notes): self
|
||||
{
|
||||
$this->notes = $notes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNotes(): string
|
||||
{
|
||||
return $this->notes ?? '';
|
||||
}
|
||||
|
||||
public function setSerial(string $serial): self
|
||||
/**
|
||||
* Set serial
|
||||
*
|
||||
* @param string $serial
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setSerial($serial): self
|
||||
{
|
||||
$this->serial = $serial;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get serial
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSerial(): string
|
||||
{
|
||||
return $this->serial ?? '';
|
||||
}
|
||||
|
||||
public function setFormerlyOwned(bool $formerlyOwned): self
|
||||
/**
|
||||
* Set formerlyOwned
|
||||
*
|
||||
* @param boolean $formerlyOwned
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setFormerlyOwned($formerlyOwned): self
|
||||
{
|
||||
$this->formerlyOwned = $formerlyOwned;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFormerlyOwned(): bool
|
||||
/**
|
||||
* Get formerlyOwned
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFormerlyOwned(): ?bool
|
||||
{
|
||||
return $this->formerlyOwned;
|
||||
}
|
||||
|
||||
public function setBatteryType(string $batteryType): self
|
||||
/**
|
||||
* Set batteryType
|
||||
*
|
||||
* @param string $batteryType
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setBatteryType($batteryType): self
|
||||
{
|
||||
$this->batteryType = $batteryType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBatteryType(): string
|
||||
/**
|
||||
* Get batteryType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBatteryType(): ?string
|
||||
{
|
||||
return $this->batteryType ?? '';
|
||||
return $this->batteryType;
|
||||
}
|
||||
|
||||
public function setFilmFormat(string $filmFormat): self
|
||||
/**
|
||||
* Set filmFormat
|
||||
*
|
||||
* @param string $filmFormat
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setFilmFormat($filmFormat): self
|
||||
{
|
||||
$this->filmFormat = $filmFormat;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filmFormat
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFilmFormat(): string
|
||||
{
|
||||
return $this->filmFormat ?? '';
|
||||
return $this->filmFormat;
|
||||
}
|
||||
|
||||
public function setReceived(bool $received): self
|
||||
/**
|
||||
* Set received
|
||||
*
|
||||
* @param boolean $received
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setReceived($received): self
|
||||
{
|
||||
$this->received = $received;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get received
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReceived(): bool
|
||||
{
|
||||
return $this->received;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,37 +3,55 @@
|
|||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Stringable;
|
||||
|
||||
/**
|
||||
* CameraType
|
||||
*
|
||||
* @ORM\Table(name="camera_type", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
#[ORM\Table(name: 'camera_type', schema: 'camera')]
|
||||
#[ORM\Entity]
|
||||
class CameraType implements Stringable
|
||||
class CameraType
|
||||
{
|
||||
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
||||
#[ORM\SequenceGenerator(sequenceName: 'camera.camera_type_id_seq', allocationSize: 1, initialValue: 1)]
|
||||
private int $id;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.camera_type_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(name: 'type', type: 'string', length: 255, nullable: FALSE)]
|
||||
private string $type;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="type", type="string", length=255, nullable=false)
|
||||
*/
|
||||
private $type;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="description", type="text", nullable=true)
|
||||
*/
|
||||
private $description;
|
||||
|
||||
#[ORM\Column(name: 'description', type: 'text', nullable: TRUE)]
|
||||
private ?string $description = NULL;
|
||||
|
||||
/**
|
||||
* Value for serialization
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId(): int
|
||||
{
|
||||
|
@ -42,6 +60,10 @@ class CameraType implements Stringable
|
|||
|
||||
/**
|
||||
* Set type
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return CameraType
|
||||
*/
|
||||
public function setType(string $type): self
|
||||
{
|
||||
|
@ -52,6 +74,10 @@ class CameraType implements Stringable
|
|||
|
||||
/**
|
||||
* Set description
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return CameraType
|
||||
*/
|
||||
public function setDescription(string $description): self
|
||||
{
|
||||
|
|
|
@ -6,55 +6,115 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
|
||||
/**
|
||||
* Camera
|
||||
*
|
||||
* @ORM\Table(name="film", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
#[ORM\Table(name: 'film', schema: 'camera')]
|
||||
#[ORM\Entity]
|
||||
class Film
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
|
||||
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
||||
private int $id;
|
||||
class Film {
|
||||
|
||||
#[ORM\Column(name: 'brand', type: 'string', nullable: FALSE)]
|
||||
private string $brand;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Id
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(name: 'product_line', type: 'string', nullable: TRUE)]
|
||||
private ?string $productLine = NULL;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", nullable=false)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
#[ORM\Column(name: 'film_name', type: 'string', nullable: FALSE)]
|
||||
private string $filmName;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="product_line", type="string", nullable=true)
|
||||
*/
|
||||
private $productLine;
|
||||
|
||||
#[ORM\Column(name: 'film_alias', type: 'string', nullable: TRUE)]
|
||||
private ?string $filmAlias = NULL;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="film_name", type="string", nullable=false)
|
||||
*/
|
||||
private $filmName;
|
||||
|
||||
#[ORM\Column(name: 'film_speed_asa', type: 'integer', nullable: FALSE)]
|
||||
private int $filmSpeedAsa;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="film_alias", type="string", nullable=true)
|
||||
*/
|
||||
private $filmAlias;
|
||||
|
||||
#[ORM\Column(name: 'film_speed_din', type: 'integer', nullable: FALSE)]
|
||||
private int $filmSpeedDin;
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="film_speed_asa", type="integer", nullable=false)
|
||||
*/
|
||||
private $filmSpeedAsa;
|
||||
|
||||
#[ORM\Column(name: 'film_format', type: 'string', nullable: FALSE)]
|
||||
private string $filmFormat;
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="film_speed_din", type="integer", nullable=false)
|
||||
*/
|
||||
private $filmSpeedDin;
|
||||
|
||||
#[ORM\Column(name: 'film_base', type: 'string', nullable: FALSE, options: ['default' => 'Cellulose Triacetate'])]
|
||||
private string $filmBase = 'Cellulose Triacetate';
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="film_format", type="string", nullable=false)
|
||||
*/
|
||||
private $filmFormat;
|
||||
|
||||
#[ORM\Column(name: 'unused_rolls', type: 'integer', nullable: FALSE, options: ['default' => 0])]
|
||||
private int $unusedRolls = 0;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="film_base", type="string", nullable=false, options={"default"="Cellulose Triacetate"})
|
||||
*/
|
||||
private $filmBase = 'Cellulose Triacetate';
|
||||
|
||||
#[ORM\Column(name: 'rolls_in_camera', type: 'integer', nullable: FALSE, options: ['default' => 0])]
|
||||
private int $rollsInCamera = 0;
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="unused_rolls", type="integer", nullable=false, options={"default"=0})
|
||||
*/
|
||||
private $unusedRolls = 0;
|
||||
|
||||
#[ORM\Column(name: 'developed_rolls', type: 'integer', nullable: FALSE, options: ['default' => 0])]
|
||||
private int $developedRolls = 0;
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="rolls_in_camera", type="integer", nullable=false, options={"default"=0})
|
||||
*/
|
||||
private $rollsInCamera = 0;
|
||||
|
||||
#[ORM\Column(name: 'chemistry', type: 'string', nullable: FALSE, options: ['default' => 'C-41'])]
|
||||
private string $chemistry = 'C-41';
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="developed_rolls", type="integer", nullable=false, options={"default"=0})
|
||||
*/
|
||||
private $developedRolls = 0;
|
||||
|
||||
#[ORM\Column(name: 'notes', type: 'text', nullable: TRUE)]
|
||||
private ?string $notes = NULL;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="chemistry", type="string", nullable=false, options={"default"="C-41"})
|
||||
*/
|
||||
private $chemistry = 'C-41';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
|
@ -68,10 +128,13 @@ class Film
|
|||
return $this->brand;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $brand
|
||||
* @return self
|
||||
*/
|
||||
public function setBrand(string $brand): self
|
||||
{
|
||||
$this->brand = $brand;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -85,11 +148,11 @@ class Film
|
|||
|
||||
/**
|
||||
* @param string $productLine
|
||||
* @return self
|
||||
*/
|
||||
public function setProductLine(?string $productLine): self
|
||||
{
|
||||
$this->productLine = $productLine;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -101,10 +164,13 @@ class Film
|
|||
return $this->filmName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $filmName
|
||||
* @return self
|
||||
*/
|
||||
public function setFilmName(string $filmName): self
|
||||
{
|
||||
$this->filmName = $filmName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -116,10 +182,13 @@ class Film
|
|||
return $this->filmAlias;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $filmAlias
|
||||
* @return self
|
||||
*/
|
||||
public function setFilmAlias(string $filmAlias): self
|
||||
{
|
||||
$this->filmAlias = $filmAlias;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -131,10 +200,13 @@ class Film
|
|||
return $this->filmSpeedAsa;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $filmSpeedAsa
|
||||
* @return self
|
||||
*/
|
||||
public function setFilmSpeedAsa(int $filmSpeedAsa): self
|
||||
{
|
||||
$this->filmSpeedAsa = $filmSpeedAsa;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -146,10 +218,13 @@ class Film
|
|||
return $this->filmSpeedDin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $filmSpeedDin
|
||||
* @return self
|
||||
*/
|
||||
public function setFilmSpeedDin(int $filmSpeedDin): self
|
||||
{
|
||||
$this->filmSpeedDin = $filmSpeedDin;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -161,10 +236,13 @@ class Film
|
|||
return $this->filmFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $filmFormat
|
||||
* @return self
|
||||
*/
|
||||
public function setFilmFormat(string $filmFormat): self
|
||||
{
|
||||
$this->filmFormat = $filmFormat;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -176,10 +254,13 @@ class Film
|
|||
return $this->filmBase;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $filmBase
|
||||
* @return self
|
||||
*/
|
||||
public function setFilmBase(string $filmBase): self
|
||||
{
|
||||
$this->filmBase = $filmBase;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -191,10 +272,13 @@ class Film
|
|||
return $this->unusedRolls;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $unusedRolls
|
||||
* @return self
|
||||
*/
|
||||
public function setUnusedRolls(int $unusedRolls): self
|
||||
{
|
||||
$this->unusedRolls = $unusedRolls;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -206,10 +290,13 @@ class Film
|
|||
return $this->rollsInCamera;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $rollsInCamera
|
||||
* @return self
|
||||
*/
|
||||
public function setRollsInCamera(int $rollsInCamera): self
|
||||
{
|
||||
$this->rollsInCamera = $rollsInCamera;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -221,10 +308,13 @@ class Film
|
|||
return $this->developedRolls;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $developedRolls
|
||||
* @return self
|
||||
*/
|
||||
public function setDevelopedRolls(int $developedRolls): self
|
||||
{
|
||||
$this->developedRolls = $developedRolls;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -236,10 +326,13 @@ class Film
|
|||
return $this->chemistry;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $chemistry
|
||||
* @return self
|
||||
*/
|
||||
public function setChemistry(string $chemistry): self
|
||||
{
|
||||
$this->chemistry = $chemistry;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -251,10 +344,13 @@ class Film
|
|||
return $this->notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $notes
|
||||
* @return self
|
||||
*/
|
||||
public function setNotes(string $notes): self
|
||||
{
|
||||
$this->notes = $notes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,20 +4,32 @@ namespace App\Entity;
|
|||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Table(name: 'film_format', schema: 'camera')]
|
||||
#[ORM\Entity]
|
||||
/**
|
||||
* @ORM\Table(name="film_format", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class FilmFormat
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private int $id;
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(name: 'number_id', type: 'integer')]
|
||||
private int $numberId;
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="number_id", type="integer")
|
||||
*/
|
||||
private $numberId;
|
||||
|
||||
#[ORM\Column(name: 'name', type: 'string')]
|
||||
private string $name;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="name", type="string")
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
|
@ -35,10 +47,13 @@ class FilmFormat
|
|||
return $this->numberId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $numberId
|
||||
* @return self
|
||||
*/
|
||||
public function setNumberId(int $numberId): self
|
||||
{
|
||||
$this->numberId = $numberId;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -50,10 +65,13 @@ class FilmFormat
|
|||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return self
|
||||
*/
|
||||
public function setName(string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,22 +6,36 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
|
||||
/**
|
||||
* Camera.flash
|
||||
*
|
||||
* @ORM\Table(name="flash", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
#[ORM\Table(name: 'flash', schema: 'camera')]
|
||||
#[ORM\Entity]
|
||||
class Flash
|
||||
{
|
||||
use FlashTrait;
|
||||
|
||||
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
||||
#[ORM\SequenceGenerator(sequenceName: 'camera.flash_id_seq', allocationSize: 1, initialValue: 1)]
|
||||
private int $id;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.flash_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(name: 'received', type: 'boolean', nullable: FALSE, options: ['default' => FALSE])]
|
||||
private bool $received = FALSE;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=false, options={"default" : false})
|
||||
*/
|
||||
private $received = false;
|
||||
|
||||
#[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: FALSE, options: ['default' => FALSE])]
|
||||
private bool $formerlyOwned = FALSE;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false, options={"default" : false})
|
||||
*/
|
||||
private $formerlyOwned = false;
|
||||
}
|
||||
|
|
|
@ -2,54 +2,112 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
trait FlashTrait
|
||||
{
|
||||
use PurchasePriceTrait;
|
||||
|
||||
#[ORM\Column(name: 'brand', type: 'string', nullable: FALSE)]
|
||||
private readonly string $brand;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", nullable=false)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
#[ORM\Column(name: 'model', type: 'string', nullable: FALSE)]
|
||||
private readonly string $model;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", nullable=false)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
#[ORM\Column(name: 'is_auto_flash', type: 'boolean', nullable: FALSE)]
|
||||
private bool $isAutoFlash = FALSE;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_auto_flash", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isAutoFlash = false;
|
||||
|
||||
#[ORM\Column(name: 'is_ttl', type: 'boolean', nullable: FALSE)]
|
||||
private bool $isTtl = FALSE;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_ttl", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isTtl = false;
|
||||
|
||||
#[ORM\Column(name: 'ttl_type', type: 'string', nullable: FALSE)]
|
||||
private string $ttlType = 'N / A';
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="ttl_type", type="string", nullable=false)
|
||||
*/
|
||||
private $ttlType = 'N / A';
|
||||
|
||||
#[ORM\Column(name: 'is_p_ttl', type: 'boolean', nullable: FALSE)]
|
||||
private bool $isPTtl = FALSE;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_p_ttl", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isPTtl = false;
|
||||
|
||||
#[ORM\Column(name: 'p_ttl_type', type: 'string', nullable: FALSE)]
|
||||
private string $pTtlType = 'N / A';
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="p_ttl_type", type="string", nullable=false)
|
||||
*/
|
||||
private $pTtlType = 'N / A';
|
||||
|
||||
#[ORM\Column(name: 'guide_number', type: 'string', nullable: TRUE)]
|
||||
private ?string $guideNumber = '';
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="guide_number", type="string", nullable=true)
|
||||
*/
|
||||
private $guideNumber;
|
||||
|
||||
#[ORM\Column(name: 'batteries', type: 'string', nullable: FALSE)]
|
||||
private string $batteries = '4x AA';
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="money", nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
#[ORM\Column(name: 'notes', type: 'text', nullable: TRUE)]
|
||||
private readonly ?string $notes;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="batteries", type="string", nullable=false)
|
||||
*/
|
||||
private $batteries = '4x AA';
|
||||
|
||||
#[ORM\Column(name: 'serial', type: 'string', nullable: TRUE)]
|
||||
private readonly ?string $serial;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
public function getId(): int
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", nullable=true)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set brand
|
||||
*
|
||||
* @param string $brand
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setBrand(string $brand): self
|
||||
public function setBrand($brand)
|
||||
{
|
||||
$this->brand = $brand;
|
||||
|
||||
|
@ -93,7 +151,7 @@ trait FlashTrait
|
|||
/**
|
||||
* Set isAutoFlash
|
||||
*
|
||||
* @param bool $isAutoFlash
|
||||
* @param boolean $isAutoFlash
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
|
@ -107,7 +165,7 @@ trait FlashTrait
|
|||
/**
|
||||
* Get isAutoFlash
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsAutoFlash()
|
||||
{
|
||||
|
@ -117,7 +175,7 @@ trait FlashTrait
|
|||
/**
|
||||
* Set isTtl
|
||||
*
|
||||
* @param bool $isTtl
|
||||
* @param boolean $isTtl
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
|
@ -131,7 +189,7 @@ trait FlashTrait
|
|||
/**
|
||||
* Get isTtl
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsTtl()
|
||||
{
|
||||
|
@ -165,7 +223,7 @@ trait FlashTrait
|
|||
/**
|
||||
* Set isPTtl
|
||||
*
|
||||
* @param bool $isPTtl
|
||||
* @param boolean $isPTtl
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
|
@ -179,7 +237,7 @@ trait FlashTrait
|
|||
/**
|
||||
* Get isPTtl
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsPTtl()
|
||||
{
|
||||
|
@ -190,8 +248,10 @@ trait FlashTrait
|
|||
* Set pTtlType
|
||||
*
|
||||
* @param string $pTtlType
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setPTtlType($pTtlType): self
|
||||
public function setPTtlType($pTtlType)
|
||||
{
|
||||
$this->pTtlType = $pTtlType;
|
||||
|
||||
|
@ -213,7 +273,7 @@ trait FlashTrait
|
|||
*
|
||||
* @param string $guideNumber
|
||||
*
|
||||
* @return self
|
||||
* @return Flash
|
||||
*/
|
||||
public function setGuideNumber($guideNumber)
|
||||
{
|
||||
|
@ -239,7 +299,7 @@ trait FlashTrait
|
|||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setBatteries($batteries): self
|
||||
public function setBatteries($batteries)
|
||||
{
|
||||
$this->batteries = $batteries;
|
||||
|
||||
|
@ -263,7 +323,7 @@ trait FlashTrait
|
|||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setNotes($notes): self
|
||||
public function setNotes($notes)
|
||||
{
|
||||
$this->notes = $notes;
|
||||
|
||||
|
@ -287,7 +347,7 @@ trait FlashTrait
|
|||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setSerial($serial): self
|
||||
public function setSerial($serial)
|
||||
{
|
||||
$this->serial = $serial;
|
||||
|
||||
|
@ -307,11 +367,11 @@ trait FlashTrait
|
|||
/**
|
||||
* Set formerlyOwned
|
||||
*
|
||||
* @param bool $formerlyOwned
|
||||
* @param boolean $formerlyOwned
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setFormerlyOwned($formerlyOwned): self
|
||||
public function setFormerlyOwned($formerlyOwned)
|
||||
{
|
||||
$this->formerlyOwned = $formerlyOwned;
|
||||
|
||||
|
@ -321,7 +381,7 @@ trait FlashTrait
|
|||
/**
|
||||
* Get formerlyOwned
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFormerlyOwned()
|
||||
{
|
||||
|
@ -331,11 +391,11 @@ trait FlashTrait
|
|||
/**
|
||||
* Set received
|
||||
*
|
||||
* @param bool $received
|
||||
* @param boolean $received
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setReceived($received): self
|
||||
public function setReceived($received)
|
||||
{
|
||||
$this->received = $received;
|
||||
|
||||
|
@ -345,7 +405,7 @@ trait FlashTrait
|
|||
/**
|
||||
* Get received
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReceived()
|
||||
{
|
||||
|
|
|
@ -2,68 +2,148 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
trait LensTrait
|
||||
{
|
||||
use PurchasePriceTrait;
|
||||
|
||||
#[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: TRUE)]
|
||||
private readonly ?string $brand;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
#[ORM\Column(name: 'coatings', type: 'string', length: 64, nullable: TRUE)]
|
||||
private readonly ?string $coatings;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="coatings", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $coatings;
|
||||
|
||||
#[ORM\Column(name: 'product_line', type: 'string', length: 64, nullable: TRUE)]
|
||||
private readonly ?string $productLine;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="product_line", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $productLine;
|
||||
|
||||
#[ORM\Column(name: 'model', type: 'string', length: 64, nullable: TRUE)]
|
||||
private readonly ?string $model;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
#[ORM\Column(name: 'min_f_stop', type: 'string', length: 10, nullable: TRUE)]
|
||||
private readonly ?string $minFStop;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="min_f_stop", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $minFStop;
|
||||
|
||||
#[ORM\Column(name: 'max_f_stop', type: 'float', precision: 10, scale: 0, nullable: TRUE)]
|
||||
private readonly ?float $maxFStop;
|
||||
/**
|
||||
* @var float
|
||||
*
|
||||
* @ORM\Column(name="max_f_stop", type="float", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $maxFStop;
|
||||
|
||||
#[ORM\Column(name: 'min_focal_length', type: 'integer', nullable: TRUE)]
|
||||
private readonly ?int $minFocalLength;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="min_focal_length", type="integer", nullable=true)
|
||||
*/
|
||||
private $minFocalLength;
|
||||
|
||||
#[ORM\Column(name: 'max_focal_length', type: 'integer', nullable: TRUE)]
|
||||
private readonly ?int $maxFocalLength;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="max_focal_length", type="integer", nullable=true)
|
||||
*/
|
||||
private $maxFocalLength;
|
||||
|
||||
#[ORM\Column(name: 'serial', type: 'string', length: 10, nullable: TRUE)]
|
||||
private readonly ?string $serial;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
#[ORM\Column(name: 'notes', type: 'text', nullable: TRUE)]
|
||||
private readonly ?string $notes;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="money", nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
#[ORM\Column(name: 'image_size', type: 'string', nullable: FALSE, options: ['default' => '35mm'])]
|
||||
private string $imageSize = '35mm';
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
#[ORM\Column(name: 'mount', type: 'string', length: 40, nullable: TRUE)]
|
||||
private readonly ?string $mount;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="image_size", type="string", nullable=false, options={"default"="35mm"})
|
||||
*/
|
||||
private $imageSize = '35mm';
|
||||
|
||||
#[ORM\Column(name: 'front_filter_size', type: 'decimal', precision: 10, scale: 0, nullable: TRUE)]
|
||||
private readonly ?string $frontFilterSize;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="mount", type="string", length=40, nullable=true)
|
||||
*/
|
||||
private $mount;
|
||||
|
||||
#[ORM\Column(name: 'rear_filter_size', type: 'decimal', precision: 10, scale: 0, nullable: TRUE)]
|
||||
private readonly ?string $rearFilterSize;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="front_filter_size", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $frontFilterSize;
|
||||
|
||||
#[ORM\Column(name: 'is_teleconverter', type: 'boolean', nullable: FALSE)]
|
||||
private bool $isTeleconverter = FALSE;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="rear_filter_size", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $rearFilterSize;
|
||||
|
||||
#[ORM\Column(name: 'design_elements', type: 'smallint', nullable: TRUE)]
|
||||
private readonly ?int $designElements;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_teleconverter", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isTeleconverter = false;
|
||||
|
||||
#[ORM\Column(name: 'design_groups', type: 'smallint', nullable: TRUE)]
|
||||
private readonly ?int $designGroups;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="design_elements", type="smallint", nullable=true)
|
||||
*/
|
||||
private $designElements;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="design_groups", type="smallint", nullable=true)
|
||||
*/
|
||||
private $designGroups;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="aperture_blades", type="smallint", nullable=true)
|
||||
*/
|
||||
private $apertureBlades;
|
||||
|
||||
#[ORM\Column(name: 'aperture_blades', type: 'smallint', nullable: TRUE)]
|
||||
private readonly ?int $apertureBlades;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId(): int
|
||||
{
|
||||
|
@ -74,6 +154,8 @@ trait LensTrait
|
|||
* Set brand
|
||||
*
|
||||
* @param string $brand
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setBrand($brand): self
|
||||
{
|
||||
|
@ -96,6 +178,8 @@ trait LensTrait
|
|||
* Set coatings
|
||||
*
|
||||
* @param string $coatings
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setCoatings($coatings): self
|
||||
{
|
||||
|
@ -118,6 +202,8 @@ trait LensTrait
|
|||
* Set productLine
|
||||
*
|
||||
* @param string $productLine
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setProductLine($productLine): self
|
||||
{
|
||||
|
@ -140,6 +226,8 @@ trait LensTrait
|
|||
* Set model
|
||||
*
|
||||
* @param string $model
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setModel($model): self
|
||||
{
|
||||
|
@ -162,6 +250,8 @@ trait LensTrait
|
|||
* Set minFStop
|
||||
*
|
||||
* @param string $minFStop
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setMinFStop($minFStop): self
|
||||
{
|
||||
|
@ -184,6 +274,8 @@ trait LensTrait
|
|||
* Set maxFStop
|
||||
*
|
||||
* @param float $maxFStop
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setMaxFStop($maxFStop): self
|
||||
{
|
||||
|
@ -205,7 +297,9 @@ trait LensTrait
|
|||
/**
|
||||
* Set minFocalLength
|
||||
*
|
||||
* @param int $minFocalLength
|
||||
* @param integer $minFocalLength
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setMinFocalLength($minFocalLength): self
|
||||
{
|
||||
|
@ -217,7 +311,7 @@ trait LensTrait
|
|||
/**
|
||||
* Get minFocalLength
|
||||
*
|
||||
* @return int
|
||||
* @return integer
|
||||
*/
|
||||
public function getMinFocalLength()
|
||||
{
|
||||
|
@ -227,7 +321,9 @@ trait LensTrait
|
|||
/**
|
||||
* Set maxFocalLength
|
||||
*
|
||||
* @param int $maxFocalLength
|
||||
* @param integer $maxFocalLength
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setMaxFocalLength($maxFocalLength): self
|
||||
{
|
||||
|
@ -239,7 +335,7 @@ trait LensTrait
|
|||
/**
|
||||
* Get maxFocalLength
|
||||
*
|
||||
* @return int
|
||||
* @return integer
|
||||
*/
|
||||
public function getMaxFocalLength()
|
||||
{
|
||||
|
@ -250,6 +346,8 @@ trait LensTrait
|
|||
* Set serial
|
||||
*
|
||||
* @param string $serial
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setSerial($serial): self
|
||||
{
|
||||
|
@ -260,6 +358,8 @@ trait LensTrait
|
|||
|
||||
/**
|
||||
* Get serial
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSerial(): string
|
||||
{
|
||||
|
@ -270,6 +370,8 @@ trait LensTrait
|
|||
* Set notes
|
||||
*
|
||||
* @param string $notes
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setNotes(?string $notes): self
|
||||
{
|
||||
|
@ -280,6 +382,8 @@ trait LensTrait
|
|||
|
||||
/**
|
||||
* Get notes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNotes(): string
|
||||
{
|
||||
|
@ -288,6 +392,8 @@ trait LensTrait
|
|||
|
||||
/**
|
||||
* Get image size
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getImageSize(): string
|
||||
{
|
||||
|
@ -296,11 +402,13 @@ trait LensTrait
|
|||
|
||||
/**
|
||||
* Set image size
|
||||
*
|
||||
* @param string $imageSize
|
||||
* @return self
|
||||
*/
|
||||
public function setImageSize(string $imageSize): self
|
||||
{
|
||||
$this->imageSize = $imageSize;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -308,6 +416,8 @@ trait LensTrait
|
|||
* Set mount
|
||||
*
|
||||
* @param string $mount
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setMount($mount): self
|
||||
{
|
||||
|
@ -329,7 +439,9 @@ trait LensTrait
|
|||
/**
|
||||
* Set received
|
||||
*
|
||||
* @param bool $received
|
||||
* @param boolean $received
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setReceived($received): self
|
||||
{
|
||||
|
@ -341,7 +453,7 @@ trait LensTrait
|
|||
/**
|
||||
* Get received
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReceived()
|
||||
{
|
||||
|
@ -351,7 +463,9 @@ trait LensTrait
|
|||
/**
|
||||
* Set formerlyOwned
|
||||
*
|
||||
* @param bool $formerlyOwned
|
||||
* @param boolean $formerlyOwned
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setFormerlyOwned($formerlyOwned): self
|
||||
{
|
||||
|
@ -363,7 +477,7 @@ trait LensTrait
|
|||
/**
|
||||
* Get formerlyOwned
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFormerlyOwned()
|
||||
{
|
||||
|
@ -374,6 +488,8 @@ trait LensTrait
|
|||
* Set frontFilterSize
|
||||
*
|
||||
* @param string $frontFilterSize
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setFrontFilterSize($frontFilterSize): self
|
||||
{
|
||||
|
@ -396,6 +512,8 @@ trait LensTrait
|
|||
* Set rearFilterSize
|
||||
*
|
||||
* @param string $rearFilterSize
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setRearFilterSize($rearFilterSize): self
|
||||
{
|
||||
|
@ -417,7 +535,9 @@ trait LensTrait
|
|||
/**
|
||||
* Set isTeleconverter
|
||||
*
|
||||
* @param bool $isTeleconverter
|
||||
* @param boolean $isTeleconverter
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setIsTeleconverter($isTeleconverter): self
|
||||
{
|
||||
|
@ -429,7 +549,7 @@ trait LensTrait
|
|||
/**
|
||||
* Get isTeleconverter
|
||||
*
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsTeleconverter()
|
||||
{
|
||||
|
@ -439,7 +559,9 @@ trait LensTrait
|
|||
/**
|
||||
* Set designElements
|
||||
*
|
||||
* @param int $designElements
|
||||
* @param integer $designElements
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setDesignElements($designElements): self
|
||||
{
|
||||
|
@ -451,7 +573,7 @@ trait LensTrait
|
|||
/**
|
||||
* Get designElements
|
||||
*
|
||||
* @return int
|
||||
* @return integer
|
||||
*/
|
||||
public function getDesignElements()
|
||||
{
|
||||
|
@ -461,7 +583,9 @@ trait LensTrait
|
|||
/**
|
||||
* Set designGroups
|
||||
*
|
||||
* @param int $designGroups
|
||||
* @param integer $designGroups
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setDesignGroups($designGroups): self
|
||||
{
|
||||
|
@ -473,7 +597,7 @@ trait LensTrait
|
|||
/**
|
||||
* Get designGroups
|
||||
*
|
||||
* @return int
|
||||
* @return integer
|
||||
*/
|
||||
public function getDesignGroups()
|
||||
{
|
||||
|
@ -483,7 +607,9 @@ trait LensTrait
|
|||
/**
|
||||
* Set apertureBlades
|
||||
*
|
||||
* @param int $apertureBlades
|
||||
* @param integer $apertureBlades
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setApertureBlades($apertureBlades): self
|
||||
{
|
||||
|
@ -495,7 +621,7 @@ trait LensTrait
|
|||
/**
|
||||
* Get apertureBlades
|
||||
*
|
||||
* @return int
|
||||
* @return integer
|
||||
*/
|
||||
public function getApertureBlades(): ?int
|
||||
{
|
||||
|
|
|
@ -2,27 +2,39 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\LensesRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera.lenses
|
||||
*
|
||||
* @ORM\Table(name="lenses", schema="camera")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\LensesRepository")
|
||||
*/
|
||||
#[ORM\Table(name: 'lenses', schema: 'camera')]
|
||||
#[ORM\Entity(repositoryClass: LensesRepository::class)]
|
||||
class Lenses
|
||||
{
|
||||
use LensTrait;
|
||||
|
||||
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
||||
#[ORM\SequenceGenerator(sequenceName: 'camera.lenses_id_seq', allocationSize: 1, initialValue: 1)]
|
||||
private int $id;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.lenses_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(name: 'received', type: 'boolean', nullable: FALSE)]
|
||||
private bool $received = FALSE;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=false)
|
||||
*/
|
||||
private $received = false;
|
||||
|
||||
#[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: FALSE)]
|
||||
private bool $formerlyOwned = FALSE;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
|
||||
*/
|
||||
private $formerlyOwned = false;
|
||||
}
|
||||
|
|
|
@ -2,22 +2,25 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\CameraRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera.previouslyOwnedCamera
|
||||
*
|
||||
* @ORM\Table(name="previously_owned_camera", schema="camera", indexes={@ORM\Index(name="IDX_6EF94C6BC54C8C93", columns={"type_id"})})
|
||||
* @ORM\Entity(repositoryClass="App\Repository\CameraRepository")
|
||||
*/
|
||||
#[ORM\Table(name: 'previously_owned_camera', schema: 'camera')]
|
||||
#[ORM\Index(name: 'IDX_6EF94C6BC54C8C93', columns: ['type_id'])]
|
||||
#[ORM\Entity(repositoryClass: CameraRepository::class)]
|
||||
class PreviouslyOwnedCamera
|
||||
{
|
||||
use CameraTrait;
|
||||
|
||||
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
||||
#[ORM\SequenceGenerator(sequenceName: 'prevously_owned_camera_id_seq', allocationSize: 1, initialValue: 1)]
|
||||
private int $id;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||
* @ORM\SequenceGenerator(sequenceName="prevously_owned_camera_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
}
|
||||
|
|
|
@ -6,21 +6,35 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
|
||||
/**
|
||||
* Camera.flash
|
||||
*
|
||||
* @ORM\Table(name="previously_owned_flash", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
#[ORM\Table(name: 'previously_owned_flash', schema: 'camera')]
|
||||
#[ORM\Entity]
|
||||
class PreviouslyOwnedFlash
|
||||
{
|
||||
use FlashTrait;
|
||||
|
||||
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
||||
private int $id;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(name: 'received', type: 'boolean', nullable: FALSE, options: ['default' => TRUE])]
|
||||
private bool $received = TRUE;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=false, options={"default" : true})
|
||||
*/
|
||||
private $received = true;
|
||||
|
||||
#[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: FALSE, options: ['default' => TRUE])]
|
||||
private bool $formerlyOwned = TRUE;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false, options={"default" : true})
|
||||
*/
|
||||
private $formerlyOwned = true;
|
||||
}
|
||||
|
|
|
@ -2,26 +2,37 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\LensesRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera.previouslyOwnedLenses
|
||||
*
|
||||
* @ORM\Table(name="previously_owned_lenses", schema="camera")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\LensesRepository")
|
||||
*/
|
||||
#[ORM\Table(name: 'previously_owned_lenses', schema: 'camera')]
|
||||
#[ORM\Entity(repositoryClass: LensesRepository::class)]
|
||||
class PreviouslyOwnedLenses
|
||||
{
|
||||
use LensTrait;
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="IDENTITY")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
|
||||
private int $id;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=false)
|
||||
*/
|
||||
private $received = true;
|
||||
|
||||
#[ORM\Column(name: 'received', type: 'boolean', nullable: FALSE)]
|
||||
private bool $received = TRUE;
|
||||
|
||||
#[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: FALSE)]
|
||||
private bool $formerlyOwned = TRUE;
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
|
||||
*/
|
||||
private $formerlyOwned = true;
|
||||
}
|
||||
|
|
|
@ -2,24 +2,31 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
trait PurchasePriceTrait
|
||||
{
|
||||
#[ORM\Column(name: 'purchase_price', type: 'money', nullable: TRUE)]
|
||||
private ?string $purchasePrice = NULL;
|
||||
|
||||
public function setPurchasePrice(?string $purchasePrice): self
|
||||
/**
|
||||
* Set purchasePrice
|
||||
*
|
||||
* @param string $purchasePrice
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setPurchasePrice($purchasePrice): self
|
||||
{
|
||||
$this->purchasePrice = $purchasePrice;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPurchasePrice(): string
|
||||
/**
|
||||
* Get purchasePrice
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchasePrice()
|
||||
{
|
||||
if (empty($this->purchasePrice)) {
|
||||
return '0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
return $this->purchasePrice;
|
||||
|
|
|
@ -2,17 +2,19 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Camera;
|
||||
use Symfony\Component\Form\{
|
||||
AbstractType, FormBuilderInterface
|
||||
};
|
||||
use Symfony\Component\Form\Extension\Core\Type\{ChoiceType, MoneyType};
|
||||
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
|
||||
use Symfony\Component\OptionsResolver\Exception\AccessException;
|
||||
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use App\Entity\Camera;
|
||||
|
||||
class CameraType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
|
@ -32,7 +34,7 @@ class CameraType extends AbstractType
|
|||
'127' => '127',
|
||||
'620' => '620',
|
||||
],
|
||||
],
|
||||
]
|
||||
])
|
||||
->add('cropFactor')
|
||||
->add('serial')
|
||||
|
@ -47,19 +49,18 @@ class CameraType extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* {@inheritdoc}
|
||||
* @throws AccessException
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Camera::class,
|
||||
]);
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => Camera::class
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
|
|
|
@ -2,16 +2,18 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\CameraType;
|
||||
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
|
||||
use Symfony\Component\Form\{
|
||||
AbstractType, FormBuilderInterface
|
||||
};
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\OptionsResolver\Exception\AccessException;
|
||||
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use App\Entity\CameraType;
|
||||
|
||||
class CameraTypeType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
|
@ -20,19 +22,18 @@ class CameraTypeType extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* {@inheritdoc}
|
||||
* @throws AccessException
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => CameraType::class,
|
||||
]);
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => CameraType::class
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
|
|
|
@ -3,14 +3,15 @@
|
|||
namespace App\Form;
|
||||
|
||||
use App\Entity\Film;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class FilmType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
|
@ -31,14 +32,14 @@ class FilmType extends AbstractType
|
|||
'127' => '127',
|
||||
'620' => '620',
|
||||
],
|
||||
],
|
||||
]
|
||||
])
|
||||
->add('filmBase', ChoiceType::class, [
|
||||
->add('filmBase',ChoiceType::class, [
|
||||
'choices' => [
|
||||
'Cellulose Triacetate' => 'Cellulose Triacetate',
|
||||
'Polyester' => 'Polyester',
|
||||
'Polyethylene Naphtalate' => 'Polyethylene Naphtalate',
|
||||
],
|
||||
]
|
||||
])
|
||||
->add('unusedRolls')
|
||||
->add('rollsInCamera')
|
||||
|
@ -49,23 +50,23 @@ class FilmType extends AbstractType
|
|||
'C-41' => 'C-41',
|
||||
'E-6' => 'E-6',
|
||||
'Other' => 'Other',
|
||||
],
|
||||
]
|
||||
])
|
||||
->add('notes');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Film::class,
|
||||
]);
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => Film::class
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
|
|
|
@ -2,16 +2,18 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Flash;
|
||||
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
|
||||
use Symfony\Component\Form\{
|
||||
AbstractType, FormBuilderInterface
|
||||
};
|
||||
use Symfony\Component\OptionsResolver\Exception\AccessException;
|
||||
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use App\Entity\Flash;
|
||||
|
||||
class FlashType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
|
@ -32,19 +34,18 @@ class FlashType extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* {@inheritdoc}
|
||||
* @throws AccessException
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Flash::class,
|
||||
]);
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => Flash::class
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
|
|
|
@ -2,17 +2,18 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Lenses;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
|
||||
use Symfony\Component\Form\{
|
||||
AbstractType, Extension\Core\Type\ChoiceType, FormBuilderInterface
|
||||
};
|
||||
use Symfony\Component\OptionsResolver\Exception\AccessException;
|
||||
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use App\Entity\Lenses;
|
||||
|
||||
class LensesType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
|
@ -32,8 +33,8 @@ class LensesType extends AbstractType
|
|||
'6x6' => '6x6cm',
|
||||
'6x4.5' => '6x4.5cm',
|
||||
'4x4' => '4x4cm',
|
||||
],
|
||||
],
|
||||
]
|
||||
]
|
||||
])
|
||||
->add('minFStop')
|
||||
->add('maxFStop')
|
||||
|
@ -53,19 +54,18 @@ class LensesType extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* {@inheritdoc}
|
||||
* @throws AccessException
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Lenses::class,
|
||||
]);
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => Lenses::class
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\PreviouslyOwnedCamera;
|
||||
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
|
||||
use Symfony\Component\OptionsResolver\Exception\AccessException;
|
||||
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use App\Entity\PreviouslyOwnedCamera;
|
||||
|
||||
class PreviouslyOwnedCameraType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
|
@ -32,19 +32,18 @@ class PreviouslyOwnedCameraType extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* {@inheritdoc}
|
||||
* @throws AccessException
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => PreviouslyOwnedCamera::class,
|
||||
]);
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => PreviouslyOwnedCamera::class
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\PreviouslyOwnedFlash;
|
||||
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
|
||||
use Symfony\Component\OptionsResolver\Exception\AccessException;
|
||||
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use App\Entity\PreviouslyOwnedFlash;
|
||||
|
||||
class PreviouslyOwnedFlashType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
|
@ -33,19 +33,18 @@ class PreviouslyOwnedFlashType extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* {@inheritdoc}
|
||||
* @throws AccessException
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => PreviouslyOwnedFlash::class,
|
||||
]);
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => PreviouslyOwnedFlash::class
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\PreviouslyOwnedLenses;
|
||||
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
|
||||
use Symfony\Component\OptionsResolver\Exception\AccessException;
|
||||
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use App\Entity\PreviouslyOwnedLenses;
|
||||
|
||||
class PreviouslyOwnedLensesType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
|
@ -39,19 +39,18 @@ class PreviouslyOwnedLensesType extends AbstractType
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* {@inheritdoc}
|
||||
* @throws AccessException
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => PreviouslyOwnedLenses::class,
|
||||
]);
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => PreviouslyOwnedLenses::class
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
|
|
|
@ -23,14 +23,14 @@ class Kernel extends BaseKernel
|
|||
protected function configureContainer(ContainerConfigurator $container): void
|
||||
{
|
||||
$container->import('../config/{packages}/*.yaml');
|
||||
$container->import('../config/{packages}/' . $this->environment . '/*.yaml');
|
||||
$container->import('../config/{packages}/'.$this->environment.'/*.yaml');
|
||||
$container->import('../config/{services}.yaml');
|
||||
$container->import('../config/{services}_' . $this->environment . '.yaml');
|
||||
$container->import('../config/{services}_'.$this->environment.'.yaml');
|
||||
}
|
||||
|
||||
protected function configureRoutes(RoutingConfigurator $routes): void
|
||||
{
|
||||
$routes->import('../config/{routes}/' . $this->environment . '/*.yaml');
|
||||
$routes->import('../config/{routes}/'.$this->environment.'/*.yaml');
|
||||
$routes->import('../config/{routes}/*.yaml');
|
||||
$routes->import('../config/{routes}.yaml');
|
||||
}
|
||||
|
|
|
@ -2,11 +2,8 @@
|
|||
|
||||
namespace App\Repository;
|
||||
|
||||
use ReflectionObject;
|
||||
use Throwable;
|
||||
trait AcquireTrait {
|
||||
|
||||
trait AcquireTrait
|
||||
{
|
||||
/**
|
||||
* Move a record from the table represented by $currentRecord
|
||||
* into the table represented by $newRecord
|
||||
|
@ -18,24 +15,27 @@ trait AcquireTrait
|
|||
{
|
||||
$em = $this->getEntityManager();
|
||||
|
||||
$old = new ReflectionObject($currentRecord);
|
||||
$new = new ReflectionObject($newRecord);
|
||||
$old = new \ReflectionObject($currentRecord);
|
||||
$new = new \ReflectionObject($newRecord);
|
||||
|
||||
foreach ($old->getProperties() as $property) {
|
||||
$propertyName = $property->getName();
|
||||
if ($new->hasProperty($propertyName)) {
|
||||
$newProperty = $new->getProperty($propertyName);
|
||||
$newProperty->setAccessible(TRUE);
|
||||
$property->setAccessible(TRUE);
|
||||
$newProperty->setAccessible(true);
|
||||
$property->setAccessible(true);
|
||||
$newProperty->setValue($newRecord, $property->getValue($currentRecord));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
try
|
||||
{
|
||||
$em->persist($newRecord);
|
||||
$em->remove($currentRecord);
|
||||
$em->flush();
|
||||
} catch (Throwable) {
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
dump($newRecord);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,29 +3,33 @@
|
|||
namespace App\Repository;
|
||||
|
||||
use App\Entity\{Camera, PreviouslyOwnedCamera};
|
||||
use Doctrine\ORM\{EntityRepository, ORMInvalidArgumentException};
|
||||
use Doctrine\ORM\{
|
||||
EntityRepository, ORMInvalidArgumentException
|
||||
};
|
||||
|
||||
class CameraRepository extends EntityRepository {
|
||||
|
||||
class CameraRepository extends EntityRepository
|
||||
{
|
||||
use AcquireTrait;
|
||||
|
||||
/**
|
||||
* @param Camera $currentRecord
|
||||
* @throws ORMInvalidArgumentException
|
||||
*/
|
||||
public function deacquire(Camera $currentRecord): void
|
||||
{
|
||||
$currentRecord->setFormerlyOwned(TRUE)
|
||||
->setReceived(TRUE);
|
||||
$currentRecord->setFormerlyOwned(true)
|
||||
->setReceived(true);
|
||||
|
||||
$this->moveRecord($currentRecord, new PreviouslyOwnedCamera());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PreviouslyOwnedCamera $currentRecord
|
||||
* @throws ORMInvalidArgumentException
|
||||
*/
|
||||
public function reacquire(PreviouslyOwnedCamera $currentRecord): void
|
||||
{
|
||||
$currentRecord->setFormerlyOwned(FALSE);
|
||||
$currentRecord->setFormerlyOwned(false);
|
||||
|
||||
$this->moveRecord($currentRecord, new Camera());
|
||||
}
|
||||
|
|
|
@ -3,29 +3,33 @@
|
|||
namespace App\Repository;
|
||||
|
||||
use App\Entity\{Flash, PreviouslyOwnedFlash};
|
||||
use Doctrine\ORM\{EntityRepository, ORMInvalidArgumentException};
|
||||
use Doctrine\ORM\{
|
||||
EntityRepository, ORMInvalidArgumentException
|
||||
};
|
||||
|
||||
class FlashRepository extends EntityRepository {
|
||||
|
||||
class FlashRepository extends EntityRepository
|
||||
{
|
||||
use AcquireTrait;
|
||||
|
||||
/**
|
||||
* @param Flash $currentRecord
|
||||
* @throws ORMInvalidArgumentException
|
||||
*/
|
||||
public function deacquire(Flash $currentRecord): void
|
||||
{
|
||||
$currentRecord->setFormerlyOwned(TRUE)
|
||||
->setReceived(TRUE);
|
||||
$currentRecord->setFormerlyOwned(true)
|
||||
->setReceived(true);
|
||||
|
||||
$this->moveRecord($currentRecord, new PreviouslyOwnedFlash());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PreviouslyOwnedFlash $currentRecord
|
||||
* @throws ORMInvalidArgumentException
|
||||
*/
|
||||
public function reacquire(PreviouslyOwnedFlash $currentRecord): void
|
||||
{
|
||||
$currentRecord->setFormerlyOwned(FALSE);
|
||||
$currentRecord->setFormerlyOwned(false);
|
||||
|
||||
$this->moveRecord($currentRecord, new Flash());
|
||||
}
|
||||
|
|
|
@ -9,17 +9,23 @@ class LensesRepository extends EntityRepository
|
|||
{
|
||||
use AcquireTrait;
|
||||
|
||||
/**
|
||||
* @param Lenses $currentRecord
|
||||
*/
|
||||
public function deacquire(Lenses $currentRecord): void
|
||||
{
|
||||
$currentRecord->setFormerlyOwned(TRUE)
|
||||
->setReceived(TRUE);
|
||||
$currentRecord->setFormerlyOwned(true)
|
||||
->setReceived(true);
|
||||
|
||||
$this->moveRecord($currentRecord, new PreviouslyOwnedLenses());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PreviouslyOwnedLenses $currentRecord
|
||||
*/
|
||||
public function reacquire(PreviouslyOwnedLenses $currentRecord): void
|
||||
{
|
||||
$currentRecord->setFormerlyOwned(FALSE);
|
||||
$currentRecord->setFormerlyOwned(false);
|
||||
|
||||
$this->moveRecord($currentRecord, new Lenses());
|
||||
}
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
namespace App\Types;
|
||||
|
||||
use App\ValueObject\Money;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use App\ValueObject\Money;
|
||||
|
||||
class MoneyType extends Type
|
||||
{
|
||||
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
|
||||
class MoneyType extends Type {
|
||||
|
||||
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string
|
||||
{
|
||||
return 'MONEY';
|
||||
}
|
||||
|
||||
public function convertToPHPValue($value, AbstractPlatform $platform): float
|
||||
{
|
||||
return (float) (string) new Money($value);
|
||||
return (float) (string)new Money($value);
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
|
|
|
@ -1,25 +1,22 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
namespace App\ValueObject;
|
||||
|
||||
use Stringable;
|
||||
|
||||
class Money implements Stringable
|
||||
{
|
||||
private readonly float $value;
|
||||
class Money {
|
||||
private $value;
|
||||
|
||||
public function __construct($value)
|
||||
{
|
||||
$this->value = (float) str_replace(['$', ','], '', $value);
|
||||
$this->value = (float)str_replace(['$',','], '', $value);
|
||||
}
|
||||
|
||||
public function getValue(): float
|
||||
public function getValue()
|
||||
{
|
||||
return (float) str_replace(['$', ','], '', $this->value);
|
||||
return (float)str_replace(['$',','], '', $this->value);
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->getValue();
|
||||
return (string)$this->getValue();
|
||||
}
|
||||
}
|
||||
|
|
386
symfony.lock
386
symfony.lock
|
@ -1,147 +1,93 @@
|
|||
{
|
||||
"composer/package-versions-deprecated": {
|
||||
"version": "1.11.99.3"
|
||||
},
|
||||
"doctrine/annotations": {
|
||||
"version": "1.0",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "1.0",
|
||||
"ref": "a2759dd6123694c8d901d0ec80006e044c2e6457"
|
||||
},
|
||||
"files": [
|
||||
"config/routes/annotations.yaml"
|
||||
]
|
||||
"ref": "b9cde490c337f6c496d5f403fa6f827cf8b4706d"
|
||||
}
|
||||
},
|
||||
"doctrine/cache": {
|
||||
"version": "1.10.2"
|
||||
"version": "v1.7.1"
|
||||
},
|
||||
"doctrine/collections": {
|
||||
"version": "1.6.7"
|
||||
"version": "v1.5.0"
|
||||
},
|
||||
"doctrine/common": {
|
||||
"version": "2.13.3"
|
||||
"version": "v2.8.1"
|
||||
},
|
||||
"doctrine/dbal": {
|
||||
"version": "2.12.1"
|
||||
},
|
||||
"doctrine/deprecations": {
|
||||
"version": "v0.5.3"
|
||||
"version": "v2.6.3"
|
||||
},
|
||||
"doctrine/doctrine-bundle": {
|
||||
"version": "2.0",
|
||||
"version": "1.6",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "2.0",
|
||||
"ref": "40631978d2c4adc9b11220b13eba539b727c36a8"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/doctrine.yaml",
|
||||
"config/packages/prod/doctrine.yaml",
|
||||
"src/Entity/.gitignore",
|
||||
"src/Repository/.gitignore"
|
||||
]
|
||||
"version": "1.6",
|
||||
"ref": "44d3aa7752dd46f77ba11af2297a25e1dedfb4d0"
|
||||
}
|
||||
},
|
||||
"doctrine/doctrine-migrations-bundle": {
|
||||
"version": "2.2",
|
||||
"version": "1.2",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "2.2",
|
||||
"ref": "baaa439e3e3179e69e3da84b671f0a3e4a2f56ad"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/doctrine_migrations.yaml",
|
||||
"migrations/.gitignore"
|
||||
]
|
||||
"version": "1.2",
|
||||
"ref": "c1431086fec31f17fbcfe6d6d7e92059458facc1"
|
||||
}
|
||||
},
|
||||
"doctrine/event-manager": {
|
||||
"version": "1.1.1"
|
||||
"version": "v1.0.0"
|
||||
},
|
||||
"doctrine/inflector": {
|
||||
"version": "1.4.3"
|
||||
"version": "v1.2.0"
|
||||
},
|
||||
"doctrine/instantiator": {
|
||||
"version": "1.4.0"
|
||||
"version": "1.1.0"
|
||||
},
|
||||
"doctrine/lexer": {
|
||||
"version": "1.2.1"
|
||||
"version": "v1.0.1"
|
||||
},
|
||||
"doctrine/migrations": {
|
||||
"version": "2.3.2"
|
||||
"version": "v1.8.1"
|
||||
},
|
||||
"doctrine/orm": {
|
||||
"version": "2.7.5"
|
||||
"version": "v2.5.13"
|
||||
},
|
||||
"doctrine/persistence": {
|
||||
"version": "1.3.8"
|
||||
"version": "v1.0.0"
|
||||
},
|
||||
"doctrine/reflection": {
|
||||
"version": "v1.0.0"
|
||||
},
|
||||
"doctrine/sql-formatter": {
|
||||
"version": "1.1.1"
|
||||
},
|
||||
"friendsofphp/proxy-manager-lts": {
|
||||
"version": "v1.0.3"
|
||||
"version": "1.0.1"
|
||||
},
|
||||
"laminas/laminas-code": {
|
||||
"version": "4.0.0"
|
||||
"version": "3.4.1"
|
||||
},
|
||||
"laminas/laminas-eventmanager": {
|
||||
"version": "3.2.1"
|
||||
},
|
||||
"laminas/laminas-zendframework-bridge": {
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"monolog/monolog": {
|
||||
"version": "2.2.0"
|
||||
},
|
||||
"myclabs/deep-copy": {
|
||||
"version": "1.10.2"
|
||||
"version": "1.23.0"
|
||||
},
|
||||
"nikic/php-parser": {
|
||||
"version": "v4.10.4"
|
||||
"version": "v4.0.0"
|
||||
},
|
||||
"phar-io/manifest": {
|
||||
"version": "2.0.3"
|
||||
"ocramius/package-versions": {
|
||||
"version": "1.3.0"
|
||||
},
|
||||
"phar-io/version": {
|
||||
"version": "3.1.1"
|
||||
},
|
||||
"phpdocumentor/reflection-common": {
|
||||
"ocramius/proxy-manager": {
|
||||
"version": "2.2.0"
|
||||
},
|
||||
"phpdocumentor/reflection-docblock": {
|
||||
"version": "5.3.0"
|
||||
},
|
||||
"phpdocumentor/type-resolver": {
|
||||
"version": "1.6.0"
|
||||
},
|
||||
"phpspec/prophecy": {
|
||||
"version": "v1.15.0"
|
||||
},
|
||||
"phpunit/php-code-coverage": {
|
||||
"version": "9.2.10"
|
||||
},
|
||||
"phpunit/php-file-iterator": {
|
||||
"version": "3.0.6"
|
||||
},
|
||||
"phpunit/php-invoker": {
|
||||
"version": "3.1.1"
|
||||
},
|
||||
"phpunit/php-text-template": {
|
||||
"version": "2.0.4"
|
||||
},
|
||||
"phpunit/php-timer": {
|
||||
"version": "5.0.3"
|
||||
},
|
||||
"phpunit/phpunit": {
|
||||
"version": "9.5",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "9.3",
|
||||
"ref": "a6249a6c4392e9169b87abf93225f7f9f59025e6"
|
||||
},
|
||||
"files": [
|
||||
".env.test",
|
||||
"phpunit.xml.dist",
|
||||
"tests/bootstrap.php"
|
||||
]
|
||||
"php": {
|
||||
"version": "7.4"
|
||||
},
|
||||
"psr/cache": {
|
||||
"version": "1.0.1"
|
||||
|
@ -153,59 +99,11 @@
|
|||
"version": "1.0.0"
|
||||
},
|
||||
"psr/log": {
|
||||
"version": "1.1.3"
|
||||
"version": "1.0.2"
|
||||
},
|
||||
"roave/security-advisories": {
|
||||
"version": "dev-master"
|
||||
},
|
||||
"sebastian/cli-parser": {
|
||||
"version": "1.0.1"
|
||||
},
|
||||
"sebastian/code-unit": {
|
||||
"version": "1.0.8"
|
||||
},
|
||||
"sebastian/code-unit-reverse-lookup": {
|
||||
"version": "2.0.3"
|
||||
},
|
||||
"sebastian/comparator": {
|
||||
"version": "4.0.6"
|
||||
},
|
||||
"sebastian/complexity": {
|
||||
"version": "2.0.2"
|
||||
},
|
||||
"sebastian/diff": {
|
||||
"version": "4.0.4"
|
||||
},
|
||||
"sebastian/environment": {
|
||||
"version": "5.1.3"
|
||||
},
|
||||
"sebastian/exporter": {
|
||||
"version": "4.0.4"
|
||||
},
|
||||
"sebastian/global-state": {
|
||||
"version": "5.0.5"
|
||||
},
|
||||
"sebastian/lines-of-code": {
|
||||
"version": "1.0.3"
|
||||
},
|
||||
"sebastian/object-enumerator": {
|
||||
"version": "4.0.4"
|
||||
},
|
||||
"sebastian/object-reflector": {
|
||||
"version": "2.0.4"
|
||||
},
|
||||
"sebastian/recursion-context": {
|
||||
"version": "4.0.4"
|
||||
},
|
||||
"sebastian/resource-operations": {
|
||||
"version": "3.0.3"
|
||||
},
|
||||
"sebastian/type": {
|
||||
"version": "2.3.4"
|
||||
},
|
||||
"sebastian/version": {
|
||||
"version": "3.0.2"
|
||||
},
|
||||
"sensio/framework-extra-bundle": {
|
||||
"version": "5.2",
|
||||
"recipe": {
|
||||
|
@ -213,58 +111,67 @@
|
|||
"branch": "master",
|
||||
"version": "5.2",
|
||||
"ref": "fb7e19da7f013d0d422fa9bce16f5c510e27609b"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/sensio_framework_extra.yaml"
|
||||
]
|
||||
}
|
||||
},
|
||||
"symfony/cache": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v3.3.13"
|
||||
},
|
||||
"symfony/cache-contracts": {
|
||||
"version": "v2.2.0"
|
||||
"version": "v1.1.1"
|
||||
},
|
||||
"symfony/config": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v3.3.13"
|
||||
},
|
||||
"symfony/console": {
|
||||
"version": "5.1",
|
||||
"version": "3.3",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "5.1",
|
||||
"ref": "c6d02bdfba9da13c22157520e32a602dbee8a75c"
|
||||
"version": "3.3",
|
||||
"ref": "9f94d3ea453cd8a3b95db7f82592d7344fe3a76a"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"bin/console"
|
||||
]
|
||||
"symfony/debug": {
|
||||
"version": "v4.4.9"
|
||||
},
|
||||
"symfony/debug-bundle": {
|
||||
"version": "4.1",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "4.1",
|
||||
"ref": "f8863cbad2f2e58c4b65fa1eac892ab189971bea"
|
||||
}
|
||||
},
|
||||
"symfony/debug-pack": {
|
||||
"version": "v1.0.5"
|
||||
},
|
||||
"symfony/dependency-injection": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v3.3.13"
|
||||
},
|
||||
"symfony/deprecation-contracts": {
|
||||
"version": "v2.2.0"
|
||||
"version": "v2.1.2"
|
||||
},
|
||||
"symfony/doctrine-bridge": {
|
||||
"version": "v5.1.11"
|
||||
"version": "v4.0.0"
|
||||
},
|
||||
"symfony/dotenv": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v3.3.13"
|
||||
},
|
||||
"symfony/error-handler": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v4.4.0"
|
||||
},
|
||||
"symfony/event-dispatcher": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v3.3.13"
|
||||
},
|
||||
"symfony/event-dispatcher-contracts": {
|
||||
"version": "v2.2.0"
|
||||
"version": "v1.1.1"
|
||||
},
|
||||
"symfony/filesystem": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v3.3.13"
|
||||
},
|
||||
"symfony/finder": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v3.3.13"
|
||||
},
|
||||
"symfony/flex": {
|
||||
"version": "1.0",
|
||||
|
@ -272,40 +179,32 @@
|
|||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "1.0",
|
||||
"ref": "c0eeb50665f0f77226616b6038a9b06c03752d8e"
|
||||
},
|
||||
"files": [
|
||||
".env"
|
||||
]
|
||||
"ref": "e921bdbfe20cdefa3b82f379d1cd36df1bc8d115"
|
||||
}
|
||||
},
|
||||
"symfony/form": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v4.0.0"
|
||||
},
|
||||
"symfony/framework-bundle": {
|
||||
"version": "5.2",
|
||||
"version": "3.3",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "5.2",
|
||||
"ref": "6ec87563dcc85cd0c48856dcfbfc29610506d250"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/cache.yaml",
|
||||
"config/packages/framework.yaml",
|
||||
"config/packages/test/framework.yaml",
|
||||
"config/preload.php",
|
||||
"config/routes/dev/framework.yaml",
|
||||
"config/services.yaml",
|
||||
"public/index.php",
|
||||
"src/Controller/.gitignore",
|
||||
"src/Kernel.php"
|
||||
]
|
||||
"version": "3.3",
|
||||
"ref": "305b268e55e75059f20ec9827a8fd09a35c59866"
|
||||
}
|
||||
},
|
||||
"symfony/http-foundation": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v3.3.13"
|
||||
},
|
||||
"symfony/http-kernel": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v3.3.13"
|
||||
},
|
||||
"symfony/inflector": {
|
||||
"version": "v4.0.0"
|
||||
},
|
||||
"symfony/intl": {
|
||||
"version": "v4.0.0"
|
||||
},
|
||||
"symfony/maker-bundle": {
|
||||
"version": "1.0",
|
||||
|
@ -317,78 +216,70 @@
|
|||
}
|
||||
},
|
||||
"symfony/monolog-bridge": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v4.1.1"
|
||||
},
|
||||
"symfony/monolog-bundle": {
|
||||
"version": "3.3",
|
||||
"version": "3.1",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "3.3",
|
||||
"ref": "d7249f7d560f6736115eee1851d02a65826f0a56"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/dev/monolog.yaml",
|
||||
"config/packages/prod/deprecations.yaml",
|
||||
"config/packages/prod/monolog.yaml",
|
||||
"config/packages/test/monolog.yaml"
|
||||
]
|
||||
"version": "3.1",
|
||||
"ref": "51b7a31438c8aeeda7931a0ece98a945c91e7f20"
|
||||
}
|
||||
},
|
||||
"symfony/options-resolver": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v4.0.0"
|
||||
},
|
||||
"symfony/orm-pack": {
|
||||
"version": "v1.0.5"
|
||||
},
|
||||
"symfony/polyfill-ctype": {
|
||||
"version": "v1.22.1"
|
||||
"version": "v1.8.0"
|
||||
},
|
||||
"symfony/polyfill-intl-grapheme": {
|
||||
"version": "v1.22.1"
|
||||
"version": "v1.17.0"
|
||||
},
|
||||
"symfony/polyfill-intl-icu": {
|
||||
"version": "v1.22.1"
|
||||
"version": "v1.6.0"
|
||||
},
|
||||
"symfony/polyfill-intl-normalizer": {
|
||||
"version": "v1.22.1"
|
||||
"version": "v1.17.0"
|
||||
},
|
||||
"symfony/polyfill-mbstring": {
|
||||
"version": "v1.22.1"
|
||||
"version": "v1.6.0"
|
||||
},
|
||||
"symfony/polyfill-php72": {
|
||||
"version": "v1.24.0"
|
||||
"symfony/polyfill-php73": {
|
||||
"version": "v1.11.0"
|
||||
},
|
||||
"symfony/polyfill-php80": {
|
||||
"version": "v1.22.1"
|
||||
"version": "v1.17.0"
|
||||
},
|
||||
"symfony/polyfill-php81": {
|
||||
"version": "v1.23.0"
|
||||
"symfony/profiler-pack": {
|
||||
"version": "v1.0.3"
|
||||
},
|
||||
"symfony/property-access": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v4.0.0"
|
||||
},
|
||||
"symfony/property-info": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v5.1.0"
|
||||
},
|
||||
"symfony/routing": {
|
||||
"version": "5.1",
|
||||
"version": "3.3",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "5.1",
|
||||
"ref": "b4f3e7c95e38b606eef467e8a42a8408fc460c43"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/prod/routing.yaml",
|
||||
"config/packages/routing.yaml",
|
||||
"config/routes.yaml"
|
||||
]
|
||||
"version": "3.3",
|
||||
"ref": "a249484db698d1a847a30291c8f732414ac47e25"
|
||||
}
|
||||
},
|
||||
"symfony/service-contracts": {
|
||||
"version": "v2.2.0"
|
||||
"version": "v1.1.2"
|
||||
},
|
||||
"symfony/stopwatch": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v4.1.1"
|
||||
},
|
||||
"symfony/string": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v5.1.0"
|
||||
},
|
||||
"symfony/translation": {
|
||||
"version": "3.3",
|
||||
|
@ -396,7 +287,7 @@
|
|||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "3.3",
|
||||
"ref": "2ad9d2545bce8ca1a863e50e92141f0b9d87ffcd"
|
||||
"ref": "1fb02a6e1c8f3d4232cce485c9afa868d63b115a"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/translation.yaml",
|
||||
|
@ -404,24 +295,22 @@
|
|||
]
|
||||
},
|
||||
"symfony/translation-contracts": {
|
||||
"version": "v2.3.0"
|
||||
"version": "v1.1.2"
|
||||
},
|
||||
"symfony/twig-bridge": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v4.0.0"
|
||||
},
|
||||
"symfony/twig-bundle": {
|
||||
"version": "5.0",
|
||||
"version": "3.3",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "master",
|
||||
"version": "5.0",
|
||||
"ref": "fab9149bbaa4d5eca054ed93f9e1b66cc500895d"
|
||||
"version": "3.3",
|
||||
"ref": "f75ac166398e107796ca94cc57fa1edaa06ec47f"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"config/packages/test/twig.yaml",
|
||||
"config/packages/twig.yaml",
|
||||
"templates/base.html.twig"
|
||||
]
|
||||
"symfony/twig-pack": {
|
||||
"version": "v1.0.0"
|
||||
},
|
||||
"symfony/validator": {
|
||||
"version": "4.3",
|
||||
|
@ -437,10 +326,10 @@
|
|||
]
|
||||
},
|
||||
"symfony/var-dumper": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v4.1.1"
|
||||
},
|
||||
"symfony/var-exporter": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v4.2.0"
|
||||
},
|
||||
"symfony/web-profiler-bundle": {
|
||||
"version": "3.3",
|
||||
|
@ -449,23 +338,24 @@
|
|||
"branch": "master",
|
||||
"version": "3.3",
|
||||
"ref": "6bdfa1a95f6b2e677ab985cd1af2eae35d62e0f6"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/dev/web_profiler.yaml",
|
||||
"config/packages/test/web_profiler.yaml",
|
||||
"config/routes/dev/web_profiler.yaml"
|
||||
]
|
||||
}
|
||||
},
|
||||
"symfony/yaml": {
|
||||
"version": "v5.2.3"
|
||||
"version": "v5.0.7"
|
||||
},
|
||||
"theseer/tokenizer": {
|
||||
"version": "1.2.1"
|
||||
"twig/extra-bundle": {
|
||||
"version": "v3.0.3"
|
||||
},
|
||||
"twig/twig": {
|
||||
"version": "v3.3.0"
|
||||
"version": "v2.4.4"
|
||||
},
|
||||
"webmozart/assert": {
|
||||
"version": "1.10.0"
|
||||
"webimpress/safe-writer": {
|
||||
"version": "2.0.0"
|
||||
},
|
||||
"zendframework/zend-code": {
|
||||
"version": "3.3.0"
|
||||
},
|
||||
"zendframework/zend-eventmanager": {
|
||||
"version": "3.2.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\Dotenv\Dotenv;
|
||||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
if (file_exists(dirname(__DIR__) . '/config/bootstrap.php')) {
|
||||
require dirname(__DIR__) . '/config/bootstrap.php';
|
||||
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
|
||||
(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env');
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
function walk_array(callable $method, array $items): void
|
||||
{
|
||||
foreach ($items as $item) {
|
||||
$method($item);
|
||||
}
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"require": {
|
||||
"friendsofphp/php-cs-fixer": "^3.6",
|
||||
"rector/rector": "^0.12.16"
|
||||
}
|
||||
}
|
2149
tools/composer.lock
generated
2149
tools/composer.lock
generated
File diff suppressed because it is too large
Load Diff
|
@ -1,85 +0,0 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Rector\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector;
|
||||
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
|
||||
use Rector\CodeQuality\Rector\For_\{ForRepeatedCountToOwnVariableRector, ForToForeachRector};
|
||||
use Rector\CodeQuality\Rector\If_\{ConsecutiveNullCompareReturnsToNullCoalesceQueueRector, SimplifyIfElseToTernaryRector, SimplifyIfReturnBoolRector};
|
||||
use Rector\CodeQuality\Rector\Ternary\{SimplifyDuplicatedTernaryRector, SimplifyTautologyTernaryRector, SwitchNegatedTernaryRector};
|
||||
use Rector\CodingStyle\Rector\Class_\AddArrayDefaultToArrayPropertyRector;
|
||||
use Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector;
|
||||
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
|
||||
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
|
||||
use Rector\CodingStyle\Rector\FuncCall\{CallUserFuncArrayToVariadicRector, CallUserFuncToMethodCallRector, CountArrayToEmptyArrayComparisonRector};
|
||||
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\DeadCode\Rector\ClassMethod\{RemoveUselessParamTagRector, RemoveUselessReturnTagRector};
|
||||
use Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector;
|
||||
use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector;
|
||||
use Rector\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector;
|
||||
use Rector\Doctrine\Set\DoctrineSetList;
|
||||
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
|
||||
use Rector\EarlyReturn\Rector\If_\{ChangeIfElseValueAssignToEarlyReturnRector, RemoveAlwaysElseRector};
|
||||
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
|
||||
use Rector\Restoration\Rector\Property\MakeTypedPropertyNullableIfCheckedRector;
|
||||
use Rector\Set\ValueObject\LevelSetList;
|
||||
use Rector\Symfony\Set\{SymfonyLevelSetList, SymfonySetList};
|
||||
use Rector\TypeDeclaration\Rector\ClassMethod\{AddArrayParamDocTypeRector, AddArrayReturnDocTypeRector, AddMethodCallBasedStrictParamTypeRector, ParamTypeByMethodCallTypeRector, ParamTypeByParentCallTypeRector};
|
||||
use Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector;
|
||||
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
require_once __DIR__ . '/common.inc.php';
|
||||
|
||||
return static function (ContainerConfigurator $config): void {
|
||||
$parameters = $config->parameters();
|
||||
$parameters->set(Option::AUTO_IMPORT_NAMES, TRUE);
|
||||
$parameters->set(Option::IMPORT_SHORT_CLASSES, TRUE);
|
||||
$parameters->set(Option::SKIP, [
|
||||
ReadOnlyPropertyRector::class,
|
||||
]);
|
||||
|
||||
walk_array([$config, 'import'], [
|
||||
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
|
||||
LevelSetList::UP_TO_PHP_81,
|
||||
SymfonyLevelSetList::UP_TO_SYMFONY_60,
|
||||
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
|
||||
]);
|
||||
|
||||
$services = $config->services();
|
||||
walk_array([$services, 'set'], [
|
||||
SimplifyDeMorganBinaryRector::class,
|
||||
CompleteDynamicPropertiesRector::class,
|
||||
ForRepeatedCountToOwnVariableRector::class,
|
||||
ForToForeachRector::class,
|
||||
ConsecutiveNullCompareReturnsToNullCoalesceQueueRector::class,
|
||||
SimplifyIfElseToTernaryRector::class,
|
||||
SimplifyIfReturnBoolRector::class,
|
||||
SimplifyDuplicatedTernaryRector::class,
|
||||
SimplifyTautologyTernaryRector::class,
|
||||
SwitchNegatedTernaryRector::class,
|
||||
AddArrayDefaultToArrayPropertyRector::class,
|
||||
RemoveFinalFromConstRector::class,
|
||||
NewlineBeforeNewAssignSetRector::class,
|
||||
WrapEncapsedVariableInCurlyBracesRector::class,
|
||||
CallUserFuncArrayToVariadicRector::class,
|
||||
CallUserFuncToMethodCallRector::class,
|
||||
CountArrayToEmptyArrayComparisonRector::class,
|
||||
NewlineAfterStatementRector::class,
|
||||
RemoveUselessParamTagRector::class,
|
||||
RemoveUselessReturnTagRector::class,
|
||||
RemoveUnusedForeachKeyRector::class,
|
||||
RemoveUselessVarTagRector::class,
|
||||
RemoveDuplicatedCaseInSwitchRector::class,
|
||||
ChangeNestedForeachIfsToEarlyContinueRector::class,
|
||||
ChangeIfElseValueAssignToEarlyReturnRector::class,
|
||||
RemoveAlwaysElseRector::class,
|
||||
MakeTypedPropertyNullableIfCheckedRector::class,
|
||||
AddArrayParamDocTypeRector::class,
|
||||
AddArrayReturnDocTypeRector::class,
|
||||
AddMethodCallBasedStrictParamTypeRector::class,
|
||||
ParamTypeByMethodCallTypeRector::class,
|
||||
ParamTypeByParentCallTypeRector::class,
|
||||
AddClosureReturnTypeRector::class,
|
||||
TypedPropertyFromAssignsRector::class,
|
||||
]);
|
||||
};
|
|
@ -1,4 +1,4 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
return [
|
||||
'' => '',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php
|
||||
|
||||
return [
|
||||
'This value should be false.' => 'This value should be false.',
|
||||
|
|
Loading…
Reference in New Issue
Block a user