diff --git a/composer.lock b/composer.lock index f15faef..cf9c21e 100644 --- a/composer.lock +++ b/composer.lock @@ -1700,16 +1700,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.1", + "version": "v4.15.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", "shasum": "" }, "require": { @@ -1750,9 +1750,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" }, - "time": "2022-09-04T07:30:47+00:00" + "time": "2022-11-12T15:38:23+00:00" }, { "name": "psr/cache", @@ -3451,16 +3451,16 @@ }, { "name": "symfony/maker-bundle", - "version": "v1.47.0", + "version": "v1.48.0", "source": { "type": "git", "url": "https://github.com/symfony/maker-bundle.git", - "reference": "e607f129d29a6c1e9a9e1ef3d229d653311d58f3" + "reference": "2e428e8432e9879187672fe08f1cc335e2a31dd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/e607f129d29a6c1e9a9e1ef3d229d653311d58f3", - "reference": "e607f129d29a6c1e9a9e1ef3d229d653311d58f3", + "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/2e428e8432e9879187672fe08f1cc335e2a31dd6", + "reference": "2e428e8432e9879187672fe08f1cc335e2a31dd6", "shasum": "" }, "require": { @@ -3524,7 +3524,7 @@ ], "support": { "issues": "https://github.com/symfony/maker-bundle/issues", - "source": "https://github.com/symfony/maker-bundle/tree/v1.47.0" + "source": "https://github.com/symfony/maker-bundle/tree/v1.48.0" }, "funding": [ { @@ -3540,7 +3540,7 @@ "type": "tidelift" } ], - "time": "2022-10-04T15:05:10+00:00" + "time": "2022-11-14T10:48:46+00:00" }, { "name": "symfony/monolog-bridge", @@ -3847,16 +3847,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { @@ -3871,7 +3871,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3909,7 +3909,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" }, "funding": [ { @@ -3925,20 +3925,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", "shasum": "" }, "require": { @@ -3950,7 +3950,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3990,7 +3990,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" }, "funding": [ { @@ -4006,20 +4006,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-icu", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-icu.git", - "reference": "e407643d610e5f2c8a4b14189150f68934bf5e48" + "reference": "a3d9148e2c363588e05abbdd4ee4f971f0a5330c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/e407643d610e5f2c8a4b14189150f68934bf5e48", - "reference": "e407643d610e5f2c8a4b14189150f68934bf5e48", + "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/a3d9148e2c363588e05abbdd4ee4f971f0a5330c", + "reference": "a3d9148e2c363588e05abbdd4ee4f971f0a5330c", "shasum": "" }, "require": { @@ -4031,7 +4031,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4077,7 +4077,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-icu/tree/v1.27.0" }, "funding": [ { @@ -4093,20 +4093,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", "shasum": "" }, "require": { @@ -4118,7 +4118,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4161,7 +4161,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" }, "funding": [ { @@ -4177,20 +4177,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { @@ -4205,7 +4205,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4244,7 +4244,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { @@ -4260,20 +4260,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2" + "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/bf44a9fd41feaac72b074de600314a93e2ae78e2", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", + "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", "shasum": "" }, "require": { @@ -4282,7 +4282,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4320,7 +4320,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" }, "funding": [ { @@ -4336,20 +4336,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "shasum": "" }, "require": { @@ -4358,7 +4358,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4403,7 +4403,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" }, "funding": [ { @@ -4419,7 +4419,7 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/property-access", @@ -6655,12 +6655,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "45470fe91508b361778c84cb492d17826c04bbd7" + "reference": "ed33734832e5a87eaa4341be7ce580de54157460" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/45470fe91508b361778c84cb492d17826c04bbd7", - "reference": "45470fe91508b361778c84cb492d17826c04bbd7", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/ed33734832e5a87eaa4341be7ce580de54157460", + "reference": "ed33734832e5a87eaa4341be7ce580de54157460", "shasum": "" }, "conflict": { @@ -6709,7 +6709,7 @@ "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", "cartalyst/sentry": "<=2.1.6", "catfan/medoo": "<1.7.5", - "centreon/centreon": "<21.4.16|>=21.10,<21.10.8|>=22,<22.4.1", + "centreon/centreon": "<22.10-beta.1", "cesnet/simplesamlphp-module-proxystatistics": "<3.1", "codeception/codeception": "<3.1.3|>=4,<4.1.22", "codeigniter/framework": "<=3.0.6", @@ -6717,7 +6717,7 @@ "codeigniter4/shield": "= 1.0.0-beta", "codiad/codiad": "<=2.8.4", "composer/composer": "<1.10.26|>=2-alpha.1,<2.2.12|>=2.3,<2.3.5", - "concrete5/concrete5": "<9", + "concrete5/concrete5": ">= 9.0.0RC1, < 9.1.3|<9", "concrete5/core": "<8.5.8|>=9,<9.1", "contao-components/mediaelement": ">=2.14.2,<2.21.1", "contao/contao": ">=4,<4.4.56|>=4.5,<4.9.18|>=4.10,<4.11.7|>=4.13,<4.13.3", @@ -6763,16 +6763,17 @@ "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", "ezsystems/ezplatform": "<=1.13.6|>=2,<=2.5.24", - "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6|>=1.5,<1.5.27", + "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6|>=1.5,<1.5.29|>=2.3,<2.3.26", "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", - "ezsystems/ezplatform-kernel": "<=1.2.5|>=1.3,<1.3.19", + "ezsystems/ezplatform-graphql": ">=1-rc.1,<1.0.13|>=2-beta.1,<2.3.12", + "ezsystems/ezplatform-kernel": "<=1.2.5|>=1.3,<1.3.26", "ezsystems/ezplatform-rest": ">=1.2,<=1.2.2|>=1.3,<1.3.8", "ezsystems/ezplatform-richtext": ">=2.3,<=2.3.7", "ezsystems/ezplatform-user": ">=1,<1.0.1", - "ezsystems/ezpublish-kernel": "<=6.13.8.1|>=7,<7.5.29", + "ezsystems/ezpublish-kernel": "<=6.13.8.1|>=7,<7.5.30", "ezsystems/ezpublish-legacy": "<=2017.12.7.3|>=2018.6,<=2019.3.5.1", "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", - "ezsystems/repository-forms": ">=2.3,<2.3.2.1", + "ezsystems/repository-forms": ">=2.3,<2.3.2.1|>=2.5,<2.5.15", "ezyang/htmlpurifier": "<4.1.1", "facade/ignition": "<1.16.15|>=2,<2.4.2|>=2.5,<2.5.2", "facturascripts/facturascripts": "<=2022.8", @@ -6796,7 +6797,7 @@ "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", "froala/wysiwyg-editor": "<3.2.7", - "froxlor/froxlor": "<0.10.38", + "froxlor/froxlor": "<0.10.39", "fuel/core": "<1.8.1", "gaoming13/wechat-php-sdk": "<=1.10.2", "genix/cms": "<=1.1.11", @@ -6818,7 +6819,9 @@ "hjue/justwriting": "<=1", "hov/jobfair": "<1.0.13|>=2,<2.0.2", "hyn/multi-tenant": ">=5.6,<5.7.2", - "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4", + "ibexa/admin-ui": ">=4.2,<4.2.3", + "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4|>=4.2,<4.2.3", + "ibexa/graphql": ">=2.5,<2.5.31|>=3.3,<3.3.28|>=4.2,<4.2.3", "ibexa/post-install": "<=1.0.4", "icecoder/icecoder": "<=8.1", "idno/known": "<=1.3.1", @@ -6913,7 +6916,7 @@ "onelogin/php-saml": "<2.10.4", "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", "open-web-analytics/open-web-analytics": "<1.7.4", - "opencart/opencart": "<=3.0.3.2", + "opencart/opencart": "<=3.0.3.7", "openid/php-openid": "<2.3", "openmage/magento-lts": "<19.4.15|>=20,<20.0.13", "orchid/platform": ">=9,<9.4.4", @@ -7181,7 +7184,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T10:04:41+00:00" + "time": "2022-11-16T22:04:17+00:00" }, { "name": "sebastian/cli-parser", diff --git a/config/bundles.php b/config/bundles.php index 5580e7c..04e5548 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -1,4 +1,4 @@ - ['all' => true], diff --git a/config/packages/cache.php b/config/packages/cache.php index b7b5cc4..adc9f8a 100644 --- a/config/packages/cache.php +++ b/config/packages/cache.php @@ -1,6 +1,4 @@ -extension('monolog', ['handlers' => ['main' => ['type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug', 'channels' => ['!event']], 'console' => ['type' => 'console', 'process_psr_3_messages' => false, 'channels' => ['!event', '!doctrine', '!console']]]]); +return static function (MonologConfig $config): void { + $config->handler('main', [ + 'type' => 'stream', + 'path' => '%kernel.logs_dir%/%kernel.environment%.log', + 'level' => 'debug', + 'channels' => ['elements' => ['!event']] + ]); + $config->handler('console', [ + 'type' => 'console', + 'process_psr_3_messages' => false, + 'channels' => ['elements' => ['!event', '!doctrine', '!console']] + ]); }; diff --git a/config/packages/dev/web_profiler.php b/config/packages/dev/web_profiler.php index 739dbcb..fc813de 100644 --- a/config/packages/dev/web_profiler.php +++ b/config/packages/dev/web_profiler.php @@ -1,11 +1,16 @@ -extension('web_profiler', ['toolbar' => true, 'intercept_redirects' => false]); + $containerConfigurator->extension('web_profiler', [ + 'toolbar' => true, + 'intercept_redirects' => false + ]); - $containerConfigurator->extension('framework', ['profiler' => ['only_exceptions' => false]]); + $containerConfigurator->extension('framework', [ + 'profiler' => [ + 'only_exceptions' => false + ] + ]); }; diff --git a/config/packages/doctrine.php b/config/packages/doctrine.php index 5e24ffb..ea800d5 100644 --- a/config/packages/doctrine.php +++ b/config/packages/doctrine.php @@ -7,13 +7,13 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura return static function (ContainerConfigurator $containerConfigurator): void { $parameters = $containerConfigurator->parameters(); - $parameters->set('env(DATABASE_URL)', ''); $containerConfigurator->extension('doctrine', [ 'dbal' => [ 'driver' => 'pdo_pgsql', 'types' => ['money' => MoneyType::class], + 'logging' => '%kernel.debug%', 'mapping_types' => ['bit' => 'boolean', 'money' => 'money'], 'url' => '%env(DATABASE_URL)%' ], diff --git a/config/packages/framework.php b/config/packages/framework.php index ff2b94a..dc719c4 100644 --- a/config/packages/framework.php +++ b/config/packages/framework.php @@ -2,14 +2,15 @@ declare(strict_types=1); +use Symfony\Config\FrameworkConfig; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -return static function (ContainerConfigurator $containerConfigurator): void { - $containerConfigurator->extension('framework', [ - 'secret' => '%env(APP_SECRET)%', - 'default_locale' => 'en', - 'http_method_override' => false, - 'session' => ['handler_id' => null], - 'php_errors' => ['log' => true] - ]); +return static function (ContainerConfigurator $containerConfigurator, FrameworkConfig $config): void { + $config->session(['handler_id' => null]); + + $config->secret('%env(APP_SECRET)%') + ->defaultLocale('en') + ->httpMethodOverride(true) + ->phpErrors(['log' => true]) + ; }; diff --git a/config/packages/prod/deprecations.php b/config/packages/prod/deprecations.php deleted file mode 100644 index e69de29..0000000 diff --git a/config/packages/prod/doctrine.php b/config/packages/prod/doctrine.php index 1cb02a4..7f876a8 100644 --- a/config/packages/prod/doctrine.php +++ b/config/packages/prod/doctrine.php @@ -1,12 +1,25 @@ -extension('doctrine', ['orm' => ['metadata_cache_driver' => ['type' => 'service', 'id' => 'doctrine.system_cache_provider'], 'query_cache_driver' => ['type' => 'service', 'id' => 'doctrine.system_cache_provider'], 'result_cache_driver' => ['type' => 'service', 'id' => 'doctrine.result_cache_provider']]]); + $containerConfigurator->extension('doctrine', [ + 'orm' => [ + 'metadata_cache_driver' => [ + 'type' => 'service', + 'id' => 'doctrine.system_cache_provider' + ], + 'query_cache_driver' => [ + 'type' => 'service', + 'id' => 'doctrine.system_cache_provider' + ], + 'result_cache_driver' => [ + 'type' => 'service', + 'id' => 'doctrine.result_cache_provider' + ] + ] + ]); $services = $containerConfigurator->services(); @@ -18,5 +31,16 @@ return static function (ContainerConfigurator $containerConfigurator): void { ->private() ->args([service('doctrine.system_cache_pool')]); - $containerConfigurator->extension('framework', ['cache' => ['pools' => ['doctrine.result_cache_pool' => ['adapter' => 'cache.app'], 'doctrine.system_cache_pool' => ['adapter' => 'cache.system']]]]); + $containerConfigurator->extension('framework', [ + 'cache' => [ + 'pools' => [ + 'doctrine.result_cache_pool' => [ + 'adapter' => 'cache.app' + ], + 'doctrine.system_cache_pool' => [ + 'adapter' => 'cache.system' + ] + ] + ] + ]); }; diff --git a/config/packages/prod/monolog.php b/config/packages/prod/monolog.php index 21f7358..b4be096 100644 --- a/config/packages/prod/monolog.php +++ b/config/packages/prod/monolog.php @@ -1,9 +1,26 @@ -extension('monolog', ['handlers' => ['main' => ['type' => 'fingers_crossed', 'action_level' => 'error', 'handler' => 'nested', 'excluded_404s' => ['^/']], 'nested' => ['type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug'], 'console' => ['type' => 'console', 'process_psr_3_messages' => false, 'channels' => ['!event', '!doctrine']]]]); + $containerConfigurator->extension('monolog', [ + 'handlers' => [ + 'main' => [ + 'type' => 'fingers_crossed', + 'action_level' => 'error', + 'handler' => 'nested', + 'excluded_404s' => ['^/'] + ], + 'nested' => [ + 'type' => 'stream', + 'path' => '%kernel.logs_dir%/%kernel.environment%.log', + 'level' => 'debug' + ], + 'console' => [ + 'type' => 'console', + 'process_psr_3_messages' => false, + 'channels' => ['!event', '!doctrine'] + ] + ] + ]); }; diff --git a/config/packages/prod/routing.php b/config/packages/prod/routing.php index bd1f940..a4dde3d 100644 --- a/config/packages/prod/routing.php +++ b/config/packages/prod/routing.php @@ -1,9 +1,9 @@ -extension('framework', ['router' => ['strict_requirements' => null]]); + $containerConfigurator->extension('framework', [ + 'router' => ['strict_requirements' => null] + ]); }; diff --git a/config/packages/routing.php b/config/packages/routing.php index 193c6c4..49a559f 100644 --- a/config/packages/routing.php +++ b/config/packages/routing.php @@ -1,9 +1,12 @@ -extension('framework', ['router' => ['strict_requirements' => null, 'utf8' => true]]); + $containerConfigurator->extension('framework', [ + 'router' => [ + 'strict_requirements' => null, + 'utf8' => true + ] + ]); }; diff --git a/config/packages/security.php b/config/packages/security.php index b769c7d..0793f91 100644 --- a/config/packages/security.php +++ b/config/packages/security.php @@ -1,13 +1,36 @@ -extension('security', ['password_hashers' => [PasswordAuthenticatedUserInterface::class => 'auto'], 'providers' => ['users_in_memory' => ['memory' => null]], 'firewalls' => ['dev' => ['pattern' => '^/(_(profiler|wdt)|css|images|js)/', 'security' => false], 'main' => ['lazy' => true, 'provider' => 'users_in_memory']], 'access_control' => null]); +return static function (ContainerConfigurator $containerConfigurator, SecurityConfig $security): void { + $security->passwordHasher(PasswordAuthenticatedUserInterface::class, 'auto') + ; + + $containerConfigurator->extension('security', [ + 'providers' => [ + 'users_in_memory' => [ + 'memory' => null] + ], + 'firewalls' => [ + 'dev' => [ + 'pattern' => '^/(_(profiler|wdt)|css|images|js)/', + 'security' => false + ], + 'main' => [ + 'lazy' => true, + 'provider' => 'users_in_memory' + ] + ], + 'access_control' => null + ]); if ($containerConfigurator->env() === 'test') { - $containerConfigurator->extension('security', ['password_hashers' => [PasswordAuthenticatedUserInterface::class => ['algorithm' => 'auto', 'cost' => 4, 'time_cost' => 3, 'memory_cost' => 10]]]); + $security->passwordHasher(PasswordAuthenticatedUserInterface::class, [ + 'algorithm' => 'auto', + 'cost' => 4, + 'time_cost' => 3, + 'memory_cost' => 10 + ]); } }; diff --git a/config/packages/sensio_framework_extra.php b/config/packages/sensio_framework_extra.php index ef67e0f..d93263e 100644 --- a/config/packages/sensio_framework_extra.php +++ b/config/packages/sensio_framework_extra.php @@ -1,9 +1,9 @@ -extension('sensio_framework_extra', ['router' => ['annotations' => false]]); + $containerConfigurator->extension('sensio_framework_extra', [ + 'router' => ['annotations' => false] + ]); }; diff --git a/config/packages/translation.php b/config/packages/translation.php index 76466bd..adcb0b5 100644 --- a/config/packages/translation.php +++ b/config/packages/translation.php @@ -1,9 +1,13 @@ -extension('framework', ['default_locale' => 'en', 'translator' => ['default_path' => '%kernel.project_dir%/translations', 'fallbacks' => ['%locale%']]]); + $containerConfigurator->extension('framework', [ + 'default_locale' => 'en', + 'translator' => [ + 'default_path' => '%kernel.project_dir%/translations', + 'fallbacks' => ['%locale%'] + ] + ]); }; diff --git a/config/packages/twig.php b/config/packages/twig.php index 8c28435..acebcd1 100644 --- a/config/packages/twig.php +++ b/config/packages/twig.php @@ -1,9 +1,11 @@ -extension('twig', ['form_themes' => ['form_custom_layout.html.twig'], 'paths' => ['%kernel.project_dir%/templates'], 'debug' => '%kernel.debug%', 'strict_variables' => '%kernel.debug%', 'exception_controller' => null]); +return static function (TwigConfig $config): void { + $config->formThemes(['form_custom_layout.html.twig']) + ->defaultPath('%kernel.project_dir%/templates') + ->debug('%kernel.debug%') + ->strictVariables('%kernel.debug%') + ; }; diff --git a/config/packages/validator.php b/config/packages/validator.php index 46beaec..1b51cb2 100644 --- a/config/packages/validator.php +++ b/config/packages/validator.php @@ -1,6 +1,4 @@ -controller(BlogController::class) -; -}; +return static function (RoutingConfigurator $routes) {}; diff --git a/config/services.php b/config/services.php index d5cb950..86aa9e2 100644 --- a/config/services.php +++ b/config/services.php @@ -3,7 +3,6 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use App\Maker\MakeCollectionCrud; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; return function (ContainerConfigurator $configurator): void { $parameters = $configurator->parameters(); @@ -31,7 +30,7 @@ return function (ContainerConfigurator $configurator): void { // Fix wiring of custom CRUD maker class $services->set(MakeCollectionCrud::class) - ->arg('$doctrineHelper', '@maker.doctrine_helper') - ->arg('$formTypeRenderer', '@maker.renderer.form_type_renderer'); + ->arg('$doctrineHelper', service('maker.doctrine_helper')) + ->arg('$formTypeRenderer', service('maker.renderer.form_type_renderer')); }; diff --git a/src/Controller/ChipsetController.php b/src/Controller/ChipsetController.php new file mode 100644 index 0000000..c187166 --- /dev/null +++ b/src/Controller/ChipsetController.php @@ -0,0 +1,56 @@ +itemListView('chipsets', []); + } + + #[Route('/new', name: 'chipset_new', methods: ['GET', 'POST'])] + public function new(Request $request): Response + { + return $this->itemCreate($request, 'chipset'); + } + + #[Route('/{id}', name: 'chipset_show', methods: ['GET'])] + public function show(Chipset $chipset): Response + { + return $this->itemView($chipset, 'chipset'); + } + + #[Route('/{id}/edit', name: 'chipset_edit', methods: ['GET', 'POST'])] + public function edit(Request $request, Chipset $chipset): Response + { + return $this->itemUpdate($request, $chipset, 'chipset'); + } + + #[Route('/{id}', name: 'chipset_delete', methods: ['POST'])] + public function delete(Request $request, Chipset $chipset): Response + { + return $this->deleteCSRF($request, $chipset); + } +} diff --git a/src/Controller/GpuController.php b/src/Controller/GpuController.php index 2e21157..4e26a16 100644 --- a/src/Controller/GpuController.php +++ b/src/Controller/GpuController.php @@ -3,7 +3,7 @@ namespace App\Controller; use App\Entity\Gpu; -use App\Enum\SlotKeyEnum; +use App\Enum\SlotKey; use App\Form\GpuType; use App\Traits\FormControllerTrait; use Doctrine\ORM\EntityManagerInterface; @@ -34,7 +34,7 @@ class GpuController extends AbstractController $filter = fn (array $itemTypes) => array_filter($acquiredItems, fn (Gpu $item) => in_array($item->getCardKey(), $itemTypes)); - $cardTypes = SlotKeyEnum::getGroups(); + $cardTypes = SlotKey::getGroups(); $pcieCardTypes = $cardTypes['PCI Express']; $agpCardTypes = $cardTypes['AGP']; $pciCardTypes = array_merge($cardTypes['PCI 32-bit'], $cardTypes['PCI 64-bit']); diff --git a/src/Entity/BatteryType.php b/src/Entity/BatteryType.php deleted file mode 100644 index 5b4fc0e..0000000 --- a/src/Entity/BatteryType.php +++ /dev/null @@ -1,23 +0,0 @@ -id; - } -} diff --git a/src/Entity/Brand.php b/src/Entity/Brand.php index e211fbc..81db87c 100644 --- a/src/Entity/Brand.php +++ b/src/Entity/Brand.php @@ -10,7 +10,7 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Entity] #[ORM\UniqueConstraint(name: 'brand_unq', columns: ["name"])] class Brand { - use GetSetTrait; + use GetSet; #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] #[ORM\Id] @@ -21,7 +21,7 @@ class Brand { /** * @var Collection */ - #[ORM\ManyToMany(targetEntity: BrandCategory::class, fetch: 'EAGER')] + #[ORM\ManyToMany(targetEntity: BrandCategory::class, fetch: 'EXTRA_LAZY')] #[ORM\JoinTable(name: 'collection.brand_category_link')] #[ORM\JoinColumn(name: 'brand_id', referencedColumnName: 'id')] #[ORM\InverseJoinColumn(name: 'brand_category', referencedColumnName: 'category_name')] @@ -31,6 +31,8 @@ class Brand { #[ORM\Column(name: 'name', unique: TRUE, nullable: FALSE)] private string $name; + // ------------------------------------------------------------------------ + public function __construct() { $this->categories = new ArrayCollection(); diff --git a/src/Entity/BrandCategory.php b/src/Entity/BrandCategory.php index 6c8f718..582a997 100644 --- a/src/Entity/BrandCategory.php +++ b/src/Entity/BrandCategory.php @@ -7,13 +7,15 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Table(name: 'brand_category', schema: 'collection')] #[ORM\Entity] class BrandCategory { - use GetSetTrait; + use GetSet; #[ORM\Id] #[ORM\Column(name: 'category_name')] #[ORM\OrderBy(['name' => 'asc'])] private string $name; + // ------------------------------------------------------------------------ + public function __toString(): string { return $this->name; diff --git a/src/Entity/Camera.php b/src/Entity/Camera.php index 9afd9b9..6ea9c0b 100644 --- a/src/Entity/Camera.php +++ b/src/Entity/Camera.php @@ -12,6 +12,7 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: CameraRepository::class)] class Camera { + use GetSet; use CameraTrait; #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] diff --git a/src/Entity/CameraTrait.php b/src/Entity/CameraTrait.php index 9309ed0..33c6b20 100644 --- a/src/Entity/CameraTrait.php +++ b/src/Entity/CameraTrait.php @@ -11,8 +11,7 @@ use Doctrine\ORM\Mapping as ORM; */ trait CameraTrait { - use GetSetTrait; - use PurchasePriceTrait; + use PurchasePrice; #[ORM\ManyToOne(targetEntity: 'CameraType')] #[ORM\JoinColumn(name: 'type_id', referencedColumnName: 'id', nullable: FALSE)] diff --git a/src/Entity/CameraType.php b/src/Entity/CameraType.php index 71d73dc..81703a4 100644 --- a/src/Entity/CameraType.php +++ b/src/Entity/CameraType.php @@ -2,7 +2,6 @@ namespace App\Entity; -use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Stringable; @@ -13,6 +12,8 @@ use Stringable; #[ORM\Entity] class CameraType implements Stringable { + use GetSet; + #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] #[ORM\Id] #[ORM\GeneratedValue(strategy: 'IDENTITY')] @@ -25,6 +26,8 @@ class CameraType implements Stringable #[ORM\Column(name: 'description', type: 'text', nullable: TRUE)] private ?string $description = NULL; + // ------------------------------------------------------------------------ + /** * Value for serialization */ @@ -32,52 +35,4 @@ class CameraType implements Stringable { return $this->type; } - - /** - * Get id - */ - public function getId(): int - { - return $this->id; - } - - /** - * Set type - */ - public function setType(string $type): self - { - $this->type = $type; - - return $this; - } - - /** - * Set description - */ - public function setDescription(string $description): self - { - $this->description = $description; - - return $this; - } - - /** - * Get type - * - * @return string - */ - public function getType(): ?string - { - return $this->type; - } - - /** - * Get description - * - * @return string - */ - public function getDescription(): ?string - { - return $this->description; - } } diff --git a/src/Entity/Chipset.php b/src/Entity/Chipset.php new file mode 100644 index 0000000..dfc4c6b --- /dev/null +++ b/src/Entity/Chipset.php @@ -0,0 +1,38 @@ + 'asc'])] + #[ORM\JoinColumn('brand_id', referencedColumnName: 'id', nullable: FALSE)] + private Brand $brand; + + #[ORM\Column('name', type: 'string', nullable: FALSE)] + private string $name; + + #[ORM\Column('parts', type: 'string', nullable: FALSE)] + private string $parts; + + #[ORM\Column('link', type: 'string', nullable: TRUE)] + private ?string $link; + + public function __toString(): string + { + $name = $this->brand->getName() . ' ' . $this->name; + + return ($this->parts !== '') ? "{$name} ({$this->parts})" : $name; + } +} diff --git a/src/Entity/Cpu.php b/src/Entity/Cpu.php index 713ef09..976552b 100644 --- a/src/Entity/Cpu.php +++ b/src/Entity/Cpu.php @@ -2,33 +2,32 @@ namespace App\Entity; -use App\Enum\CpuArchitectureEnum; +use App\Enum\CpuArchitecture; use Doctrine\Common\Collections\{Collection, ArrayCollection}; use Doctrine\ORM\Mapping as ORM; #[ORM\Table('cpu', schema: 'collection')] #[ORM\Entity] class Cpu { - use CpuCacheTrait; - use GetSetTrait; + use GetSet; #[ORM\Column('id', type: 'integer', nullable: FALSE)] #[ORM\Id] #[ORM\GeneratedValue(strategy: 'IDENTITY')] private int $id; - #[ORM\ManyToOne(targetEntity: 'Brand', fetch: 'EAGER')] + #[ORM\ManyToOne(targetEntity: Brand::class, fetch: 'EAGER')] #[ORM\OrderBy(['name' => 'asc'])] #[ORM\JoinColumn('brand_id', referencedColumnName: 'id', nullable: FALSE)] private Brand $brand; - #[ORM\Column('architecture', type: 'string', enumType: CpuArchitectureEnum::class)] - private CpuArchitectureEnum $architecture; + #[ORM\Column('architecture', type: 'string', enumType: CpuArchitecture::class)] + private CpuArchitecture $architecture; /** * @var Collection */ - #[ORM\ManyToMany(targetEntity: Socket::class)] + #[ORM\ManyToMany(targetEntity: Socket::class, inversedBy: 'cpus', fetch: 'LAZY')] #[ORM\JoinTable('collection.cpu_socket_link')] #[ORM\JoinColumn('cpu_id', referencedColumnName: 'id')] #[ORM\InverseJoinColumn('socket_id', referencedColumnName: 'id')] @@ -104,6 +103,77 @@ class Cpu { #[ORM\Column('notes', type: 'text', nullable: true)] private ?string $notes = ''; + // ------------------------------------------------------------------------ + // CPU Cache + // ------------------------------------------------------------------------ + + #[ORM\Column('l1_data_count', type:'integer', nullable: true, options: array( + 'comment' => 'The number of L1 data caches on the package, usually the same as the number of cores' + ))] + private ?int $L1dCount = null; + + #[ORM\Column('l1_data_size', type: 'integer', nullable: true, options: array( + 'comment' => 'The size of each Level 1 data cache in KB' + ))] + private ?int $L1dSize = null; + + #[ORM\Column('l1_data_way', type: 'integer', nullable: true)] + private ?int $L1dWay = null; + + #[ORM\Column('l1_code_count', type:'integer', nullable: true, options: array( + 'comment' => 'The number of L1 instruction caches on the package, usually the same as the number of cores' + ))] + private ?int $L1cCount = null; + + #[ORM\Column('l1_code_size', type: 'integer', nullable: true, options: array( + 'comment' => 'The size of each Level 1 instruction cache in KB' + ))] + private ?int $L1cSize = null; + + #[ORM\Column('l1_code_way', type: 'integer', nullable: true)] + private ?int $L1cWay = null; + + #[ORM\Column('l1_unified_count', type:'integer', nullable: true, options: array( + 'comment' => 'The number of L1 caches on the package, usually the same as the number of cores' + ))] + private ?int $L1uCount = null; + + #[ORM\Column('l1_unified_size', type: 'integer', nullable: true, options: array( + 'comment' => 'The size of each Level 1 unified cache in KB' + ))] + private ?int $L1uSize = null; + + #[ORM\Column('l1_unified_way', type: 'integer', nullable: true)] + private ?int $L1uWay = null; + + #[ORM\Column('l2_count', type: 'integer', options: array( + 'comment' => 'The number of L2 caches on the package, usually the same as the number of cores' + ))] + private int $L2Count = 1; + + #[ORM\Column('l2_size', type: 'integer', nullable: true, options: array( + 'comment' => 'The size of each Level 2 cache in KB' + ))] + private ?int $L2Size; + + #[ORM\Column('l2_way', type: 'integer', nullable: true)] + private ?int $L2Way; + + #[ORM\Column('l3_count', type: 'integer', options: array( + 'comment' => 'The number of L3 caches on the package' + ))] + private int $L3Count = 0; + + #[ORM\Column('l3_size', type: 'integer', nullable: true, options: array( + 'comment' => 'The size of each Level 3 cache in KB' + ))] + private ?int $L3Size; + + #[ORM\Column('l3_way', type: 'integer', nullable: true)] + private ?int $L3Way; + + // ------------------------------------------------------------------------ + public function __construct() { $this->sockets = new ArrayCollection(); diff --git a/src/Entity/CpuCacheTrait.php b/src/Entity/CpuCacheTrait.php deleted file mode 100644 index 84d774a..0000000 --- a/src/Entity/CpuCacheTrait.php +++ /dev/null @@ -1,72 +0,0 @@ - 'The number of L1 data caches on the package, usually the same as the number of cores' - ))] - private ?int $L1dCount = null; - - #[ORM\Column('l1_data_size', type: 'integer', nullable: true, options: array( - 'comment' => 'The size of each Level 1 data cache in KB' - ))] - private ?int $L1dSize = null; - - #[ORM\Column('l1_data_way', type: 'integer', nullable: true)] - private ?int $L1dWay = null; - - #[ORM\Column('l1_code_count', type:'integer', nullable: true, options: array( - 'comment' => 'The number of L1 instruction caches on the package, usually the same as the number of cores' - ))] - private ?int $L1cCount = null; - - #[ORM\Column('l1_code_size', type: 'integer', nullable: true, options: array( - 'comment' => 'The size of each Level 1 instruction cache in KB' - ))] - private ?int $L1cSize = null; - - #[ORM\Column('l1_code_way', type: 'integer', nullable: true)] - private ?int $L1cWay = null; - - #[ORM\Column('l1_unified_count', type:'integer', nullable: true, options: array( - 'comment' => 'The number of L1 caches on the package, usually the same as the number of cores' - ))] - private ?int $L1uCount = null; - - #[ORM\Column('l1_unified_size', type: 'integer', nullable: true, options: array( - 'comment' => 'The size of each Level 1 unified cache in KB' - ))] - private ?int $L1uSize = null; - - #[ORM\Column('l1_unified_way', type: 'integer', nullable: true)] - private ?int $L1uWay = null; - - #[ORM\Column('l2_count', type: 'integer', options: array( - 'comment' => 'The number of L2 caches on the package, usually the same as the number of cores' - ))] - private int $L2Count = 1; - - #[ORM\Column('l2_size', type: 'integer', nullable: true, options: array( - 'comment' => 'The size of each Level 2 cache in KB' - ))] - private ?int $L2Size; - - #[ORM\Column('l2_way', type: 'integer', nullable: true)] - private ?int $L2Way; - - #[ORM\Column('l3_count', type: 'integer', options: array( - 'comment' => 'The number of L3 caches on the package' - ))] - private int $L3Count = 0; - - #[ORM\Column('l3_size', type: 'integer', nullable: true, options: array( - 'comment' => 'The size of each Level 3 cache in KB' - ))] - private ?int $L3Size; - - #[ORM\Column('l3_way', type: 'integer', nullable: true)] - private ?int $L3Way; -} diff --git a/src/Entity/Film.php b/src/Entity/Film.php index c3bb132..67b7d19 100644 --- a/src/Entity/Film.php +++ b/src/Entity/Film.php @@ -12,6 +12,8 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Entity] class Film { + use GetSet; + #[ORM\Id] #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] #[ORM\GeneratedValue(strategy: 'IDENTITY')] @@ -55,207 +57,4 @@ class Film #[ORM\Column(name: 'notes', type: 'text', nullable: TRUE)] private ?string $notes = NULL; - - public function getId(): int - { - return $this->id; - } - - /** - * @return string - */ - public function getBrand(): ?string - { - return $this->brand; - } - - public function setBrand(string $brand): self - { - $this->brand = $brand; - - return $this; - } - - /** - * @return string - */ - public function getProductLine(): ?string - { - return $this->productLine; - } - - /** - * @param string $productLine - */ - public function setProductLine(?string $productLine): self - { - $this->productLine = $productLine; - - return $this; - } - - /** - * @return string - */ - public function getFilmName(): ?string - { - return $this->filmName; - } - - public function setFilmName(string $filmName): self - { - $this->filmName = $filmName; - - return $this; - } - - /** - * @return string - */ - public function getFilmAlias(): ?string - { - return $this->filmAlias; - } - - public function setFilmAlias(string $filmAlias): self - { - $this->filmAlias = $filmAlias; - - return $this; - } - - /** - * @return int - */ - public function getFilmSpeedAsa(): ?int - { - return $this->filmSpeedAsa; - } - - public function setFilmSpeedAsa(int $filmSpeedAsa): self - { - $this->filmSpeedAsa = $filmSpeedAsa; - - return $this; - } - - /** - * @return int - */ - public function getFilmSpeedDin(): ?int - { - return $this->filmSpeedDin; - } - - public function setFilmSpeedDin(int $filmSpeedDin): self - { - $this->filmSpeedDin = $filmSpeedDin; - - return $this; - } - - /** - * @return string - */ - public function getFilmFormat(): ?string - { - return $this->filmFormat; - } - - public function setFilmFormat(string $filmFormat): self - { - $this->filmFormat = $filmFormat; - - return $this; - } - - /** - * @return string - */ - public function getFilmBase(): ?string - { - return $this->filmBase; - } - - public function setFilmBase(string $filmBase): self - { - $this->filmBase = $filmBase; - - return $this; - } - - /** - * @return int - */ - public function getUnusedRolls(): ?int - { - return $this->unusedRolls; - } - - public function setUnusedRolls(int $unusedRolls): self - { - $this->unusedRolls = $unusedRolls; - - return $this; - } - - /** - * @return int - */ - public function getRollsInCamera(): ?int - { - return $this->rollsInCamera; - } - - public function setRollsInCamera(int $rollsInCamera): self - { - $this->rollsInCamera = $rollsInCamera; - - return $this; - } - - /** - * @return int - */ - public function getDevelopedRolls(): ?int - { - return $this->developedRolls; - } - - public function setDevelopedRolls(int $developedRolls): self - { - $this->developedRolls = $developedRolls; - - return $this; - } - - /** - * @return string - */ - public function getChemistry(): ?string - { - return $this->chemistry; - } - - public function setChemistry(string $chemistry): self - { - $this->chemistry = $chemistry; - - return $this; - } - - /** - * @return string - */ - public function getNotes(): ?string - { - return $this->notes; - } - - public function setNotes(string $notes): self - { - $this->notes = $notes; - - return $this; - } } diff --git a/src/Entity/FilmFormat.php b/src/Entity/FilmFormat.php index fe9fcdc..e9ddf2b 100644 --- a/src/Entity/FilmFormat.php +++ b/src/Entity/FilmFormat.php @@ -8,6 +8,8 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Entity] class FilmFormat { + use GetSet; + #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] @@ -18,42 +20,4 @@ class FilmFormat #[ORM\Column(name: 'name', type: 'string')] private string $name; - - /** - * @return int - */ - public function getId(): ?int - { - return $this->id; - } - - /** - * @return int - */ - public function getNumberId(): ?int - { - return $this->numberId; - } - - public function setNumberId(int $numberId): self - { - $this->numberId = $numberId; - - return $this; - } - - /** - * @return string - */ - public function getName(): ?string - { - return $this->name; - } - - public function setName(string $name): self - { - $this->name = $name; - - return $this; - } } diff --git a/src/Entity/Flash.php b/src/Entity/Flash.php index 43d038c..72f3498 100644 --- a/src/Entity/Flash.php +++ b/src/Entity/Flash.php @@ -11,6 +11,7 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Entity] class Flash { + use GetSet; use FlashTrait; #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] @@ -24,33 +25,4 @@ class Flash #[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: FALSE, options: ['default' => FALSE])] private bool $formerlyOwned = FALSE; - - public function getId(): ?int - { - return $this->id; - } - - public function isReceived(): ?bool - { - return $this->received; - } - - public function setReceived(bool $received): self - { - $this->received = $received; - - return $this; - } - - public function isFormerlyOwned(): ?bool - { - return $this->formerlyOwned; - } - - public function setFormerlyOwned(bool $formerlyOwned): self - { - $this->formerlyOwned = $formerlyOwned; - - return $this; - } } diff --git a/src/Entity/FlashTrait.php b/src/Entity/FlashTrait.php index 2dd5d94..e272d59 100644 --- a/src/Entity/FlashTrait.php +++ b/src/Entity/FlashTrait.php @@ -6,7 +6,7 @@ use Doctrine\ORM\Mapping as ORM; trait FlashTrait { - use PurchasePriceTrait; + use PurchasePrice; #[ORM\Column(name: 'brand', type: 'string', nullable: FALSE)] private readonly string $brand; @@ -40,315 +40,4 @@ trait FlashTrait #[ORM\Column(name: 'serial', type: 'string', nullable: TRUE)] private readonly ?string $serial; - - public function getId(): int - { - return $this->id; - } - - /** - * Set brand - */ - public function setBrand(string $brand): self - { - $this->brand = $brand; - - return $this; - } - - /** - * Get brand - * - * @return string - */ - public function getBrand() - { - return $this->brand; - } - - /** - * Set model - * - * @param string $model - * - * @return Flash - */ - public function setModel($model) - { - $this->model = $model; - - return $this; - } - - /** - * Get model - * - * @return string - */ - public function getModel() - { - return $this->model; - } - - /** - * Set isAutoFlash - * - * @param bool $isAutoFlash - * - * @return Flash - */ - public function setIsAutoFlash($isAutoFlash) - { - $this->isAutoFlash = $isAutoFlash; - - return $this; - } - - /** - * Get isAutoFlash - * - * @return bool - */ - public function getIsAutoFlash() - { - return $this->isAutoFlash; - } - - /** - * Set isTtl - * - * @param bool $isTtl - * - * @return Flash - */ - public function setIsTtl($isTtl) - { - $this->isTtl = $isTtl; - - return $this; - } - - /** - * Get isTtl - * - * @return bool - */ - public function getIsTtl() - { - return $this->isTtl; - } - - /** - * Set ttlType - * - * @param string $ttlType - * - * @return Flash - */ - public function setTtlType($ttlType) - { - $this->ttlType = $ttlType; - - return $this; - } - - /** - * Get ttlType - * - * @return string - */ - public function getTtlType() - { - return $this->ttlType; - } - - /** - * Set isPTtl - * - * @param bool $isPTtl - * - * @return Flash - */ - public function setIsPTtl($isPTtl) - { - $this->isPTtl = $isPTtl; - - return $this; - } - - /** - * Get isPTtl - * - * @return bool - */ - public function getIsPTtl() - { - return $this->isPTtl; - } - - /** - * Set pTtlType - * - * @param string $pTtlType - */ - public function setPTtlType($pTtlType): self - { - $this->pTtlType = $pTtlType; - - return $this; - } - - /** - * Get pTtlType - * - * @return string - */ - public function getPTtlType() - { - return $this->pTtlType; - } - - /** - * Set guideNumber - * - * @param string $guideNumber - * - * @return self - */ - public function setGuideNumber($guideNumber) - { - $this->guideNumber = $guideNumber; - - return $this; - } - - /** - * Get guideNumber - * - * @return string - */ - public function getGuideNumber() - { - return $this->guideNumber; - } - - /** - * Set batteries - * - * @param string $batteries - * - * @return Flash - */ - public function setBatteries($batteries): self - { - $this->batteries = $batteries; - - return $this; - } - - /** - * Get batteries - * - * @return string - */ - public function getBatteries() - { - return $this->batteries; - } - - /** - * Set notes - * - * @param string $notes - * - * @return Flash - */ - public function setNotes($notes): self - { - $this->notes = $notes; - - return $this; - } - - /** - * Get notes - * - * @return string - */ - public function getNotes() - { - return $this->notes; - } - - /** - * Set serial - * - * @param string $serial - * - * @return Flash - */ - public function setSerial($serial): self - { - $this->serial = $serial; - - return $this; - } - - /** - * Get serial - * - * @return string - */ - public function getSerial() - { - return $this->serial; - } - - /** - * Set formerlyOwned - * - * @param bool $formerlyOwned - * - * @return Flash - */ - public function setFormerlyOwned($formerlyOwned): self - { - $this->formerlyOwned = $formerlyOwned; - - return $this; - } - - /** - * Get formerlyOwned - * - * @return bool - */ - public function getFormerlyOwned() - { - return $this->formerlyOwned; - } - - /** - * Set received - * - * @param bool $received - * - * @return Flash - */ - public function setReceived($received): self - { - $this->received = $received; - - return $this; - } - - /** - * Get received - * - * @return bool - */ - public function getReceived() - { - return $this->received; - } } diff --git a/src/Entity/Fpu.php b/src/Entity/Fpu.php index 60b9288..787bcd7 100644 --- a/src/Entity/Fpu.php +++ b/src/Entity/Fpu.php @@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Table(name: 'fpu', schema: 'collection')] #[ORM\Entity] class Fpu { - use GetSetTrait; + use GetSet; #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] #[ORM\Id] diff --git a/src/Entity/GetSetTrait.php b/src/Entity/GetSet.php similarity index 98% rename from src/Entity/GetSetTrait.php rename to src/Entity/GetSet.php index 93c021a..8af7f00 100644 --- a/src/Entity/GetSetTrait.php +++ b/src/Entity/GetSet.php @@ -7,7 +7,7 @@ use InvalidArgumentException; /** * Remove the need for all the Doctrine getter/setter Entity boilerplate */ -trait GetSetTrait { +trait GetSet { public function __get(string $name): mixed { if (property_exists($this, $name)) diff --git a/src/Entity/Gpu.php b/src/Entity/Gpu.php index e97ded7..831563d 100644 --- a/src/Entity/Gpu.php +++ b/src/Entity/Gpu.php @@ -2,16 +2,14 @@ namespace App\Entity; -use App\Enum\CardBusEnum; -use App\Enum\SlotKeyEnum; -use App\Types\CardBusEnumType; -use App\Types\SlotKeyEnumType; +use App\Enum\CardBus; +use App\Enum\SlotKey; use Doctrine\ORM\Mapping as ORM; #[ORM\Table(name: 'gpu', schema: 'collection')] #[ORM\Entity] class Gpu { - use GetSetTrait; + use GetSet; #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] #[ORM\Id] @@ -42,22 +40,22 @@ class Gpu { #[ORM\Column( name: 'card_key', type: 'string', - enumType: SlotKeyEnum::class, + enumType: SlotKey::class, options: array( 'comment' => "The shape of the card connector", 'default' => "PCIe x16" ) )] - private SlotKeyEnum $cardKey = SlotKeyEnum::PCIE_X16; + private SlotKey $cardKey = SlotKey::PCIE_X16; #[ORM\Column( name: 'bus_interface', type: 'string', nullable: TRUE, - enumType: CardBusEnum::class, + enumType: CardBus::class, options: array('comment' => "The type of electrical bus this card uses") )] - private ?CardBusEnum $busInterface; + private ?CardBus $busInterface; #[ORM\Column( name: 'slot_span', diff --git a/src/Entity/GpuCore.php b/src/Entity/GpuCore.php index 48e7f14..b52dff3 100644 --- a/src/Entity/GpuCore.php +++ b/src/Entity/GpuCore.php @@ -8,7 +8,7 @@ use Stringable; #[ORM\Table(name: 'gpu_core', schema: 'collection')] #[ORM\Entity] class GpuCore implements Stringable { - use GetSetTrait; + use GetSet; #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] #[ORM\Id] diff --git a/src/Entity/LensTrait.php b/src/Entity/LensTrait.php index 176ab65..6d2d912 100644 --- a/src/Entity/LensTrait.php +++ b/src/Entity/LensTrait.php @@ -6,8 +6,7 @@ use Doctrine\ORM\Mapping as ORM; trait LensTrait { - use PurchasePriceTrait; - use GetSetTrait; + use PurchasePrice; #[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: TRUE)] private readonly ?string $brand; @@ -62,13 +61,4 @@ trait LensTrait #[ORM\Column(name: 'aperture_blades', type: 'smallint', nullable: TRUE)] private readonly ?int $apertureBlades; - - public function __get(string $name): mixed - { - if (property_exists($this, $name)) { - return $this->{$name}; - } - - return NULL; - } } diff --git a/src/Entity/Lenses.php b/src/Entity/Lenses.php index f6a9486..ff1fc3e 100644 --- a/src/Entity/Lenses.php +++ b/src/Entity/Lenses.php @@ -12,6 +12,7 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: LensesRepository::class)] class Lenses { + use GetSet; use LensTrait; #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] @@ -25,33 +26,4 @@ class Lenses #[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: FALSE)] private bool $formerlyOwned = FALSE; - - public function getId(): ?int - { - return $this->id; - } - - public function isReceived(): ?bool - { - return $this->received; - } - - public function setReceived(bool $received): self - { - $this->received = $received; - - return $this; - } - - public function isFormerlyOwned(): ?bool - { - return $this->formerlyOwned; - } - - public function setFormerlyOwned(bool $formerlyOwned): self - { - $this->formerlyOwned = $formerlyOwned; - - return $this; - } } diff --git a/src/Entity/Motherboard.php b/src/Entity/Motherboard.php new file mode 100644 index 0000000..cf28c82 --- /dev/null +++ b/src/Entity/Motherboard.php @@ -0,0 +1,70 @@ + 'asc'])] + #[ORM\JoinColumn('brand_id', referencedColumnName: 'id', nullable: FALSE)] + private Brand $brand; + + #[ORM\Column('model', type: 'string')] + private string $model; + + /** + * @var Collection + */ + #[ORM\ManyToMany(targetEntity: Socket::class, inversedBy: 'cpus', fetch: 'LAZY')] + #[ORM\JoinTable('collection.motherboard_socket_link')] + #[ORM\JoinColumn('motherboard_id', referencedColumnName: 'id')] + #[ORM\InverseJoinColumn('socket_id', referencedColumnName: 'id')] + #[ORM\OrderBy(['name' => 'asc'])] + private Collection $sockets; + + #[ORM\ManyToOne(targetEntity: Chipset::class, fetch: 'EAGER')] + #[ORM\OrderBy(['name' => 'asc'])] + #[ORM\JoinColumn('chipset_id', 'id', FALSE)] + private Chipset $chipset; + + #[ORM\Column('link', type: 'string')] + private string $link; + + #[ORM\Column('notes', type: 'text', nullable: true)] + private ?string $notes = ''; + + // ------------------------------------------------------------------------ + + public function __construct() + { + $this->sockets = new ArrayCollection(); + } + + public function addSocket(Socket $socket): self + { + if ( ! $this->sockets->contains($socket)) + { + $this->sockets->add($socket); + } + + return $this; + } + + public function removeSocket(Socket $socket): self + { + $this->sockets->removeElement($socket); + + return $this; + } +} diff --git a/src/Entity/PreviouslyOwnedCamera.php b/src/Entity/PreviouslyOwnedCamera.php index 80faf8b..3f742df 100644 --- a/src/Entity/PreviouslyOwnedCamera.php +++ b/src/Entity/PreviouslyOwnedCamera.php @@ -12,6 +12,7 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: CameraRepository::class)] class PreviouslyOwnedCamera { + use GetSet; use CameraTrait; #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] @@ -19,9 +20,4 @@ class PreviouslyOwnedCamera #[ORM\GeneratedValue(strategy: 'IDENTITY')] #[ORM\SequenceGenerator(sequenceName: 'prevously_owned_camera_id_seq', allocationSize: 1, initialValue: 1)] private int $id; - - public function getId(): ?int - { - return $this->id; - } } diff --git a/src/Entity/PreviouslyOwnedFlash.php b/src/Entity/PreviouslyOwnedFlash.php index 33742cc..e2f707f 100644 --- a/src/Entity/PreviouslyOwnedFlash.php +++ b/src/Entity/PreviouslyOwnedFlash.php @@ -11,6 +11,7 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Entity] class PreviouslyOwnedFlash { + use GetSet; use FlashTrait; #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] @@ -23,33 +24,4 @@ class PreviouslyOwnedFlash #[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: FALSE, options: ['default' => TRUE])] private bool $formerlyOwned = TRUE; - - public function getId(): ?int - { - return $this->id; - } - - public function isReceived(): ?bool - { - return $this->received; - } - - public function setReceived(bool $received): self - { - $this->received = $received; - - return $this; - } - - public function isFormerlyOwned(): ?bool - { - return $this->formerlyOwned; - } - - public function setFormerlyOwned(bool $formerlyOwned): self - { - $this->formerlyOwned = $formerlyOwned; - - return $this; - } } diff --git a/src/Entity/PreviouslyOwnedLenses.php b/src/Entity/PreviouslyOwnedLenses.php index 1a44348..2d85483 100644 --- a/src/Entity/PreviouslyOwnedLenses.php +++ b/src/Entity/PreviouslyOwnedLenses.php @@ -12,6 +12,7 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: LensesRepository::class)] class PreviouslyOwnedLenses { + use GetSet; use LensTrait; #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] @@ -24,33 +25,4 @@ class PreviouslyOwnedLenses #[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: FALSE)] private bool $formerlyOwned = TRUE; - - public function getId(): ?int - { - return $this->id; - } - - public function isReceived(): ?bool - { - return $this->received; - } - - public function setReceived(bool $received): self - { - $this->received = $received; - - return $this; - } - - public function isFormerlyOwned(): ?bool - { - return $this->formerlyOwned; - } - - public function setFormerlyOwned(bool $formerlyOwned): self - { - $this->formerlyOwned = $formerlyOwned; - - return $this; - } } diff --git a/src/Entity/PurchasePriceTrait.php b/src/Entity/PurchasePrice.php similarity index 95% rename from src/Entity/PurchasePriceTrait.php rename to src/Entity/PurchasePrice.php index 0ae237a..b70468c 100644 --- a/src/Entity/PurchasePriceTrait.php +++ b/src/Entity/PurchasePrice.php @@ -4,7 +4,7 @@ namespace App\Entity; use Doctrine\ORM\Mapping as ORM; -trait PurchasePriceTrait +trait PurchasePrice { #[ORM\Column(name: 'purchase_price', type: 'money', nullable: TRUE)] private ?string $purchasePrice = NULL; diff --git a/src/Entity/Socket.php b/src/Entity/Socket.php index be08b6c..e3f600b 100644 --- a/src/Entity/Socket.php +++ b/src/Entity/Socket.php @@ -3,6 +3,7 @@ namespace App\Entity; use App\Enum\SocketTypeEnum; +use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; /** @@ -11,7 +12,7 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Table(name: 'socket', schema: 'collection')] #[ORM\Entity] class Socket { - use GetSetTrait; + use GetSet; #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] #[ORM\Id] @@ -27,6 +28,12 @@ class Socket { #[ORM\Column(name: 'pin_count', type: 'integer', nullable: FALSE)] private int $pinCount; + #[ORM\ManyToMany(targetEntity: Cpu::class, mappedBy: 'sockets', fetch: 'EXTRA_LAZY')] + private Collection $cpus; + + #[ORM\ManyToMany(targetEntity: Motherboard::class, mappedBy: 'sockets', fetch: 'EXTRA_LAZY')] + private Collection $motherboards; + #[ORM\Column( name: 'socket_type', type: 'string', @@ -34,6 +41,8 @@ class Socket { )] private SocketTypeEnum $type = SocketTypeEnum::PIN_GRID_ARRAY; + // ------------------------------------------------------------------------ + public function __toString(): string { $name = ( ! empty($this->otherName)) ? "$this->name/$this->otherName" : $this->name; diff --git a/src/Enum/CardBusEnum.php b/src/Enum/CardBus.php similarity index 85% rename from src/Enum/CardBusEnum.php rename to src/Enum/CardBus.php index 022385f..e1e267d 100644 --- a/src/Enum/CardBusEnum.php +++ b/src/Enum/CardBus.php @@ -2,7 +2,7 @@ namespace App\Enum; -enum CardBusEnum: string { +enum CardBus: string { case PCIE_10_16 = 'PCIe 1.0 x16'; case PCIE_11_16 = 'PCIe 1.1 x16'; case PCIE_20_16 = 'PCIe 2.0 x16'; @@ -27,7 +27,7 @@ enum CardBusEnum: string { public static function getGroups(): array { $filter = static fn (string $starts_with) => - array_filter(self::cases(), fn (CardBusEnum $case) => + array_filter(self::cases(), fn (CardBus $case) => str_starts_with($case->name, $starts_with) ); @@ -36,7 +36,7 @@ enum CardBusEnum: string { $pci = $filter('PCI_'); $isa = $filter('ISA_'); - $pcie16 = array_filter($pcie, fn (CardBusEnum $case) => str_ends_with($case->name, '_16')); + $pcie16 = array_filter($pcie, fn (CardBus $case) => str_ends_with($case->name, '_16')); $pcieOther = array_udiff($pcie, $pcie16, fn ($a, $b) => $a->name <=> $b->name); return [ diff --git a/src/Enum/CpuArchitectureEnum.php b/src/Enum/CpuArchitecture.php similarity index 95% rename from src/Enum/CpuArchitectureEnum.php rename to src/Enum/CpuArchitecture.php index 6a1f7b7..6539c26 100644 --- a/src/Enum/CpuArchitectureEnum.php +++ b/src/Enum/CpuArchitecture.php @@ -2,7 +2,7 @@ namespace App\Enum; -enum CpuArchitectureEnum: string { +enum CpuArchitecture: string { case ARM = 'arm'; case ARM64 = 'arm64'; case EIGHT_OH_ONE_EIGHT_SIX = 'Intel 80186'; diff --git a/src/Enum/SlotKeyEnum.php b/src/Enum/SlotKey.php similarity index 94% rename from src/Enum/SlotKeyEnum.php rename to src/Enum/SlotKey.php index e04749e..fe815f0 100644 --- a/src/Enum/SlotKeyEnum.php +++ b/src/Enum/SlotKey.php @@ -2,7 +2,7 @@ namespace App\Enum; -enum SlotKeyEnum: string { +enum SlotKey: string { case PCIE_X16 = 'PCIe x16'; case PCIE_X8 = 'PCIe x8'; case PCIE_X4 = 'PCIe x4'; @@ -42,7 +42,7 @@ enum SlotKeyEnum: string { public static function getGroups(): array { $filter = static fn (string $starts_with) => - array_filter(self::cases(), fn (SlotKeyEnum $case) => + array_filter(self::cases(), fn (SlotKey $case) => str_starts_with($case->name, $starts_with) ); diff --git a/src/Form/ChipsetType.php b/src/Form/ChipsetType.php new file mode 100644 index 0000000..6734082 --- /dev/null +++ b/src/Form/ChipsetType.php @@ -0,0 +1,35 @@ +add('brand', EntityType::class, [ + 'class' => Brand::class, + 'query_builder' => self::filterBrands('chipset'), + ]) + ->add('name') + ->add('parts') + ->add('link') + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Chipset::class, + ]); + } +} diff --git a/src/Form/CpuType.php b/src/Form/CpuType.php index 582b80c..7764182 100644 --- a/src/Form/CpuType.php +++ b/src/Form/CpuType.php @@ -4,7 +4,7 @@ namespace App\Form; use App\Entity\Brand; use App\Entity\Cpu; -use App\Enum\CpuArchitectureEnum; +use App\Enum\CpuArchitecture; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\EnumType; @@ -20,9 +20,9 @@ class CpuType extends AbstractType { { $builder ->add('architecture', EnumType::class, [ - 'class' => CpuArchitectureEnum::class, + 'class' => CpuArchitecture::class, 'choice_label' => fn(UnitEnum $choice): string => $choice->value, - 'choices' => CpuArchitectureEnum::getGroups(), + 'choices' => CpuArchitecture::getGroups(), ]) ->add('brand', EntityType::class, [ 'class' => Brand::class, diff --git a/src/Form/GpuType.php b/src/Form/GpuType.php index 258890e..8c15a63 100644 --- a/src/Form/GpuType.php +++ b/src/Form/GpuType.php @@ -2,7 +2,7 @@ namespace App\Form; -use App\Enum\{CardBusEnum, SlotKeyEnum}; +use App\Enum\{CardBus, SlotKey}; use App\Entity\{Brand, Gpu, GpuCore}; use Doctrine\ORM\EntityRepository; use Symfony\Bridge\Doctrine\Form\Type\EntityType; @@ -38,13 +38,13 @@ class GpuType extends AbstractType { ]) ->add('alternateModelName') ->add('cardKey', EnumType::class, [ - 'class' => SlotKeyEnum::class, - 'choices' => SlotKeyEnum::getGroups(), + 'class' => SlotKey::class, + 'choices' => SlotKey::getGroups(), 'choice_label' => fn(UnitEnum $choice): string => $choice->value, ]) ->add('busInterface', EnumType::class, [ - 'class' => CardBusEnum::class, - 'choices' => CardBusEnum::getGroups(), + 'class' => CardBus::class, + 'choices' => CardBus::getGroups(), 'choice_label' => fn(UnitEnum $choice): string => $choice->value, ]) ->add('slotSpan') diff --git a/src/Migrations/Version20221117193508.php b/src/Migrations/Version20221117193508.php new file mode 100644 index 0000000..6b48013 --- /dev/null +++ b/src/Migrations/Version20221117193508.php @@ -0,0 +1,55 @@ +addSql('DROP SEQUENCE collection.battery_type_id_seq CASCADE'); + $this->addSql('CREATE TABLE collection.chipset (id SERIAL NOT NULL, brand_id INT NOT NULL, name VARCHAR(255) NOT NULL, parts VARCHAR(255) NOT NULL, link VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_110BAE8044F5D008 ON collection.chipset (brand_id)'); + $this->addSql('CREATE TABLE collection.motherboard (id SERIAL NOT NULL, brand_id INT NOT NULL, chipset_id INT DEFAULT NULL, model VARCHAR(255) NOT NULL, link VARCHAR(255) NOT NULL, notes TEXT DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_5C3F5E3144F5D008 ON collection.motherboard (brand_id)'); + $this->addSql('CREATE INDEX IDX_5C3F5E31BC1433B9 ON collection.motherboard (chipset_id)'); + $this->addSql('CREATE TABLE collection.motherboard_socket_link (motherboard_id INT NOT NULL, socket_id INT NOT NULL, PRIMARY KEY(motherboard_id, socket_id))'); + $this->addSql('CREATE INDEX IDX_D635BC6D6511E8A3 ON collection.motherboard_socket_link (motherboard_id)'); + $this->addSql('CREATE INDEX IDX_D635BC6DD20E239C ON collection.motherboard_socket_link (socket_id)'); + $this->addSql('ALTER TABLE collection.chipset ADD CONSTRAINT FK_110BAE8044F5D008 FOREIGN KEY (brand_id) REFERENCES collection.brand (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE collection.motherboard ADD CONSTRAINT FK_5C3F5E3144F5D008 FOREIGN KEY (brand_id) REFERENCES collection.brand (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE collection.motherboard ADD CONSTRAINT FK_5C3F5E31BC1433B9 FOREIGN KEY (chipset_id) REFERENCES collection.chipset (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE collection.motherboard_socket_link ADD CONSTRAINT FK_D635BC6D6511E8A3 FOREIGN KEY (motherboard_id) REFERENCES collection.motherboard (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE collection.motherboard_socket_link ADD CONSTRAINT FK_D635BC6DD20E239C FOREIGN KEY (socket_id) REFERENCES collection.socket (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('DROP TABLE collection.battery_type'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('CREATE SEQUENCE collection.battery_type_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE collection.battery_type (id SERIAL NOT NULL, PRIMARY KEY(id))'); + $this->addSql('ALTER TABLE collection.chipset DROP CONSTRAINT FK_110BAE8044F5D008'); + $this->addSql('ALTER TABLE collection.motherboard DROP CONSTRAINT FK_5C3F5E3144F5D008'); + $this->addSql('ALTER TABLE collection.motherboard DROP CONSTRAINT FK_5C3F5E31BC1433B9'); + $this->addSql('ALTER TABLE collection.motherboard_socket_link DROP CONSTRAINT FK_D635BC6D6511E8A3'); + $this->addSql('ALTER TABLE collection.motherboard_socket_link DROP CONSTRAINT FK_D635BC6DD20E239C'); + $this->addSql('DROP TABLE collection.chipset'); + $this->addSql('DROP TABLE collection.motherboard'); + $this->addSql('DROP TABLE collection.motherboard_socket_link'); + } +} diff --git a/templates/chipset/edit.html.twig b/templates/chipset/edit.html.twig new file mode 100644 index 0000000..ded37c4 --- /dev/null +++ b/templates/chipset/edit.html.twig @@ -0,0 +1,30 @@ +{% extends 'form.html.twig' %} + +{% block title %}Chipset - Edit{% endblock %} + +{% block form %} +

Edit Chipset

+ +
+ +
+ +
+ {{ form_start(form) }} + {{ form_widget(form) }} + + {{ form_end(form) }} + +
+ + +
+
+{% endblock %} diff --git a/templates/chipset/index.html.twig b/templates/chipset/index.html.twig new file mode 100644 index 0000000..43266b3 --- /dev/null +++ b/templates/chipset/index.html.twig @@ -0,0 +1,55 @@ +{% extends 'base.html.twig' %} + +{% block title %}Chipset{% endblock %} + +{% block body %} +

Chipset

+ +
+ +
+ + + + + + + + + + + + + {% for chipset in chipsets %} + + + + + + + + {% else %} + + + + {% endfor %} + +
 IdNamePartsLink
+ + {{ chipset.id }}{{ chipset.name }}{{ chipset.parts }}{{ chipset.link }}
no records found
+{% endblock %} diff --git a/templates/chipset/new.html.twig b/templates/chipset/new.html.twig new file mode 100644 index 0000000..c3a68b3 --- /dev/null +++ b/templates/chipset/new.html.twig @@ -0,0 +1,23 @@ +{% extends 'form.html.twig' %} + +{% block title %}Chipset - New{% endblock %} + +{% block form %} +

Add Chipset

+ +
+ +
+ +
+ {{ form_start(form) }} + {{ form_widget(form) }} + + {{ form_end(form) }} +
+ +{% endblock %} diff --git a/templates/chipset/show.html.twig b/templates/chipset/show.html.twig new file mode 100644 index 0000000..e8085c8 --- /dev/null +++ b/templates/chipset/show.html.twig @@ -0,0 +1,50 @@ +{% extends 'form.html.twig' %} + +{% block title %}Chipset{% endblock %} + +{% block form %} +

Chipset

+ +
+ + + +
+ + +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + +
Id{{ chipset.id }}
Name{{ chipset.name }}
Parts{{ chipset.parts }}
Link{{ chipset.link }}
+
+{% endblock %} diff --git a/templates/header.html.twig b/templates/header.html.twig index 1f29971..bc8d4cc 100644 --- a/templates/header.html.twig +++ b/templates/header.html.twig @@ -8,15 +8,15 @@ diff --git a/translations/messages.en.php b/translations/messages.en.php index 7ac1314..76b46c5 100644 --- a/translations/messages.en.php +++ b/translations/messages.en.php @@ -3,66 +3,203 @@ return [ '' => '', '4x4' => '4x4cm', - '6x4.5' => '6x4.5cm', + '5V 32-bit PCI' => '5V 32-bit PCI', + '5V 64-bit PCI' => '5V 64-bit PCI', '6x6' => '6x6cm', + '6x4.5' => '6x4.5cm', + '8-bit ISA' => '8-bit ISA', + '16-bit ISA' => '16-bit ISA', '35mm' => '35mm', + '1.5V AGP' => '1.5V AGP', '110' => '110', '120' => '120', '127' => '127', + '3.3V 32-bit PCI' => '3.3V 32-bit PCI', + '3.3V 64-bit PCI' => '3.3V 64-bit PCI', + '3.3V AGP' => '3.3V AGP', + '3.3V PCI 33' => '3.3V PCI 33', '620' => '620', + 'Acquired' => 'Acquired', + 'AGP 1x' => 'AGP 1x', + 'AGP 2x' => 'AGP 2x', + 'AGP 4x' => 'AGP 4x', + 'AGP 8x' => 'AGP 8x', + 'AGP' => 'AGP', + 'Alternate model name' => 'Alternate Model Name', 'Aperture blades' => '# of Aperture Blades', 'APS-C' => 'APS-C', + 'Architecture link' => 'Architecture Link', + 'Architecture' => 'Architecture', + 'arm' => 'arm', + 'arm64' => 'arm64', 'B & W' => 'B & W', + 'Base speed' => 'Base Speed', 'Batteries' => 'Batteries', 'Battery type' => 'Battery Type', + 'Board brand' => 'GPU Board Brand', + 'Boost speed' => 'Boost Speed', 'Brand' => 'Brand', + 'Bus interface' => 'Bus Interface', 'C-41' => 'C-41', + 'Card key' => 'Card Interface Keying', + 'Categories' => 'Categories', 'Cellulose Triacetate' => 'Cellulose Triacetate', 'Chemistry' => 'Film Chemistry', + 'Clock speed' => 'Clock Speed (MHz)', 'Coatings' => 'Coatings', + 'Code name' => 'Codename', + 'Common' => 'Common', + 'Compute units' => 'Compute Units/Cores', + 'Cores' => 'Cores', + 'Count' => 'Count', 'Crop factor' => 'Crop Factor', 'Description' => 'Description', 'Design elements' => '# of Design Elements', 'Design groups' => '# of Design Groups', 'Developed rolls' => '# of Developed Rolls', + 'DirectX Support' => 'DirectX Support', + 'DUAL_INLINE_PACKAGE' => 'DIP', 'E-6' => 'E-6', 'Film alias' => 'Film Alias', 'Film base' => 'Film Base', 'Film format' => 'Film Format', 'Film name' => 'Film Name', 'Film speed asa' => 'Film Speed (ASA)', - 'Film speed din' => 'Film Speed (DIN)', - 'Formerly owned' => 'Formerly Owned', - 'Front filter size' => 'Front filter size (mm)', - 'Guide number' => 'Guide Number', - 'Image size' => 'Image Size', - 'Is auto flash' => 'Is auto flash', - 'Is digital' => 'Is Digital', - 'Is p ttl' => 'Is P-TTL', - 'Is teleconverter' => 'Is teleconverter', - 'Is ttl' => 'Is TTL', - 'Is working' => 'Is Working', - 'Max f stop' => 'Max aperture (smallest f number)', - 'Max focal length' => 'Max focal length (mm)', - 'Medium Format' => 'Medium Format', - 'Micro 4/3' => 'μ 4/3', - 'Min f stop' => 'Min aperture (largest f number)', - 'Min focal length' => 'Min focal length (mm)', - 'Model' => 'Model', - 'Mount' => 'Mount', - 'Notes' => 'Notes', - 'Other' => 'Other', - 'P ttl type' => 'P-TTL Type', - 'Polyester' => 'Polyester', - 'Polyethylene Naphtalate' => 'Polyethylene Naphtalate', - 'Product line' => 'Product Line', - 'Purchase price' => 'Purchase Price', - 'Rear filter size' => 'Rear filter size (mm)', - 'Received' => 'Received', - 'Rolls in camera' => '# of Rolls in a Camera', - 'Serial' => 'Serial', - 'Small Format' => 'Small Format', - 'Ttl type' => 'TTL Type', - 'Type' => 'Type', - 'Unused rolls' => '# of Unused Rolls', + 'Film speed din' => 'Film Speed (DIN)', + 'Formerly owned' => 'Formerly Owned', + 'Front filter size' => 'Front filter size (mm)', + 'Generation link' => 'Generation Link', + 'Generation name' => 'Generation Name', + 'GPU Base Clock (MHz)' => 'GPU Base Clock (MHz)', + 'GPU Boost Clock (MHz)' => 'GPU Boost Clock (MHz)', + 'Gpu brand' => 'GPU Brand', + 'Gpu core' => 'GPU Core', + 'Guide number' => 'Guide Number', + 'Historical' => 'Historical', + 'IBM POWER' => 'IBM POWER', + 'Igp' => 'IGP', + 'Image size' => 'Image Size', + 'Intel 8088' => 'Intel 8088', + 'Intel 80186' => 'Intel 80186', + 'Is auto flash' => 'Is auto flash', + 'Is digital' => 'Is Digital', + 'Is p ttl' => 'Is P-TTL', + 'Is teleconverter' => 'Is teleconverter', + 'Is ttl' => 'Is TTL', + 'Is working' => 'Is Working', + 'ISA' => 'ISA', + 'L1 Cache' => 'Level 1 Cache', + 'L1 Data (x-way)' => 'L1 Data (x-way)', + 'L1 Data Cache(s)' => 'L1 Data Cache(s)', + 'L1 Data Size KB' => 'L1 Data Size (KB)', + 'L1 Instruction (x-way)' => 'L1 Instruction (x-way)', + 'L1 Instruction Cache(s)' => 'L1 Instruction Cache(s)', + 'L1 Instruction Size KB' => 'L1 Instruction Size (KB)', + 'L1 Unified (x-way)' => 'L1 Unified (x-way)', + 'L1 Unified Cache Size: KB' => 'L1 Unified Cache Size (KB)', + 'L1 Unified Cache(s)' => 'L1 Unified Cache(s)', + 'L2 Cache (x-way)' => 'L2 Cache (x-way)', + 'L2 Cache Size KB (per unit)' => 'L2 Cache Size (KB per unit)', + 'L2 Cache' => 'Level 2 Cache', + 'L2 Cache(s)' => 'L2 Cache(s)', + 'L3 Cache (x-way)' => 'L3 Cache (x-way)', + 'L3 Cache Size KB (per unit)' => 'L3 Cache Size (KB per unit)', + 'L3 Cache(s)' => 'L3 Cache(s)', + 'LAND_GRID_ARRAY' => 'LGA', + 'LEAD_LESS_CHIP_CARRIER' => 'Leadless Chip Carrier', + 'Link' => 'Link', + 'Lot number' => 'Lot Number', + 'Max f stop' => 'Max aperture (smallest f number)', + 'Max focal length' => 'Max focal length (mm)', + 'Medium Format' => 'Medium Format', + 'Memory Bus Size (bits)' => 'Memory Bus Size (bits)', + 'Memory Size (MB)' => 'Memory Size (MB)', + 'Memory Speed (MHz)' => 'Memory Speed (MHz)', + 'Memory type' => 'Memory Type', + 'Micro 4/3' => 'μ 4/3', + 'Micro architecture' => 'μArchitecture', + 'Min f stop' => 'Min aperture (largest f number)', + 'Min focal length' => 'Min focal length (mm)', + 'MIPS' => 'MIPS', + 'Model name' => 'Model Name', + 'Model' => 'Model', + 'Molex Power Connectors' => 'Molex Power Connectors', + 'MOS 6502' => 'MOS 6502', + 'Motorola 68k' => 'Motorola 68k', + 'Mount' => 'Mount', + 'Name' => 'Name', + 'Notes' => 'Notes', + 'OpenCL Support' => 'OpenCL Support', + 'OpenGL Support' => 'OpenGL Support', + 'Other name' => 'Other Name', + 'Other' => 'Other', + 'Others' => 'Others', + 'P ttl type' => 'P-TTL Type', + 'Part number' => 'Part Number', + 'PCI 32-bit' => 'PCI 32-bit', + 'PCI 33' => 'PCI 33', + 'PCI 64-bit' => 'PCI 64-bit', + 'PCI Express Other' => 'PCI Express Other', + 'PCI Express x16' => 'PCI Express x16', + 'PCI Express' => 'PCI Express', + 'PCI' => 'PCI', + 'PCI-X' => 'PCI-X', + 'PCIe 6-pin Power Connectors' => 'PCIe 6-pin Power Connectors', + 'PCIe 8-pin Power Connectors' => 'PCIe 8-pin Power Connectors', + 'PCIe 1.0 x16' => 'PCIe 1.0 x16', + 'PCIe 1.1 x16' => 'PCIe 1.1 x16', + 'PCIe 2.0 x16' => 'PCIe 2.0 x16', + 'PCIe 3.0 x8' => 'PCIe 3.0 x8', + 'PCIe 3.0 x16' => 'PCIe 3.0 x16', + 'PCIe 4.0 x4' => 'PCIe 4.0 x4', + 'PCIe 4.0 x8' => 'PCIe 4.0 x8', + 'PCIe 4.0 x16' => 'PCIe 4.0 x16', + 'PCIe 5.0 x16' => 'PCIe 5.0 x16', + 'PCIe x1' => 'PCIe x1', + 'PCIe x4' => 'PCIe x4', + 'PCIe x8' => 'PCIe x8', + 'PCIe x16' => 'PCIe x16', + 'Pin count' => 'Pin Count', + 'PIN_GRID_ARRAY' => 'PGA', + 'PLASTIC_LEADED_CHIP_CARRIER' => 'Plastic Leaded Chip Carrier', + 'Polyester' => 'Polyester', + 'Polyethylene Naphtalate' => 'Polyethylene Naphtalate', + 'PowerPC' => 'PowerPC', + 'Process node' => 'Process Node', + 'Product line' => 'Product Line', + 'Purchase price' => 'Purchase Price', + 'Rear filter size' => 'Rear filter size (mm)', + 'Received' => 'Received', + 'RISC V' => 'RISC V', + 'Rolls in camera' => '# of Rolls in a Camera', + 'ROPs' => 'ROPs', + 'Serial' => 'Serial', + 'Series' => 'Series', + 'Shader model' => 'Shader Model', + 'Shading units' => 'Shading Units', + 'Slot span' => 'Slot Span', + 'SLOT' => 'Slot', + 'Small Format' => 'Small Format', + 'Socket' => 'Socket', + 'Sockets' => 'Sockets', + 'TDP (Watts)' => 'TDP (Watts)', + 'Tdp' => 'TDP', + 'Threads' => 'Threads', + 'TMUs' => 'TMUs', + 'Ttl type' => 'TTL Type', + 'Type' => 'Type', + 'Universal 32-bit PCI' => 'Universal 32-bit PCI', + 'Universal 64-bit PCI' => 'Universal 64-bit PCI', + 'Universal AGP' => 'Universal AGP', + 'Unknown' => 'Unknown', + 'Unused rolls' => '# of Unused Rolls', + 'Usable' => 'Usable', + 'Variant' => 'Variant', + 'VESA Local Bus' => 'VESA Local Bus', + 'VLB' => 'VLB', + 'Voltage' => 'Voltage', + 'Vulkan support' => 'Vulkan Support', + 'x86' => 'x86', + 'x86_64' => 'AMD64', + 'Z80' => 'Z80', ];