Minor rector fixes, fix rector config

This commit is contained in:
Timothy Warren 2023-07-21 10:50:58 -04:00
parent 0909a5e499
commit c6a9690942
10 changed files with 111 additions and 111 deletions

View File

@ -51,8 +51,8 @@ class CameraController extends AbstractController {
'mount' => 'ASC', 'mount' => 'ASC',
'model' => 'ASC', 'model' => 'ASC',
]); ]);
$working = array_filter($receivedItems, [$this, 'isWorking']); $working = array_filter($receivedItems, $this->isWorking(...));
$notWorking = array_filter($receivedItems, [$this, 'isNotWorking']); $notWorking = array_filter($receivedItems, $this->isNotWorking(...));
return $this->render('camera/index.html.twig', [ return $this->render('camera/index.html.twig', [
'not_received' => $newItems, 'not_received' => $newItems,

View File

@ -4,11 +4,12 @@ namespace App\Entity;
use Doctrine\Common\Collections\{ArrayCollection, Collection}; use Doctrine\Common\Collections\{ArrayCollection, Collection};
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Stringable;
#[ORM\Table(name: 'brand', schema: 'collection')] #[ORM\Table(name: 'brand', schema: 'collection')]
#[ORM\Entity] #[ORM\Entity]
#[ORM\UniqueConstraint(name: 'brand_unq', columns: ['name'])] #[ORM\UniqueConstraint(name: 'brand_unq', columns: ['name'])]
class Brand { class Brand implements Stringable {
use GetSet; use GetSet;
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]

View File

@ -3,10 +3,11 @@
namespace App\Entity; namespace App\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Stringable;
#[ORM\Table(name: 'brand_category', schema: 'collection')] #[ORM\Table(name: 'brand_category', schema: 'collection')]
#[ORM\Entity] #[ORM\Entity]
class BrandCategory { class BrandCategory implements Stringable {
use GetSet; use GetSet;
#[ORM\Id] #[ORM\Id]

View File

@ -4,10 +4,11 @@ namespace App\Entity;
use Doctrine\Common\Collections\{ArrayCollection, Collection}; use Doctrine\Common\Collections\{ArrayCollection, Collection};
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Stringable;
#[ORM\Table(name: 'chipset', schema: 'collection')] #[ORM\Table(name: 'chipset', schema: 'collection')]
#[ORM\Entity] #[ORM\Entity]
class Chipset { class Chipset implements Stringable {
use GetSet; use GetSet;
#[ORM\Column('id', type: 'integer', nullable: FALSE)] #[ORM\Column('id', type: 'integer', nullable: FALSE)]
@ -33,6 +34,6 @@ class Chipset {
{ {
$name = $this->brand->getName() . ' ' . $this->name; $name = $this->brand->getName() . ' ' . $this->name;
return ($this->parts !== '') ? "{$name} ({$this->parts})" : $name; return (string) (($this->parts !== '') ? "{$name} ({$this->parts})" : $name);
} }
} }

View File

@ -43,10 +43,10 @@ class GpuCore implements Stringable {
public function __toString(): string public function __toString(): string
{ {
$name = ( ! empty($this->variant)) $name = (empty($this->variant))
? "$this->name ($this->variant)" ? $this->name
: $this->name; : "$this->name ($this->variant)";
return "$name - [$this->brand] $this->generationName"; return "{$name} - [$this->brand] $this->generationName";
} }
} }

View File

@ -5,13 +5,14 @@ namespace App\Entity;
use App\Enum\SocketType; use App\Enum\SocketType;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Stringable;
/** /**
* @see https://en.wikipedia.org/wiki/CPU_socket * @see https://en.wikipedia.org/wiki/CPU_socket
*/ */
#[ORM\Table(name: 'socket', schema: 'collection')] #[ORM\Table(name: 'socket', schema: 'collection')]
#[ORM\Entity] #[ORM\Entity]
class Socket { class Socket implements Stringable {
use GetSet; use GetSet;
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)] #[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
@ -45,8 +46,8 @@ class Socket {
public function __toString(): string public function __toString(): string
{ {
$name = ( ! empty($this->otherName)) ? "$this->name/$this->otherName" : $this->name; $name = (empty($this->otherName)) ? $this->name : "$this->name/$this->otherName";
return "$name ({$this->type->value} $this->pinCount)"; return (string) "{$name} ({$this->type->value} $this->pinCount)";
} }
} }

View File

@ -270,7 +270,7 @@ final class MakeCollectionCrud extends AbstractMaker {
if ( ! class_exists(WebTestCase::class)) if ( ! class_exists(WebTestCase::class))
{ {
$io->caution('You\'ll need to install the `symfony/test-pack` to execute the tests for your new controller.'); $io->caution("You'll need to install the `symfony/test-pack` to execute the tests for your new controller.");
} }
} }

View File

@ -38,22 +38,22 @@ final class Version0 extends AbstractMigration {
$this->addSql('CREATE TABLE collection.film_format (id INT NOT NULL, number_id INT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE TABLE collection.film_format (id INT NOT NULL, number_id INT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE collection.flash (id SERIAL NOT NULL, brand VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, is_auto_flash BOOLEAN NOT NULL, is_ttl BOOLEAN NOT NULL, ttl_type VARCHAR(255) NOT NULL, is_p_ttl BOOLEAN NOT NULL, p_ttl_type VARCHAR(255) NOT NULL, guide_number VARCHAR(255) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, batteries VARCHAR(255) NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(255) DEFAULT NULL, formerly_owned BOOLEAN DEFAULT false NOT NULL, received BOOLEAN DEFAULT false NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE TABLE collection.flash (id SERIAL NOT NULL, brand VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, is_auto_flash BOOLEAN NOT NULL, is_ttl BOOLEAN NOT NULL, ttl_type VARCHAR(255) NOT NULL, is_p_ttl BOOLEAN NOT NULL, p_ttl_type VARCHAR(255) NOT NULL, guide_number VARCHAR(255) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, batteries VARCHAR(255) NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(255) DEFAULT NULL, formerly_owned BOOLEAN DEFAULT false NOT NULL, received BOOLEAN DEFAULT false NOT NULL, PRIMARY KEY(id))');
$this->addSql('COMMENT ON COLUMN collection.flash.purchase_price IS \'(DC2Type:money)\''); $this->addSql("COMMENT ON COLUMN collection.flash.purchase_price IS '(DC2Type:money)'");
$this->addSql('CREATE TABLE collection.brand_category_link (brand_category VARCHAR(255) NOT NULL, brand_id INT NOT NULL, PRIMARY KEY(brand_id, brand_category))'); $this->addSql('CREATE TABLE collection.brand_category_link (brand_category VARCHAR(255) NOT NULL, brand_id INT NOT NULL, PRIMARY KEY(brand_id, brand_category))');
$this->addSql('CREATE INDEX IDX_5EBFB63CC17C8AD0 ON collection.brand_category_link (brand_category)'); $this->addSql('CREATE INDEX IDX_5EBFB63CC17C8AD0 ON collection.brand_category_link (brand_category)');
$this->addSql('CREATE INDEX IDX_5EBFB63C44F5D008 ON collection.brand_category_link (brand_id)'); $this->addSql('CREATE INDEX IDX_5EBFB63C44F5D008 ON collection.brand_category_link (brand_id)');
$this->addSql('CREATE TABLE collection.previously_owned_flash (id SERIAL NOT NULL, brand VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, is_auto_flash BOOLEAN NOT NULL, is_ttl BOOLEAN NOT NULL, ttl_type VARCHAR(255) NOT NULL, is_p_ttl BOOLEAN NOT NULL, p_ttl_type VARCHAR(255) NOT NULL, guide_number VARCHAR(255) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, batteries VARCHAR(255) NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(255) DEFAULT NULL, formerly_owned BOOLEAN DEFAULT true NOT NULL, received BOOLEAN DEFAULT true NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE TABLE collection.previously_owned_flash (id SERIAL NOT NULL, brand VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, is_auto_flash BOOLEAN NOT NULL, is_ttl BOOLEAN NOT NULL, ttl_type VARCHAR(255) NOT NULL, is_p_ttl BOOLEAN NOT NULL, p_ttl_type VARCHAR(255) NOT NULL, guide_number VARCHAR(255) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, batteries VARCHAR(255) NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(255) DEFAULT NULL, formerly_owned BOOLEAN DEFAULT true NOT NULL, received BOOLEAN DEFAULT true NOT NULL, PRIMARY KEY(id))');
$this->addSql('COMMENT ON COLUMN collection.previously_owned_flash.purchase_price IS \'(DC2Type:money)\''); $this->addSql("COMMENT ON COLUMN collection.previously_owned_flash.purchase_price IS '(DC2Type:money)'");
$this->addSql('CREATE TABLE collection.previously_owned_lenses (id SERIAL NOT NULL, brand VARCHAR(64) DEFAULT NULL, coatings VARCHAR(64) DEFAULT NULL, product_line VARCHAR(64) DEFAULT NULL, model VARCHAR(64) DEFAULT NULL, min_f_stop VARCHAR(10) DEFAULT NULL, max_f_stop DOUBLE PRECISION DEFAULT NULL, min_focal_length INT DEFAULT NULL, max_focal_length INT DEFAULT NULL, serial VARCHAR(10) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, notes TEXT DEFAULT NULL, mount VARCHAR(40) DEFAULT NULL, received BOOLEAN NOT NULL, formerly_owned BOOLEAN NOT NULL, front_filter_size NUMERIC(10, 0) DEFAULT NULL, rear_filter_size NUMERIC(10, 0) DEFAULT NULL, is_teleconverter BOOLEAN NOT NULL, design_elements SMALLINT DEFAULT NULL, design_groups SMALLINT DEFAULT NULL, aperture_blades SMALLINT DEFAULT NULL, image_size VARCHAR(255) DEFAULT \'35mm\' NOT NULL, PRIMARY KEY(id))'); $this->addSql("CREATE TABLE collection.previously_owned_lenses (id SERIAL NOT NULL, brand VARCHAR(64) DEFAULT NULL, coatings VARCHAR(64) DEFAULT NULL, product_line VARCHAR(64) DEFAULT NULL, model VARCHAR(64) DEFAULT NULL, min_f_stop VARCHAR(10) DEFAULT NULL, max_f_stop DOUBLE PRECISION DEFAULT NULL, min_focal_length INT DEFAULT NULL, max_focal_length INT DEFAULT NULL, serial VARCHAR(10) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, notes TEXT DEFAULT NULL, mount VARCHAR(40) DEFAULT NULL, received BOOLEAN NOT NULL, formerly_owned BOOLEAN NOT NULL, front_filter_size NUMERIC(10, 0) DEFAULT NULL, rear_filter_size NUMERIC(10, 0) DEFAULT NULL, is_teleconverter BOOLEAN NOT NULL, design_elements SMALLINT DEFAULT NULL, design_groups SMALLINT DEFAULT NULL, aperture_blades SMALLINT DEFAULT NULL, image_size VARCHAR(255) DEFAULT '35mm' NOT NULL, PRIMARY KEY(id))");
$this->addSql('COMMENT ON COLUMN collection.previously_owned_lenses.purchase_price IS \'(DC2Type:money)\''); $this->addSql("COMMENT ON COLUMN collection.previously_owned_lenses.purchase_price IS '(DC2Type:money)'");
$this->addSql('CREATE TABLE collection.lenses (id SERIAL NOT NULL, brand VARCHAR(64) DEFAULT NULL, coatings VARCHAR(64) DEFAULT NULL, product_line VARCHAR(64) DEFAULT NULL, model VARCHAR(64) DEFAULT NULL, min_f_stop VARCHAR(10) DEFAULT NULL, max_f_stop DOUBLE PRECISION DEFAULT NULL, min_focal_length INT DEFAULT NULL, max_focal_length INT DEFAULT NULL, serial VARCHAR(10) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, notes TEXT DEFAULT NULL, mount VARCHAR(40) DEFAULT NULL, received BOOLEAN NOT NULL, formerly_owned BOOLEAN NOT NULL, front_filter_size NUMERIC(10, 0) DEFAULT NULL, rear_filter_size NUMERIC(10, 0) DEFAULT NULL, is_teleconverter BOOLEAN NOT NULL, design_elements SMALLINT DEFAULT NULL, design_groups SMALLINT DEFAULT NULL, aperture_blades SMALLINT DEFAULT NULL, image_size VARCHAR(255) DEFAULT \'35mm\' NOT NULL, PRIMARY KEY(id))'); $this->addSql("CREATE TABLE collection.lenses (id SERIAL NOT NULL, brand VARCHAR(64) DEFAULT NULL, coatings VARCHAR(64) DEFAULT NULL, product_line VARCHAR(64) DEFAULT NULL, model VARCHAR(64) DEFAULT NULL, min_f_stop VARCHAR(10) DEFAULT NULL, max_f_stop DOUBLE PRECISION DEFAULT NULL, min_focal_length INT DEFAULT NULL, max_focal_length INT DEFAULT NULL, serial VARCHAR(10) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, notes TEXT DEFAULT NULL, mount VARCHAR(40) DEFAULT NULL, received BOOLEAN NOT NULL, formerly_owned BOOLEAN NOT NULL, front_filter_size NUMERIC(10, 0) DEFAULT NULL, rear_filter_size NUMERIC(10, 0) DEFAULT NULL, is_teleconverter BOOLEAN NOT NULL, design_elements SMALLINT DEFAULT NULL, design_groups SMALLINT DEFAULT NULL, aperture_blades SMALLINT DEFAULT NULL, image_size VARCHAR(255) DEFAULT '35mm' NOT NULL, PRIMARY KEY(id))");
$this->addSql('COMMENT ON COLUMN collection.lenses.purchase_price IS \'(DC2Type:money)\''); $this->addSql("COMMENT ON COLUMN collection.lenses.purchase_price IS '(DC2Type:money)'");
$this->addSql('CREATE TABLE collection.film (id SERIAL NOT NULL, brand VARCHAR(255) NOT NULL, product_line VARCHAR(255) DEFAULT NULL, film_name VARCHAR(255) NOT NULL, film_speed_asa INT NOT NULL, film_speed_din INT NOT NULL, film_format VARCHAR(255) NOT NULL, film_base VARCHAR(255) DEFAULT \'Cellulose Triacetate\' NOT NULL, unused_rolls INT DEFAULT 0 NOT NULL, developed_rolls INT DEFAULT 0 NOT NULL, chemistry VARCHAR(255) DEFAULT \'C-41\' NOT NULL, notes TEXT DEFAULT NULL, film_alias VARCHAR(255) DEFAULT NULL, rolls_in_camera INT DEFAULT 0 NOT NULL, PRIMARY KEY(id))'); $this->addSql("CREATE TABLE collection.film (id SERIAL NOT NULL, brand VARCHAR(255) NOT NULL, product_line VARCHAR(255) DEFAULT NULL, film_name VARCHAR(255) NOT NULL, film_speed_asa INT NOT NULL, film_speed_din INT NOT NULL, film_format VARCHAR(255) NOT NULL, film_base VARCHAR(255) DEFAULT 'Cellulose Triacetate' NOT NULL, unused_rolls INT DEFAULT 0 NOT NULL, developed_rolls INT DEFAULT 0 NOT NULL, chemistry VARCHAR(255) DEFAULT 'C-41' NOT NULL, notes TEXT DEFAULT NULL, film_alias VARCHAR(255) DEFAULT NULL, rolls_in_camera INT DEFAULT 0 NOT NULL, PRIMARY KEY(id))");
$this->addSql('CREATE TABLE collection.fpu (id SERIAL NOT NULL, brand_id INT NOT NULL, socket_id INT NOT NULL, model VARCHAR(255) NOT NULL, clock_speed INT NOT NULL, count INT DEFAULT 1 NOT NULL, notes TEXT DEFAULT NULL, series VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE TABLE collection.fpu (id SERIAL NOT NULL, brand_id INT NOT NULL, socket_id INT NOT NULL, model VARCHAR(255) NOT NULL, clock_speed INT NOT NULL, count INT DEFAULT 1 NOT NULL, notes TEXT DEFAULT NULL, series VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX idx_c741fa58d20e239c ON collection.fpu (socket_id)'); $this->addSql('CREATE INDEX idx_c741fa58d20e239c ON collection.fpu (socket_id)');
@ -65,47 +65,47 @@ final class Version0 extends AbstractMigration {
$this->addSql('CREATE TABLE collection.cpu (id SERIAL NOT NULL, brand_id INT NOT NULL, architecture VARCHAR(255) NOT NULL, product_line VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, part_number VARCHAR(255) NOT NULL, lot_number VARCHAR(255) DEFAULT NULL, micro_architecture VARCHAR(255) DEFAULT NULL, codename VARCHAR(255) DEFAULT NULL, base_speed INT NOT NULL, boost_speed INT DEFAULT NULL, cores INT NOT NULL, threads INT NOT NULL, igp VARCHAR(255) DEFAULT NULL, voltage DOUBLE PRECISION DEFAULT NULL, tdp INT DEFAULT NULL, process_node INT DEFAULT NULL, count INT NOT NULL, usable BOOLEAN NOT NULL, received BOOLEAN NOT NULL, link VARCHAR(255) NOT NULL, notes TEXT DEFAULT NULL, l1_data_size INT DEFAULT NULL, l1_code_size INT DEFAULT NULL, l1_unified_size INT DEFAULT NULL, l1_unified_way INT DEFAULT NULL, l2_count INT NOT NULL, l2_size INT DEFAULT NULL, l2_way INT DEFAULT NULL, l3_count INT NOT NULL, l3_size INT DEFAULT NULL, l3_way INT DEFAULT NULL, l1_data_way INT DEFAULT NULL, l1_code_way INT DEFAULT NULL, l1_data_count INT DEFAULT NULL, l1_code_count INT DEFAULT NULL, l1_unified_count INT DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE TABLE collection.cpu (id SERIAL NOT NULL, brand_id INT NOT NULL, architecture VARCHAR(255) NOT NULL, product_line VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, part_number VARCHAR(255) NOT NULL, lot_number VARCHAR(255) DEFAULT NULL, micro_architecture VARCHAR(255) DEFAULT NULL, codename VARCHAR(255) DEFAULT NULL, base_speed INT NOT NULL, boost_speed INT DEFAULT NULL, cores INT NOT NULL, threads INT NOT NULL, igp VARCHAR(255) DEFAULT NULL, voltage DOUBLE PRECISION DEFAULT NULL, tdp INT DEFAULT NULL, process_node INT DEFAULT NULL, count INT NOT NULL, usable BOOLEAN NOT NULL, received BOOLEAN NOT NULL, link VARCHAR(255) NOT NULL, notes TEXT DEFAULT NULL, l1_data_size INT DEFAULT NULL, l1_code_size INT DEFAULT NULL, l1_unified_size INT DEFAULT NULL, l1_unified_way INT DEFAULT NULL, l2_count INT NOT NULL, l2_size INT DEFAULT NULL, l2_way INT DEFAULT NULL, l3_count INT NOT NULL, l3_size INT DEFAULT NULL, l3_way INT DEFAULT NULL, l1_data_way INT DEFAULT NULL, l1_code_way INT DEFAULT NULL, l1_data_count INT DEFAULT NULL, l1_code_count INT DEFAULT NULL, l1_unified_count INT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_C18A38B344F5D008 ON collection.cpu (brand_id)'); $this->addSql('CREATE INDEX IDX_C18A38B344F5D008 ON collection.cpu (brand_id)');
$this->addSql('COMMENT ON COLUMN collection.cpu.lot_number IS \'The CPU lot number, such as s-spec for Intel CPUs\''); $this->addSql("COMMENT ON COLUMN collection.cpu.lot_number IS 'The CPU lot number, such as s-spec for Intel CPUs'");
$this->addSql('COMMENT ON COLUMN collection.cpu.base_speed IS \'The stock speed of the cpu in MHz\''); $this->addSql("COMMENT ON COLUMN collection.cpu.base_speed IS 'The stock speed of the cpu in MHz'");
$this->addSql('COMMENT ON COLUMN collection.cpu.boost_speed IS \'The max boost speed of the cpu in MHz, if applicable\''); $this->addSql("COMMENT ON COLUMN collection.cpu.boost_speed IS 'The max boost speed of the cpu in MHz, if applicable'");
$this->addSql('COMMENT ON COLUMN collection.cpu.igp IS \'The name of the integrated graphics processor\''); $this->addSql("COMMENT ON COLUMN collection.cpu.igp IS 'The name of the integrated graphics processor'");
$this->addSql('COMMENT ON COLUMN collection.cpu.usable IS \'Whether the chip is working, and can be used with other hardware I have\''); $this->addSql("COMMENT ON COLUMN collection.cpu.usable IS 'Whether the chip is working, and can be used with other hardware I have'");
$this->addSql('COMMENT ON COLUMN collection.cpu.received IS \'Whether I have the chip in my possession (instead of in shipping)\''); $this->addSql("COMMENT ON COLUMN collection.cpu.received IS 'Whether I have the chip in my possession (instead of in shipping)'");
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_data_size IS \'The size of each Level 1 data cache in KB\''); $this->addSql("COMMENT ON COLUMN collection.cpu.l1_data_size IS 'The size of each Level 1 data cache in KB'");
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_code_size IS \'The size of each Level 1 instruction cache in KB\''); $this->addSql("COMMENT ON COLUMN collection.cpu.l1_code_size IS 'The size of each Level 1 instruction cache in KB'");
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_unified_size IS \'The size of each Level 1 unified cache in KB\''); $this->addSql("COMMENT ON COLUMN collection.cpu.l1_unified_size IS 'The size of each Level 1 unified cache in KB'");
$this->addSql('COMMENT ON COLUMN collection.cpu.l2_count IS \'The number of L2 caches on the package, usually the same as the number of cores\''); $this->addSql("COMMENT ON COLUMN collection.cpu.l2_count IS 'The number of L2 caches on the package, usually the same as the number of cores'");
$this->addSql('COMMENT ON COLUMN collection.cpu.l2_size IS \'The size of each Level 2 cache in KB\''); $this->addSql("COMMENT ON COLUMN collection.cpu.l2_size IS 'The size of each Level 2 cache in KB'");
$this->addSql('COMMENT ON COLUMN collection.cpu.l3_count IS \'The number of L3 caches on the package\''); $this->addSql("COMMENT ON COLUMN collection.cpu.l3_count IS 'The number of L3 caches on the package'");
$this->addSql('COMMENT ON COLUMN collection.cpu.l3_size IS \'The size of each Level 3 cache in KB\''); $this->addSql("COMMENT ON COLUMN collection.cpu.l3_size IS 'The size of each Level 3 cache in KB'");
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_data_count IS \'The number of L1 data caches on the package, usually the same as the number of cores\''); $this->addSql("COMMENT ON COLUMN collection.cpu.l1_data_count IS 'The number of L1 data caches on the package, usually the same as the number of cores'");
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_code_count IS \'The number of L1 instruction caches on the package, usually the same as the number of cores\''); $this->addSql("COMMENT ON COLUMN collection.cpu.l1_code_count IS 'The number of L1 instruction caches on the package, usually the same as the number of cores'");
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_unified_count IS \'The number of L1 caches on the package, usually the same as the number of cores\''); $this->addSql("COMMENT ON COLUMN collection.cpu.l1_unified_count IS 'The number of L1 caches on the package, usually the same as the number of cores'");
$this->addSql('CREATE TABLE collection.camera (id SERIAL NOT NULL, type_id INT NOT NULL, brand VARCHAR(64) NOT NULL, mount VARCHAR(32) NOT NULL, model VARCHAR(255) NOT NULL, is_digital BOOLEAN NOT NULL, crop_factor NUMERIC(10, 0) NOT NULL, is_working BOOLEAN NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(20) NOT NULL, formerly_owned BOOLEAN NOT NULL, purchase_price MONEY DEFAULT NULL, battery_type VARCHAR(255) DEFAULT NULL, film_format VARCHAR(255) DEFAULT NULL, received BOOLEAN DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE TABLE collection.camera (id SERIAL NOT NULL, type_id INT NOT NULL, brand VARCHAR(64) NOT NULL, mount VARCHAR(32) NOT NULL, model VARCHAR(255) NOT NULL, is_digital BOOLEAN NOT NULL, crop_factor NUMERIC(10, 0) NOT NULL, is_working BOOLEAN NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(20) NOT NULL, formerly_owned BOOLEAN NOT NULL, purchase_price MONEY DEFAULT NULL, battery_type VARCHAR(255) DEFAULT NULL, film_format VARCHAR(255) DEFAULT NULL, received BOOLEAN DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_8326CD6CC54C8C93 ON collection.camera (type_id)'); $this->addSql('CREATE INDEX IDX_8326CD6CC54C8C93 ON collection.camera (type_id)');
$this->addSql('COMMENT ON COLUMN collection.camera.purchase_price IS \'(DC2Type:money)\''); $this->addSql("COMMENT ON COLUMN collection.camera.purchase_price IS '(DC2Type:money)'");
$this->addSql('CREATE TABLE collection.previously_owned_camera (id SERIAL NOT NULL, type_id INT NOT NULL, brand VARCHAR(64) NOT NULL, mount VARCHAR(32) NOT NULL, model VARCHAR(255) NOT NULL, is_digital BOOLEAN NOT NULL, crop_factor NUMERIC(10, 0) NOT NULL, is_working BOOLEAN NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(20) NOT NULL, formerly_owned BOOLEAN NOT NULL, purchase_price MONEY DEFAULT NULL, battery_type VARCHAR(255) DEFAULT NULL, film_format VARCHAR(255) DEFAULT NULL, received BOOLEAN DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE TABLE collection.previously_owned_camera (id SERIAL NOT NULL, type_id INT NOT NULL, brand VARCHAR(64) NOT NULL, mount VARCHAR(32) NOT NULL, model VARCHAR(255) NOT NULL, is_digital BOOLEAN NOT NULL, crop_factor NUMERIC(10, 0) NOT NULL, is_working BOOLEAN NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(20) NOT NULL, formerly_owned BOOLEAN NOT NULL, purchase_price MONEY DEFAULT NULL, battery_type VARCHAR(255) DEFAULT NULL, film_format VARCHAR(255) DEFAULT NULL, received BOOLEAN DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_78B0E96CC54C8C93 ON collection.previously_owned_camera (type_id)'); $this->addSql('CREATE INDEX IDX_78B0E96CC54C8C93 ON collection.previously_owned_camera (type_id)');
$this->addSql('COMMENT ON COLUMN collection.previously_owned_camera.purchase_price IS \'(DC2Type:money)\''); $this->addSql("COMMENT ON COLUMN collection.previously_owned_camera.purchase_price IS '(DC2Type:money)'");
$this->addSql('CREATE TABLE collection.gpu_core (id SERIAL NOT NULL, brand_id INT NOT NULL, name VARCHAR(255) NOT NULL, variant VARCHAR(255) DEFAULT NULL, generation_name VARCHAR(255) DEFAULT NULL, architecture VARCHAR(255) DEFAULT NULL, process_node INT DEFAULT NULL, architecture_link VARCHAR(255) DEFAULT NULL, generation_link VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE TABLE collection.gpu_core (id SERIAL NOT NULL, brand_id INT NOT NULL, name VARCHAR(255) NOT NULL, variant VARCHAR(255) DEFAULT NULL, generation_name VARCHAR(255) DEFAULT NULL, architecture VARCHAR(255) DEFAULT NULL, process_node INT DEFAULT NULL, architecture_link VARCHAR(255) DEFAULT NULL, generation_link VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_EE59217D44F5D008 ON collection.gpu_core (brand_id)'); $this->addSql('CREATE INDEX IDX_EE59217D44F5D008 ON collection.gpu_core (brand_id)');
$this->addSql('CREATE TABLE collection.gpu (id SERIAL NOT NULL, board_brand_id INT DEFAULT NULL, gpu_brand_id INT NOT NULL, gpu_core_id INT DEFAULT NULL, reference_model_name VARCHAR(255) NOT NULL, alternate_model_name VARCHAR(255) DEFAULT NULL, notes TEXT DEFAULT NULL, count INT DEFAULT 1 NOT NULL, molex_power INT DEFAULT 0 NOT NULL, pcie_6_pin INT DEFAULT 0 NOT NULL, pcie_8_pin INT DEFAULT 0 NOT NULL, card_key VARCHAR(255) DEFAULT \'PCIe x16\' NOT NULL, tdp INT DEFAULT NULL, link VARCHAR(255) DEFAULT NULL, bus_interface VARCHAR(255) DEFAULT NULL, slot_span INT DEFAULT 1 NOT NULL, base_clock INT DEFAULT NULL, boost_clock INT DEFAULT NULL, memory_clock INT DEFAULT NULL, memory_size INT DEFAULT NULL, memory_bus INT DEFAULT NULL, memory_type VARCHAR(255) DEFAULT NULL, shading_units INT DEFAULT NULL, tmus INT DEFAULT NULL, rops INT DEFAULT NULL, compute_units INT DEFAULT NULL, l1_cache VARCHAR(255) DEFAULT NULL, l2_cache VARCHAR(255) DEFAULT NULL, direct_x_support VARCHAR(255) DEFAULT NULL, opengl_support VARCHAR(255) DEFAULT NULL, opencl_support VARCHAR(255) DEFAULT NULL, vulkan_support VARCHAR(255) DEFAULT NULL, shader_model VARCHAR(255) DEFAULT NULL, acquired BOOLEAN DEFAULT true NOT NULL, PRIMARY KEY(id))'); $this->addSql("CREATE TABLE collection.gpu (id SERIAL NOT NULL, board_brand_id INT DEFAULT NULL, gpu_brand_id INT NOT NULL, gpu_core_id INT DEFAULT NULL, reference_model_name VARCHAR(255) NOT NULL, alternate_model_name VARCHAR(255) DEFAULT NULL, notes TEXT DEFAULT NULL, count INT DEFAULT 1 NOT NULL, molex_power INT DEFAULT 0 NOT NULL, pcie_6_pin INT DEFAULT 0 NOT NULL, pcie_8_pin INT DEFAULT 0 NOT NULL, card_key VARCHAR(255) DEFAULT 'PCIe x16' NOT NULL, tdp INT DEFAULT NULL, link VARCHAR(255) DEFAULT NULL, bus_interface VARCHAR(255) DEFAULT NULL, slot_span INT DEFAULT 1 NOT NULL, base_clock INT DEFAULT NULL, boost_clock INT DEFAULT NULL, memory_clock INT DEFAULT NULL, memory_size INT DEFAULT NULL, memory_bus INT DEFAULT NULL, memory_type VARCHAR(255) DEFAULT NULL, shading_units INT DEFAULT NULL, tmus INT DEFAULT NULL, rops INT DEFAULT NULL, compute_units INT DEFAULT NULL, l1_cache VARCHAR(255) DEFAULT NULL, l2_cache VARCHAR(255) DEFAULT NULL, direct_x_support VARCHAR(255) DEFAULT NULL, opengl_support VARCHAR(255) DEFAULT NULL, opencl_support VARCHAR(255) DEFAULT NULL, vulkan_support VARCHAR(255) DEFAULT NULL, shader_model VARCHAR(255) DEFAULT NULL, acquired BOOLEAN DEFAULT true NOT NULL, PRIMARY KEY(id))");
$this->addSql('CREATE INDEX IDX_C683906FD402D3B1 ON collection.gpu (board_brand_id)'); $this->addSql('CREATE INDEX IDX_C683906FD402D3B1 ON collection.gpu (board_brand_id)');
$this->addSql('CREATE INDEX IDX_C683906F4561DE01 ON collection.gpu (gpu_brand_id)'); $this->addSql('CREATE INDEX IDX_C683906F4561DE01 ON collection.gpu (gpu_brand_id)');
$this->addSql('CREATE INDEX IDX_C683906F87059374 ON collection.gpu (gpu_core_id)'); $this->addSql('CREATE INDEX IDX_C683906F87059374 ON collection.gpu (gpu_core_id)');
$this->addSql('COMMENT ON COLUMN collection.gpu.card_key IS \'The shape of the card connector\''); $this->addSql("COMMENT ON COLUMN collection.gpu.card_key IS 'The shape of the card connector'");
$this->addSql('COMMENT ON COLUMN collection.gpu.tdp IS \'Thermal Design Power (in Watts)\''); $this->addSql("COMMENT ON COLUMN collection.gpu.tdp IS 'Thermal Design Power (in Watts)'");
$this->addSql('COMMENT ON COLUMN collection.gpu.bus_interface IS \'The type of electrical bus this card uses\''); $this->addSql("COMMENT ON COLUMN collection.gpu.bus_interface IS 'The type of electrical bus this card uses'");
$this->addSql('COMMENT ON COLUMN collection.gpu.slot_span IS \'How many expansion slots the card occupies\''); $this->addSql("COMMENT ON COLUMN collection.gpu.slot_span IS 'How many expansion slots the card occupies'");
$this->addSql('COMMENT ON COLUMN collection.gpu.base_clock IS \'Base speed of the gpu core, in MHz\''); $this->addSql("COMMENT ON COLUMN collection.gpu.base_clock IS 'Base speed of the gpu core, in MHz'");
$this->addSql('COMMENT ON COLUMN collection.gpu.boost_clock IS \'GPU core boost clock, in MHz\''); $this->addSql("COMMENT ON COLUMN collection.gpu.boost_clock IS 'GPU core boost clock, in MHz'");
$this->addSql('COMMENT ON COLUMN collection.gpu.memory_clock IS \'Clock speed of the VRAM, in MHz\''); $this->addSql("COMMENT ON COLUMN collection.gpu.memory_clock IS 'Clock speed of the VRAM, in MHz'");
$this->addSql('COMMENT ON COLUMN collection.gpu.memory_size IS \'VRAM size, in MiB\''); $this->addSql("COMMENT ON COLUMN collection.gpu.memory_size IS 'VRAM size, in MiB'");
$this->addSql('COMMENT ON COLUMN collection.gpu.memory_bus IS \'The width of the memory bus in bits\''); $this->addSql("COMMENT ON COLUMN collection.gpu.memory_bus IS 'The width of the memory bus in bits'");
} }
public function down(Schema $schema): void public function down(Schema $schema): void

View File

@ -43,7 +43,7 @@
</tr> </tr>
{% else %} {% else %}
<tr> <tr>
<td colspan="<?= (count($entity_fields) + 1) ?>">no records found</td> <td colspan="<?= ((is_countable($entity_fields) ? count($entity_fields) : 0) + 1) ?>">no records found</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

View File

@ -2,84 +2,80 @@
use Rector\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector; use Rector\CodeQuality\Rector\BooleanNot\SimplifyDeMorganBinaryRector;
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector; use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\For_\{ForRepeatedCountToOwnVariableRector, ForToForeachRector}; use Rector\CodeQuality\Rector\For_\{ForRepeatedCountToOwnVariableRector};
use Rector\CodeQuality\Rector\If_\{ConsecutiveNullCompareReturnsToNullCoalesceQueueRector, SimplifyIfElseToTernaryRector, SimplifyIfReturnBoolRector}; use Rector\CodeQuality\Rector\If_\{ConsecutiveNullCompareReturnsToNullCoalesceQueueRector, SimplifyIfElseToTernaryRector, SimplifyIfReturnBoolRector};
use Rector\CodeQuality\Rector\Ternary\{SimplifyDuplicatedTernaryRector, SimplifyTautologyTernaryRector, SwitchNegatedTernaryRector}; use Rector\CodeQuality\Rector\Ternary\{SimplifyTautologyTernaryRector, SwitchNegatedTernaryRector};
use Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector;
use Rector\CodingStyle\Rector\Class_\AddArrayDefaultToArrayPropertyRector; use Rector\CodingStyle\Rector\Class_\AddArrayDefaultToArrayPropertyRector;
use Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector; use Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector; use Rector\CodingStyle\Rector\ClassMethod\{NewlineBeforeNewAssignSetRector};
use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector; use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector;
use Rector\CodingStyle\Rector\FuncCall\{CallUserFuncArrayToVariadicRector, CallUserFuncToMethodCallRector, CountArrayToEmptyArrayComparisonRector}; use Rector\CodingStyle\Rector\FuncCall\{CallUserFuncArrayToVariadicRector, CallUserFuncToMethodCallRector, CountArrayToEmptyArrayComparisonRector, VersionCompareFuncCallToConstantRector};
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector; use Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector;
use Rector\Core\Configuration\Option; use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassMethod\{RemoveUselessParamTagRector, RemoveUselessReturnTagRector}; use Rector\DeadCode\Rector\ClassMethod\{RemoveUselessParamTagRector, RemoveUselessReturnTagRector};
use Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector; use Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector;
use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector; use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector;
use Rector\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector; use Rector\DeadCode\Rector\Switch_\RemoveDuplicatedCaseInSwitchRector;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector; use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
use Rector\EarlyReturn\Rector\If_\{ChangeIfElseValueAssignToEarlyReturnRector, RemoveAlwaysElseRector}; use Rector\EarlyReturn\Rector\If_\{ChangeIfElseValueAssignToEarlyReturnRector, RemoveAlwaysElseRector};
use Rector\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector; use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Restoration\Rector\Property\MakeTypedPropertyNullableIfCheckedRector; use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\LevelSetList;
use Rector\Symfony\Set\{SymfonyLevelSetList, SymfonySetList}; use Rector\Symfony\Set\{SymfonyLevelSetList, SymfonySetList};
use Rector\TypeDeclaration\Rector\ClassMethod\{AddArrayParamDocTypeRector, AddArrayReturnDocTypeRector, AddMethodCallBasedStrictParamTypeRector, ParamTypeByMethodCallTypeRector, ParamTypeByParentCallTypeRector}; use Rector\TypeDeclaration\Rector\ClassMethod\{AddMethodCallBasedStrictParamTypeRector, ParamTypeByMethodCallTypeRector, ParamTypeByParentCallTypeRector};
use Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector; use Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
require_once __DIR__ . '/common.inc.php'; return static function (RectorConfig $config): void {
$config->importShortClasses(FALSE);
return static function (ContainerConfigurator $config): void { $config->sets([
$parameters = $config->parameters(); LevelSetList::UP_TO_PHP_82,
$parameters->set(Option::AUTO_IMPORT_NAMES, TRUE); PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES,
$parameters->set(Option::IMPORT_SHORT_CLASSES, TRUE); PHPUnitSetList::PHPUNIT_100,
$parameters->set(Option::SKIP, [
ReadOnlyPropertyRector::class,
]);
walk_array([$config, 'import'], [
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
LevelSetList::UP_TO_PHP_81,
SymfonyLevelSetList::UP_TO_SYMFONY_60, SymfonyLevelSetList::UP_TO_SYMFONY_60,
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
]); ]);
$services = $config->services(); $config->rules([
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, AddArrayDefaultToArrayPropertyRector::class,
RemoveFinalFromConstRector::class, AddClosureReturnTypeRector::class,
NewlineBeforeNewAssignSetRector::class, AddMethodCallBasedStrictParamTypeRector::class,
WrapEncapsedVariableInCurlyBracesRector::class,
CallUserFuncArrayToVariadicRector::class, CallUserFuncArrayToVariadicRector::class,
CallUserFuncToMethodCallRector::class, CallUserFuncToMethodCallRector::class,
CountArrayToEmptyArrayComparisonRector::class,
NewlineAfterStatementRector::class,
RemoveUselessParamTagRector::class,
RemoveUselessReturnTagRector::class,
RemoveUnusedForeachKeyRector::class,
RemoveUselessVarTagRector::class,
RemoveDuplicatedCaseInSwitchRector::class,
ChangeNestedForeachIfsToEarlyContinueRector::class,
ChangeIfElseValueAssignToEarlyReturnRector::class, ChangeIfElseValueAssignToEarlyReturnRector::class,
RemoveAlwaysElseRector::class, ChangeNestedForeachIfsToEarlyContinueRector::class,
MakeTypedPropertyNullableIfCheckedRector::class, CompleteDynamicPropertiesRector::class,
AddArrayParamDocTypeRector::class, ConsecutiveNullCompareReturnsToNullCoalesceQueueRector::class,
AddArrayReturnDocTypeRector::class, CountArrayToEmptyArrayComparisonRector::class,
AddMethodCallBasedStrictParamTypeRector::class, ForRepeatedCountToOwnVariableRector::class,
NewlineBeforeNewAssignSetRector::class,
ParamTypeByMethodCallTypeRector::class, ParamTypeByMethodCallTypeRector::class,
ParamTypeByParentCallTypeRector::class, ParamTypeByParentCallTypeRector::class,
AddClosureReturnTypeRector::class, RemoveAlwaysElseRector::class,
RemoveDuplicatedCaseInSwitchRector::class,
RemoveFinalFromConstRector::class,
RemoveUnusedForeachKeyRector::class,
RemoveUselessParamTagRector::class,
RemoveUselessReturnTagRector::class,
RemoveUselessVarTagRector::class,
SimplifyDeMorganBinaryRector::class,
SimplifyIfElseToTernaryRector::class,
SimplifyIfReturnBoolRector::class,
SimplifyTautologyTernaryRector::class,
StaticArrowFunctionRector::class,
SwitchNegatedTernaryRector::class,
SymplifyQuoteEscapeRector::class,
TypedPropertyFromAssignsRector::class, TypedPropertyFromAssignsRector::class,
VersionCompareFuncCallToConstantRector::class,
WrapEncapsedVariableInCurlyBracesRector::class,
]);
$config->skip([
NullToStrictStringFuncCallArgRector::class,
ReadOnlyPropertyRector::class,
RestoreDefaultNullToNullableTypePropertyRector::class,
]); ]);
}; };