mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-14 20:35:08 +02:00
Improved typing and phpdoc type annotations
This commit is contained in:
parent
3817ba774d
commit
b7c8ca2a48
39 changed files with 189 additions and 129 deletions
|
@ -144,7 +144,7 @@ class Part extends AttachmentContainingDBElement
|
|||
}
|
||||
|
||||
#[Assert\Callback]
|
||||
public function validate(ExecutionContextInterface $context, $payload)
|
||||
public function validate(ExecutionContextInterface $context, $payload): void
|
||||
{
|
||||
//Ensure that the part name fullfills the regex of the category
|
||||
if ($this->category instanceof Category) {
|
||||
|
|
|
@ -322,7 +322,7 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
|
|||
}
|
||||
|
||||
#[Assert\Callback]
|
||||
public function validate(ExecutionContextInterface $context, $payload)
|
||||
public function validate(ExecutionContextInterface $context, $payload): void
|
||||
{
|
||||
//Ensure that the owner is not the anonymous user
|
||||
if ($this->getOwner() && $this->getOwner()->isAnonymousUser()) {
|
||||
|
|
|
@ -63,8 +63,7 @@ trait InstockTrait
|
|||
|
||||
/**
|
||||
* Get all part lots where this part is stored.
|
||||
*
|
||||
* @return PartLot[]|Collection
|
||||
* @phpstan-return Collection<int, PartLot>
|
||||
*/
|
||||
public function getPartLots(): Collection
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
trait OrderTrait
|
||||
{
|
||||
/**
|
||||
* @var Orderdetail[]|Collection the details about how and where you can order this part
|
||||
* @var Collection<int, Orderdetail> the details about how and where you can order this part
|
||||
*/
|
||||
#[Assert\Valid]
|
||||
#[Groups(['extended', 'full', 'import'])]
|
||||
|
@ -66,7 +66,7 @@ trait OrderTrait
|
|||
/**
|
||||
* Get the selected order orderdetails of this part.
|
||||
*
|
||||
* @return Orderdetail the selected order orderdetails
|
||||
* @return Orderdetail|null the selected order orderdetails
|
||||
*/
|
||||
public function getOrderOrderdetails(): ?Orderdetail
|
||||
{
|
||||
|
|
|
@ -29,8 +29,9 @@ trait ProjectTrait
|
|||
protected ?Project $built_project = null;
|
||||
|
||||
/**
|
||||
* Returns all ProjectBOMEntries that use this part.
|
||||
* @return Collection<int, ProjectBOMEntry>|ProjectBOMEntry[]
|
||||
* Returns all ProjectBOMEntries that use this part.
|
||||
*
|
||||
* @phpstan-return Collection<int, ProjectBOMEntry>
|
||||
*/
|
||||
public function getProjectBomEntries(): Collection
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue