mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Fixed PHPstan warnings.
This commit is contained in:
parent
4a90f2ac35
commit
15a31433e1
9 changed files with 9 additions and 12 deletions
|
@ -7,4 +7,5 @@ parameters:
|
||||||
|
|
||||||
excludes_analyse:
|
excludes_analyse:
|
||||||
- src/DataTables/Adapter/*
|
- src/DataTables/Adapter/*
|
||||||
- src/Configuration/*
|
- src/Configuration/*
|
||||||
|
- src/Doctrine/Purger/*
|
|
@ -178,10 +178,6 @@ abstract class Attachment extends AbstractNamedDBElement
|
||||||
//After the %PLACEHOLDER% comes a slash, so we can check if we have a placeholder via explode
|
//After the %PLACEHOLDER% comes a slash, so we can check if we have a placeholder via explode
|
||||||
$tmp = explode('/', $this->path);
|
$tmp = explode('/', $this->path);
|
||||||
|
|
||||||
if (empty($tmp)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return !in_array($tmp[0], array_merge(static::INTERNAL_PLACEHOLDER, static::BUILTIN_PLACEHOLDER), false);
|
return !in_array($tmp[0], array_merge(static::INTERNAL_PLACEHOLDER, static::BUILTIN_PLACEHOLDER), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,10 +192,6 @@ abstract class Attachment extends AbstractNamedDBElement
|
||||||
//After the %PLACEHOLDER% comes a slash, so we can check if we have a placeholder via explode
|
//After the %PLACEHOLDER% comes a slash, so we can check if we have a placeholder via explode
|
||||||
$tmp = explode('/', $this->path);
|
$tmp = explode('/', $this->path);
|
||||||
|
|
||||||
if (empty($tmp)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return '%SECURE%' === $tmp[0];
|
return '%SECURE%' === $tmp[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,9 +429,6 @@ abstract class Attachment extends AbstractNamedDBElement
|
||||||
//After the %PLACEHOLDER% comes a slash, so we can check if we have a placeholder via explode
|
//After the %PLACEHOLDER% comes a slash, so we can check if we have a placeholder via explode
|
||||||
$tmp = explode('/', $path);
|
$tmp = explode('/', $path);
|
||||||
//Builtins must have a %PLACEHOLDER% construction
|
//Builtins must have a %PLACEHOLDER% construction
|
||||||
if (empty($tmp)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return in_array($tmp[0], static::BUILTIN_PLACEHOLDER, false);
|
return in_array($tmp[0], static::BUILTIN_PLACEHOLDER, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,7 @@ class Device extends AbstractPartsContainingDBElement
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToMany(targetEntity="Device", mappedBy="parent")
|
* @ORM\OneToMany(targetEntity="Device", mappedBy="parent")
|
||||||
* @ORM\OrderBy({"name" = "ASC"})
|
* @ORM\OrderBy({"name" = "ASC"})
|
||||||
|
* @var Collection
|
||||||
*/
|
*/
|
||||||
protected $children;
|
protected $children;
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ class Category extends AbstractPartsContainingDBElement
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToMany(targetEntity="Category", mappedBy="parent")
|
* @ORM\OneToMany(targetEntity="Category", mappedBy="parent")
|
||||||
* @ORM\OrderBy({"name" = "ASC"})
|
* @ORM\OrderBy({"name" = "ASC"})
|
||||||
|
* @var Collection
|
||||||
*/
|
*/
|
||||||
protected $children;
|
protected $children;
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,7 @@ class Footprint extends AbstractPartsContainingDBElement
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToMany(targetEntity="Footprint", mappedBy="parent")
|
* @ORM\OneToMany(targetEntity="Footprint", mappedBy="parent")
|
||||||
* @ORM\OrderBy({"name" = "ASC"})
|
* @ORM\OrderBy({"name" = "ASC"})
|
||||||
|
* @var Collection
|
||||||
*/
|
*/
|
||||||
protected $children;
|
protected $children;
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,7 @@ class Manufacturer extends AbstractCompany
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToMany(targetEntity="Manufacturer", mappedBy="parent")
|
* @ORM\OneToMany(targetEntity="Manufacturer", mappedBy="parent")
|
||||||
* @ORM\OrderBy({"name" = "ASC"})
|
* @ORM\OrderBy({"name" = "ASC"})
|
||||||
|
* @var Collection
|
||||||
*/
|
*/
|
||||||
protected $children;
|
protected $children;
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToMany(targetEntity="MeasurementUnit", mappedBy="parent", cascade={"persist"})
|
* @ORM\OneToMany(targetEntity="MeasurementUnit", mappedBy="parent", cascade={"persist"})
|
||||||
* @ORM\OrderBy({"name" = "ASC"})
|
* @ORM\OrderBy({"name" = "ASC"})
|
||||||
|
* @var Collection
|
||||||
*/
|
*/
|
||||||
protected $children;
|
protected $children;
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,7 @@ class Storelocation extends AbstractPartsContainingDBElement
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToMany(targetEntity="Storelocation", mappedBy="parent")
|
* @ORM\OneToMany(targetEntity="Storelocation", mappedBy="parent")
|
||||||
* @ORM\OrderBy({"name" = "ASC"})
|
* @ORM\OrderBy({"name" = "ASC"})
|
||||||
|
* @var Collection
|
||||||
*/
|
*/
|
||||||
protected $children;
|
protected $children;
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
|
||||||
/**
|
/**
|
||||||
* @ORM\OneToMany(targetEntity="Group", mappedBy="parent")
|
* @ORM\OneToMany(targetEntity="Group", mappedBy="parent")
|
||||||
* @ORM\OrderBy({"name" = "ASC"})
|
* @ORM\OrderBy({"name" = "ASC"})
|
||||||
|
* @var Collection
|
||||||
*/
|
*/
|
||||||
protected $children;
|
protected $children;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue