Replace the last of the PHPDoc annotations with PHP attributes

This commit is contained in:
Timothy Warren 2022-02-17 15:48:16 -05:00
parent 372d348b16
commit 41caca2722
19 changed files with 96 additions and 309 deletions

View File

@ -24,7 +24,7 @@ doctrine:
mappings:
App:
is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App

View File

@ -2,6 +2,7 @@
namespace App\Controller;
use Doctrine\Persistence\ManagerRegistry;
use LogicException;
use App\Entity\Camera;
use App\Form\CameraType;
@ -22,13 +23,16 @@ class CameraController extends AbstractController
use FormControllerTrait;
protected const ENTITY = Camera::class;
protected const FORM = CameraType::class;
public function __construct(private readonly ManagerRegistry $managerRegistry)
{
}
/**
* Lists all camera entities.
*/
#[Route(path: '/', name: 'camera_index', methods: ['GET'])]
public function indexAction() : Response
{
$em = $this->getDoctrine()->getManager();
$em = $this->managerRegistry->getManager();
$receivedItems = $em->getRepository(self::ENTITY)->findBy([
'received' => true
], [
@ -91,11 +95,8 @@ class CameraController extends AbstractController
/**
* Moves a camera to the previouslyOwned table
*
* @param Request $request
* @param Camera $camera
* @throws LogicException
* @throws ORMInvalidArgumentException
* @return RedirectResponse
*/
#[Route(path: '/{id}/deacquire', name: 'camera_deacquire', methods: ['POST'])]
public function deacquireAction(Request $request, Camera $camera) : RedirectResponse
@ -117,8 +118,6 @@ class CameraController extends AbstractController
* Creates a form to move
*
* @param Camera $camera The camera entity
*
* @return FormInterface
*/
private function createDeacquireForm(Camera $camera): FormInterface
{

View File

@ -2,6 +2,7 @@
namespace App\Controller;
use Doctrine\Persistence\ManagerRegistry;
use LogicException;
use App\Entity\Film;
use App\Form\FilmType;
@ -21,13 +22,16 @@ class FilmController extends AbstractController
use FormControllerTrait;
protected const ENTITY = Film::class;
protected const FORM = FilmType::class;
public function __construct(private readonly ManagerRegistry $managerRegistry)
{
}
/**
* Lists all film entities.
*/
#[Route(path: '/', name: 'film_index', methods: ['GET'])]
public function indexAction() : Response
{
$repo = $this->getDoctrine()->getManager()->getRepository(self::ENTITY);
$repo = $this->managerRegistry->getManager()->getRepository(self::ENTITY);
$criteria = Criteria::create()
->where(Criteria::expr()->gt('rollsInCamera', 0))
->orderBy([

View File

@ -2,6 +2,7 @@
namespace App\Controller;
use Doctrine\Persistence\ManagerRegistry;
use App\Entity\Lenses;
use App\Form\LensesType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@ -18,13 +19,16 @@ class LensesController extends AbstractController
use FormControllerTrait;
protected const ENTITY = Lenses::class;
protected const FORM = LensesType::class;
public function __construct(private readonly ManagerRegistry $managerRegistry)
{
}
/**
* Lists all lens entities.
*/
#[Route(path: '/', name: 'lens_index', methods: ['GET'])]
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$em = $this->managerRegistry->getManager();
$receivedItems = $em->getRepository(self::ENTITY)->findBy([
'received' => true
], [
@ -76,7 +80,6 @@ class LensesController extends AbstractController
* Moves a camera to the previouslyOwned table
*
* @param Request $request
* @param Lenses $lens
* @return RedirectResponse
*/
#[Route(path: '/{id}/deacquire', name: 'lens_deacquire', methods: ['POST'])]
@ -107,8 +110,6 @@ class LensesController extends AbstractController
* Creates a form to move
*
* @param Lenses $lens The lens entity
*
* @return FormInterface
*/
private function createDeacquireForm(Lenses $lens): FormInterface
{

View File

@ -57,7 +57,6 @@ class PreviouslyOwnedCameraController extends AbstractController
* Moves a camera to the previouslyOwned table
*
* @param Request $request
* @param PreviouslyOwnedCamera $camera
* @throws LogicException
* @throws ORMInvalidArgumentException
* @return RedirectResponse
@ -71,8 +70,6 @@ class PreviouslyOwnedCameraController extends AbstractController
* Creates a form to move
*
* @param PreviouslyOwnedCamera $camera The camera entity
*
* @return FormInterface
*/
private function createReacquireForm(PreviouslyOwnedCamera $camera): FormInterface
{

View File

@ -11,11 +11,8 @@ use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class BatteryType
{
/**
* @var integer
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
private int $id;
}

View File

@ -2,6 +2,7 @@
namespace App\Entity;
use App\Repository\CameraRepository;
use Doctrine\ORM\Mapping as ORM;
/**
@ -9,16 +10,13 @@ use Doctrine\ORM\Mapping as ORM;
*/
#[ORM\Table(name: 'camera', schema: 'camera')]
#[ORM\Index(columns: ['type_id'], name: 'IDX_747C826FC54C8C93')]
#[ORM\Entity(repositoryClass: 'App\Repository\CameraRepository')]
#[ORM\Entity(repositoryClass: CameraRepository::class)]
class Camera
{
use CameraTrait;
/**
* @var integer
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
#[ORM\SequenceGenerator(sequenceName: 'camera__id_seq', allocationSize: 1, initialValue: 1)]
private $id;
private int $id;
}

View File

@ -19,32 +19,27 @@ trait CameraTrait
* @var CameraType
*/
#[ORM\ManyToOne(targetEntity: 'CameraType')]
#[ORM\JoinColumn(name: 'type_id', referencedColumnName: 'id')]
private ?CameraType $type;
#[ORM\JoinColumn(name: 'type_id', referencedColumnName: 'id')]private readonly ?CameraType $type;
/**
* @var string
*/
#[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: false)]
private string $brand;
#[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: false)]private readonly string $brand;
/**
* @var string
*/
#[ORM\Column(name: 'mount', type: 'string', length: 32, nullable: false)]
private string $mount;
#[ORM\Column(name: 'mount', type: 'string', length: 32, nullable: false)]private readonly string $mount;
/**
* @var string
*/
#[ORM\Column(name: 'model', type: 'string', length: 255, nullable: false)]
private string $model;
#[ORM\Column(name: 'model', type: 'string', length: 255, nullable: false)]private readonly string $model;
/**
* @var boolean
*/
#[ORM\Column(name: 'is_digital', type: 'boolean', nullable: false)]
private bool $isDigital;
#[ORM\Column(name: 'is_digital', type: 'boolean', nullable: false)]private readonly bool $isDigital;
/**
* @var string
@ -55,20 +50,17 @@ trait CameraTrait
/**
* @var boolean
*/
#[ORM\Column(name: 'is_working', type: 'boolean', nullable: false)]
private bool $isWorking;
#[ORM\Column(name: 'is_working', type: 'boolean', nullable: false)]private readonly bool $isWorking;
/**
* @var string
*/
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]
private ?string $notes;
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]private readonly ?string $notes;
/**
* @var string
*/
#[ORM\Column(name: 'serial', type: 'string', length: 20, nullable: false)]
private string $serial;
#[ORM\Column(name: 'serial', type: 'string', length: 20, nullable: false)]private readonly string $serial;
/**
* @var boolean
@ -85,8 +77,7 @@ trait CameraTrait
/**
* @var string
*/
#[ORM\Column(name: 'battery_type', type: 'string', nullable: true)]
private ?string $batteryType;
#[ORM\Column(name: 'battery_type', type: 'string', nullable: true)]private readonly ?string $batteryType;
/**
* @var string
@ -102,8 +93,6 @@ trait CameraTrait
/**
* Get id
*
* @return integer
*/
public function getId(): int
{
@ -113,9 +102,7 @@ trait CameraTrait
/**
* Set type
*
* @param CameraType $type
*
* @return self
*/
public function setType(CameraType $type = null): self
{
@ -137,9 +124,7 @@ trait CameraTrait
/**
* Set brand
*
* @param string $brand
*
* @return self
*/
public function setBrand(string $brand): self
{
@ -161,9 +146,7 @@ trait CameraTrait
/**
* Set mount
*
* @param string $mount
*
* @return self
*/
public function setMount(string $mount): self
{
@ -185,9 +168,7 @@ trait CameraTrait
/**
* Set model
*
* @param string $model
*
* @return self
*/
public function setModel(string $model): self
{
@ -209,9 +190,7 @@ trait CameraTrait
/**
* Set isDigital
*
* @param boolean $isDigital
*
* @return self
*/
public function setIsDigital(bool $isDigital): self
{
@ -233,9 +212,7 @@ trait CameraTrait
/**
* Set cropFactor
*
* @param string $cropFactor
*
* @return self
*/
public function setCropFactor(string $cropFactor): self
{
@ -246,8 +223,6 @@ trait CameraTrait
/**
* Get cropFactor
*
* @return string
*/
public function getCropFactor(): string
{
@ -257,9 +232,7 @@ trait CameraTrait
/**
* Set isWorking
*
* @param boolean $isWorking
*
* @return self
*/
public function setIsWorking(bool $isWorking): self
{
@ -282,8 +255,6 @@ trait CameraTrait
* Set notes
*
* @param string $notes
*
* @return self
*/
public function setNotes($notes): self
{
@ -294,8 +265,6 @@ trait CameraTrait
/**
* Get notes
*
* @return string
*/
public function getNotes(): string
{
@ -306,8 +275,6 @@ trait CameraTrait
* Set serial
*
* @param string $serial
*
* @return self
*/
public function setSerial($serial): self
{
@ -318,8 +285,6 @@ trait CameraTrait
/**
* Get serial
*
* @return string
*/
public function getSerial(): string
{
@ -330,8 +295,6 @@ trait CameraTrait
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*
* @return self
*/
public function setFormerlyOwned($formerlyOwned): self
{
@ -354,8 +317,6 @@ trait CameraTrait
* Set batteryType
*
* @param string $batteryType
*
* @return self
*/
public function setBatteryType($batteryType): self
{
@ -378,8 +339,6 @@ trait CameraTrait
* Set filmFormat
*
* @param string $filmFormat
*
* @return self
*/
public function setFilmFormat($filmFormat): self
{
@ -390,8 +349,6 @@ trait CameraTrait
/**
* Get filmFormat
*
* @return string
*/
public function getFilmFormat(): string
{
@ -402,8 +359,6 @@ trait CameraTrait
* Set received
*
* @param boolean $received
*
* @return self
*/
public function setReceived($received): self
{
@ -414,8 +369,6 @@ trait CameraTrait
/**
* Get received
*
* @return boolean
*/
public function getReceived(): bool
{

View File

@ -2,6 +2,7 @@
namespace App\Entity;
use Stringable;
use Doctrine\ORM\Mapping as ORM;
/**
@ -9,16 +10,13 @@ use Doctrine\ORM\Mapping as ORM;
*/
#[ORM\Table(name: 'camera_type', schema: 'camera')]
#[ORM\Entity]
class CameraType
class CameraType implements Stringable
{
/**
* @var integer
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
#[ORM\SequenceGenerator(sequenceName: 'camera.camera_type_id_seq', allocationSize: 1, initialValue: 1)]
private $id;
private int $id;
/**
* @var string
*/
@ -28,11 +26,9 @@ class CameraType
* @var string
*/
#[ORM\Column(name: 'description', type: 'text', nullable: true)]
private ?string $description;
private ?string $description = null;
/**
* Value for serialization
*
* @return string
*/
public function __toString(): string
{
@ -40,8 +36,6 @@ class CameraType
}
/**
* Get id
*
* @return integer
*/
public function getId(): int
{
@ -50,9 +44,7 @@ class CameraType
/**
* Set type
*
* @param string $type
*
* @return CameraType
*/
public function setType(string $type): self
{
@ -63,9 +55,7 @@ class CameraType
/**
* Set description
*
* @param string $description
*
* @return CameraType
*/
public function setDescription(string $description): self
{

View File

@ -11,13 +11,10 @@ use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class Film
{
/**
* @var integer
*/
#[ORM\Id]
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
private int $id;
/**
* @var string
*/
@ -27,7 +24,7 @@ class Film
* @var string
*/
#[ORM\Column(name: 'product_line', type: 'string', nullable: true)]
private ?string $productLine;
private ?string $productLine = null;
/**
* @var string
*/
@ -37,7 +34,7 @@ class Film
* @var string
*/
#[ORM\Column(name: 'film_alias', type: 'string', nullable: true)]
private ?string $filmAlias;
private ?string $filmAlias = null;
/**
* @var int
*/
@ -82,10 +79,7 @@ class Film
* @var string
*/
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]
private ?string $notes;
/**
* @return int
*/
private ?string $notes = null;
public function getId(): int
{
return $this->id;
@ -97,10 +91,6 @@ class Film
{
return $this->brand;
}
/**
* @param string $brand
* @return self
*/
public function setBrand(string $brand): self
{
$this->brand = $brand;
@ -115,7 +105,6 @@ class Film
}
/**
* @param string $productLine
* @return self
*/
public function setProductLine(?string $productLine): self
{
@ -129,10 +118,6 @@ class Film
{
return $this->filmName;
}
/**
* @param string $filmName
* @return self
*/
public function setFilmName(string $filmName): self
{
$this->filmName = $filmName;
@ -145,10 +130,6 @@ class Film
{
return $this->filmAlias;
}
/**
* @param string $filmAlias
* @return self
*/
public function setFilmAlias(string $filmAlias): self
{
$this->filmAlias = $filmAlias;
@ -161,10 +142,6 @@ class Film
{
return $this->filmSpeedAsa;
}
/**
* @param int $filmSpeedAsa
* @return self
*/
public function setFilmSpeedAsa(int $filmSpeedAsa): self
{
$this->filmSpeedAsa = $filmSpeedAsa;
@ -177,10 +154,6 @@ class Film
{
return $this->filmSpeedDin;
}
/**
* @param int $filmSpeedDin
* @return self
*/
public function setFilmSpeedDin(int $filmSpeedDin): self
{
$this->filmSpeedDin = $filmSpeedDin;
@ -193,10 +166,6 @@ class Film
{
return $this->filmFormat;
}
/**
* @param string $filmFormat
* @return self
*/
public function setFilmFormat(string $filmFormat): self
{
$this->filmFormat = $filmFormat;
@ -209,10 +178,6 @@ class Film
{
return $this->filmBase;
}
/**
* @param string $filmBase
* @return self
*/
public function setFilmBase(string $filmBase): self
{
$this->filmBase = $filmBase;
@ -225,10 +190,6 @@ class Film
{
return $this->unusedRolls;
}
/**
* @param int $unusedRolls
* @return self
*/
public function setUnusedRolls(int $unusedRolls): self
{
$this->unusedRolls = $unusedRolls;
@ -241,10 +202,6 @@ class Film
{
return $this->rollsInCamera;
}
/**
* @param int $rollsInCamera
* @return self
*/
public function setRollsInCamera(int $rollsInCamera): self
{
$this->rollsInCamera = $rollsInCamera;
@ -257,10 +214,6 @@ class Film
{
return $this->developedRolls;
}
/**
* @param int $developedRolls
* @return self
*/
public function setDevelopedRolls(int $developedRolls): self
{
$this->developedRolls = $developedRolls;
@ -273,10 +226,6 @@ class Film
{
return $this->chemistry;
}
/**
* @param string $chemistry
* @return self
*/
public function setChemistry(string $chemistry): self
{
$this->chemistry = $chemistry;
@ -289,10 +238,6 @@ class Film
{
return $this->notes;
}
/**
* @param string $notes
* @return self
*/
public function setNotes(string $notes): self
{
$this->notes = $notes;

View File

@ -36,10 +36,6 @@ class FilmFormat
{
return $this->numberId;
}
/**
* @param int $numberId
* @return self
*/
public function setNumberId(int $numberId): self
{
$this->numberId = $numberId;
@ -52,10 +48,6 @@ class FilmFormat
{
return $this->name;
}
/**
* @param string $name
* @return self
*/
public function setName(string $name): self
{
$this->name = $name;

View File

@ -11,14 +11,12 @@ trait FlashTrait
/**
* @var string
*/
#[ORM\Column(name: 'brand', type: 'string', nullable: false)]
private string $brand;
#[ORM\Column(name: 'brand', type: 'string', nullable: false)]private readonly string $brand;
/**
* @var string
*/
#[ORM\Column(name: 'model', type: 'string', nullable: false)]
private string $model;
#[ORM\Column(name: 'model', type: 'string', nullable: false)]private readonly string $model;
/**
* @var boolean
@ -53,14 +51,12 @@ trait FlashTrait
/**
* @var string
*/
#[ORM\Column(name: 'guide_number', type: 'string', nullable: true)]
private string $guideNumber;
#[ORM\Column(name: 'guide_number', type: 'string', nullable: true)]private readonly string $guideNumber;
/**
* @var string
*/
#[ORM\Column(name: 'purchase_price', type: 'money', nullable: true)]
private ?string $purchasePrice;
#[ORM\Column(name: 'purchase_price', type: 'money', nullable: true)]private readonly ?string $purchasePrice;
/**
* @var string
@ -71,19 +67,15 @@ trait FlashTrait
/**
* @var string
*/
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]
private ?string $notes;
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]private readonly ?string $notes;
/**
* @var string
*/
#[ORM\Column(name: 'serial', type: 'string', nullable: true)]
private ?string $serial;
#[ORM\Column(name: 'serial', type: 'string', nullable: true)]private readonly ?string $serial;
/**
* Get id
*
* @return integer
*/
public function getId(): int
{
@ -238,8 +230,6 @@ trait FlashTrait
* Set pTtlType
*
* @param string $pTtlType
*
* @return self
*/
public function setPTtlType($pTtlType): self
{

View File

@ -2,148 +2,129 @@
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
trait LensTrait
{
use PurchasePriceTrait;
/**
* @var string
*
* @ORM\Column(name="brand", type="string", length=64, nullable=true)
*/
private ?string $brand;
#[ORM\Column(name: 'brand', type: 'string', length: 64, nullable: true)]
private readonly ?string $brand;
/**
* @var string
*
* @ORM\Column(name="coatings", type="string", length=64, nullable=true)
*/
private ?string $coatings;
#[ORM\Column(name: 'coatings', type: 'string', length: 64, nullable: true)]
private readonly ?string $coatings;
/**
* @var string
*
* @ORM\Column(name="product_line", type="string", length=64, nullable=true)
*/
private ?string $productLine;
#[ORM\Column(name: 'product_line', type: 'string', length: 64, nullable: true)]
private readonly ?string $productLine;
/**
* @var string
*
* @ORM\Column(name="model", type="string", length=64, nullable=true)
*/
private ?string $model;
#[ORM\Column(name: 'model', type: 'string', length: 64, nullable: true)]
private readonly ?string $model;
/**
* @var string
*
* @ORM\Column(name="min_f_stop", type="string", length=10, nullable=true)
*/
private ?string $minFStop;
#[ORM\Column(name: 'min_f_stop', type: 'string', length: 10, nullable: true)]
private readonly ?string $minFStop;
/**
* @var float
*
* @ORM\Column(name="max_f_stop", type="float", precision=10, scale=0, nullable=true)
*/
private ?float $maxFStop;
#[ORM\Column(name: 'max_f_stop', type: 'float', precision: 10, scale: 0, nullable: true)]
private readonly ?float $maxFStop;
/**
* @var integer
*
* @ORM\Column(name="min_focal_length", type="integer", nullable=true)
*/
private ?int $minFocalLength;
#[ORM\Column(name: 'min_focal_length', type: 'integer', nullable: true)]
private readonly ?int $minFocalLength;
/**
* @var integer
*
* @ORM\Column(name="max_focal_length", type="integer", nullable=true)
*/
private ?int $maxFocalLength;
#[ORM\Column(name: 'max_focal_length', type: 'integer', nullable: true)]
private readonly ?int $maxFocalLength;
/**
* @var string
*
* @ORM\Column(name="serial", type="string", length=10, nullable=true)
*/
private ?string $serial;
#[ORM\Column(name: 'serial', type: 'string', length: 10, nullable: true)]
private readonly ?string $serial;
/**
* @var string
*
* @ORM\Column(name="purchase_price", type="money", nullable=true)
*/
private ?string $purchasePrice;
#[ORM\Column(name: 'purchase_price', type: 'money', nullable: true)]
private readonly ?string $purchasePrice;
/**
* @var string
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private ?string $notes;
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]
private readonly ?string $notes;
/**
* @var string
*
* @ORM\Column(name="image_size", type="string", nullable=false, options={"default"="35mm"})
*/
#[ORM\Column(name: 'image_size', type: 'string', nullable: false, options: ['default' => '35mm'])]
private string $imageSize = '35mm';
/**
* @var string
*
* @ORM\Column(name="mount", type="string", length=40, nullable=true)
*/
private ?string $mount;
#[ORM\Column(name: 'mount', type: 'string', length: 40, nullable: true)]
private readonly ?string $mount;
/**
* @var string
*
* @ORM\Column(name="front_filter_size", type="decimal", precision=10, scale=0, nullable=true)
*/
private ?string $frontFilterSize;
#[ORM\Column(name: 'front_filter_size', type: 'decimal', precision: 10, scale: 0, nullable: true)]
private readonly ?string $frontFilterSize;
/**
* @var string
*
* @ORM\Column(name="rear_filter_size", type="decimal", precision=10, scale=0, nullable=true)
*/
private? string $rearFilterSize;
#[ORM\Column(name: 'rear_filter_size', type: 'decimal', precision: 10, scale: 0, nullable: true)]
private readonly ? string $rearFilterSize;
/**
* @var boolean
*
* @ORM\Column(name="is_teleconverter", type="boolean", nullable=false)
*/
#[ORM\Column(name: 'is_teleconverter', type: 'boolean', nullable: false)]
private bool $isTeleconverter = false;
/**
* @var integer
*
* @ORM\Column(name="design_elements", type="smallint", nullable=true)
*/
private ?int $designElements;
#[ORM\Column(name: 'design_elements', type: 'smallint', nullable: true)]
private readonly ?int $designElements;
/**
* @var integer
*
* @ORM\Column(name="design_groups", type="smallint", nullable=true)
*/
private ?int $designGroups;
#[ORM\Column(name: 'design_groups', type: 'smallint', nullable: true)]
private readonly ?int $designGroups;
/**
* @var integer
*
* @ORM\Column(name="aperture_blades", type="smallint", nullable=true)
*/
private ?int $apertureBlades;
#[ORM\Column(name: 'aperture_blades', type: 'smallint', nullable: true)]
private readonly ?int $apertureBlades;
/**
* Get id
*
* @return integer
*/
public function getId(): int
{
@ -154,8 +135,6 @@ trait LensTrait
* Set brand
*
* @param string $brand
*
* @return self
*/
public function setBrand($brand): self
{
@ -178,8 +157,6 @@ trait LensTrait
* Set coatings
*
* @param string $coatings
*
* @return self
*/
public function setCoatings($coatings): self
{
@ -202,8 +179,6 @@ trait LensTrait
* Set productLine
*
* @param string $productLine
*
* @return self
*/
public function setProductLine($productLine): self
{
@ -226,8 +201,6 @@ trait LensTrait
* Set model
*
* @param string $model
*
* @return self
*/
public function setModel($model): self
{
@ -250,8 +223,6 @@ trait LensTrait
* Set minFStop
*
* @param string $minFStop
*
* @return self
*/
public function setMinFStop($minFStop): self
{
@ -274,8 +245,6 @@ trait LensTrait
* Set maxFStop
*
* @param float $maxFStop
*
* @return self
*/
public function setMaxFStop($maxFStop): self
{
@ -298,8 +267,6 @@ trait LensTrait
* Set minFocalLength
*
* @param integer $minFocalLength
*
* @return self
*/
public function setMinFocalLength($minFocalLength): self
{
@ -322,8 +289,6 @@ trait LensTrait
* Set maxFocalLength
*
* @param integer $maxFocalLength
*
* @return self
*/
public function setMaxFocalLength($maxFocalLength): self
{
@ -346,8 +311,6 @@ trait LensTrait
* Set serial
*
* @param string $serial
*
* @return self
*/
public function setSerial($serial): self
{
@ -358,8 +321,6 @@ trait LensTrait
/**
* Get serial
*
* @return string
*/
public function getSerial(): string
{
@ -370,8 +331,6 @@ trait LensTrait
* Set notes
*
* @param string $notes
*
* @return self
*/
public function setNotes(?string $notes): self
{
@ -382,8 +341,6 @@ trait LensTrait
/**
* Get notes
*
* @return string
*/
public function getNotes(): string
{
@ -392,8 +349,6 @@ trait LensTrait
/**
* Get image size
*
* @return string
*/
public function getImageSize(): string
{
@ -402,9 +357,6 @@ trait LensTrait
/**
* Set image size
*
* @param string $imageSize
* @return self
*/
public function setImageSize(string $imageSize): self
{
@ -416,8 +368,6 @@ trait LensTrait
* Set mount
*
* @param string $mount
*
* @return self
*/
public function setMount($mount): self
{
@ -440,8 +390,6 @@ trait LensTrait
* Set received
*
* @param boolean $received
*
* @return self
*/
public function setReceived($received): self
{
@ -464,8 +412,6 @@ trait LensTrait
* Set formerlyOwned
*
* @param boolean $formerlyOwned
*
* @return self
*/
public function setFormerlyOwned($formerlyOwned): self
{
@ -488,8 +434,6 @@ trait LensTrait
* Set frontFilterSize
*
* @param string $frontFilterSize
*
* @return self
*/
public function setFrontFilterSize($frontFilterSize): self
{
@ -512,8 +456,6 @@ trait LensTrait
* Set rearFilterSize
*
* @param string $rearFilterSize
*
* @return self
*/
public function setRearFilterSize($rearFilterSize): self
{
@ -536,8 +478,6 @@ trait LensTrait
* Set isTeleconverter
*
* @param boolean $isTeleconverter
*
* @return self
*/
public function setIsTeleconverter($isTeleconverter): self
{
@ -560,8 +500,6 @@ trait LensTrait
* Set designElements
*
* @param integer $designElements
*
* @return self
*/
public function setDesignElements($designElements): self
{
@ -584,8 +522,6 @@ trait LensTrait
* Set designGroups
*
* @param integer $designGroups
*
* @return self
*/
public function setDesignGroups($designGroups): self
{
@ -608,8 +544,6 @@ trait LensTrait
* Set apertureBlades
*
* @param integer $apertureBlades
*
* @return self
*/
public function setApertureBlades($apertureBlades): self
{

View File

@ -2,32 +2,24 @@
namespace App\Entity;
use App\Repository\LensesRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* Camera.lenses
*/
#[ORM\Table(name: 'lenses', schema: 'camera')]
#[ORM\Entity(repositoryClass: 'App\Repository\LensesRepository')]
#[ORM\Entity(repositoryClass: LensesRepository::class)]
class Lenses
{
use LensTrait;
/**
* @var integer
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
#[ORM\SequenceGenerator(sequenceName: 'camera.lenses_id_seq', allocationSize: 1, initialValue: 1)]
private $id;
/**
* @var boolean
*/
private int $id;
#[ORM\Column(name: 'received', type: 'boolean', nullable: false)]
private $received = false;
/**
* @var boolean
*/
private bool $received = false;
#[ORM\Column(name: 'formerly_owned', type: 'boolean', nullable: false)]
private $formerlyOwned = false;
private bool $formerlyOwned = false;
}

View File

@ -2,6 +2,7 @@
namespace App\Entity;
use App\Repository\CameraRepository;
use Doctrine\ORM\Mapping as ORM;
/**
@ -9,16 +10,13 @@ use Doctrine\ORM\Mapping as ORM;
*/
#[ORM\Table(name: 'previously_owned_camera', schema: 'camera')]
#[ORM\Index(name: 'IDX_6EF94C6BC54C8C93', columns: ['type_id'])]
#[ORM\Entity(repositoryClass: 'App\Repository\CameraRepository')]
#[ORM\Entity(repositoryClass: CameraRepository::class)]
class PreviouslyOwnedCamera
{
use CameraTrait;
/**
* @var integer
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
#[ORM\SequenceGenerator(sequenceName: 'prevously_owned_camera_id_seq', allocationSize: 1, initialValue: 1)]
private $id;
private int $id;
}

View File

@ -2,23 +2,21 @@
namespace App\Entity;
use App\Repository\LensesRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* Camera.previouslyOwnedLenses
*/
#[ORM\Table(name: 'previously_owned_lenses', schema: 'camera')]
#[ORM\Entity(repositoryClass: 'App\Repository\LensesRepository')]
#[ORM\Entity(repositoryClass: LensesRepository::class)]
class PreviouslyOwnedLenses
{
use LensTrait;
/**
* @var integer
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
private int $id;
/**
* @var boolean
*/

View File

@ -8,8 +8,6 @@ trait PurchasePriceTrait
* Set purchasePrice
*
* @param string $purchasePrice
*
* @return self
*/
public function setPurchasePrice($purchasePrice): self
{

View File

@ -36,7 +36,7 @@ trait AcquireTrait {
$em->remove($currentRecord);
$em->flush();
}
catch (Throwable $e)
catch (Throwable)
{
dump($newRecord);
}

View File

@ -2,8 +2,9 @@
namespace App\ValueObject;
class Money {
private float $value;
use Stringable;
class Money implements Stringable {
private readonly float $value;
public function __construct($value)
{