Fixed typos

This commit is contained in:
Jan Böhmer 2023-04-15 23:14:53 +02:00
parent 63df16a369
commit d04d743520
144 changed files with 263 additions and 265 deletions

View file

@ -59,7 +59,7 @@ abstract class Attachment extends AbstractNamedDBElement
/**
* A list of file extensions, that browsers can show directly as image.
* Based on: https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types
* It will be used to determine if a attachment is a picture and therefore will be shown to user as preview.
* It will be used to determine if an attachment is a picture and therefore will be shown to user as preview.
*/
public const PICTURE_EXTS = ['apng', 'bmp', 'gif', 'ico', 'cur', 'jpg', 'jpeg', 'jfif', 'pjpeg', 'pjp', 'png',
'svg', 'webp', ];
@ -70,7 +70,7 @@ abstract class Attachment extends AbstractNamedDBElement
public const MODEL_EXTS = ['x3d'];
/**
* When the path begins with one of this placeholders.
* When the path begins with one of the placeholders.
*/
public const INTERNAL_PLACEHOLDER = ['%BASE%', '%MEDIA%', '%SECURE%'];
@ -105,7 +105,7 @@ abstract class Attachment extends AbstractNamedDBElement
protected string $name = '';
/**
* ORM mapping is done in sub classes (like PartAttachment).
* ORM mapping is done in subclasses (like PartAttachment).
*/
protected ?AttachmentContainingDBElement $element = null;
@ -153,7 +153,7 @@ abstract class Attachment extends AbstractNamedDBElement
*/
public function isPicture(): bool
{
//We can not check if a external link is a picture, so just assume this is false
//We can not check if an external link is a picture, so just assume this is false
if ($this->isExternal()) {
return true;
}
@ -215,7 +215,7 @@ abstract class Attachment extends AbstractNamedDBElement
* Checks if the attachment file is using a builtin file. (see BUILTIN_PLACEHOLDERS const for possible placeholders)
* If a file is built in, the path is shown to user in url field (no sensitive infos are provided).
*
* @return bool true if the attachment is using an builtin file
* @return bool true if the attachment is using a builtin file
*/
public function isBuiltIn(): bool
{
@ -259,7 +259,7 @@ abstract class Attachment extends AbstractNamedDBElement
}
/**
* The URL to the external file, or the path to the built in file.
* The URL to the external file, or the path to the built-in file.
* Returns null, if the file is not external (and not builtin).
*/
public function getURL(): ?string
@ -455,9 +455,9 @@ abstract class Attachment extends AbstractNamedDBElement
* @param string $string The string which should be checked
* @param bool $path_required If true, the string must contain a path to be valid. (e.g. foo.bar would be invalid, foo.bar/test.php would be valid).
* @param bool $only_http Set this to true, if only HTTPS or HTTP schemata should be allowed.
* *Caution: When this is set to false, a attacker could use the file:// schema, to get internal server files, like /etc/passwd.*
* *Caution: When this is set to false, an attacker could use the file:// schema, to get internal server files, like /etc/passwd.*
*
* @return bool True if the string is a valid URL. False, if the string is not an URL or invalid.
* @return bool True if the string is a valid URL. False, if the string is not a URL or invalid.
*/
public static function isValidURL(string $string, bool $path_required = true, bool $only_http = true): bool
{

View file

@ -99,7 +99,7 @@ class AttachmentType extends AbstractStructuralDBElement
}
/**
* Gets an filter, which file types are allowed for attachment files.
* Gets a filter, which file types are allowed for attachment files.
* Must be in the format of <input type=file> accept attribute
* (See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers).
*/

View file

@ -27,7 +27,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* A attachment attached to a category element.
* An attachment attached to a category element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})

View file

@ -27,7 +27,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* A attachment attached to a footprint element.
* An attachment attached to a footprint element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})

View file

@ -27,7 +27,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* A attachment attached to a Group element.
* An attachment attached to a Group element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})

View file

@ -27,7 +27,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* A attachment attached to a manufacturer element.
* An attachment attached to a manufacturer element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})

View file

@ -28,7 +28,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* A attachment attached to a measurement unit element.
* An attachment attached to a measurement unit element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})

View file

@ -27,7 +27,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* A attachment attached to a measurement unit element.
* An attachment attached to a measurement unit element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})

View file

@ -27,7 +27,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* A attachment attached to a user element.
* An attachment attached to a user element.
*
* @ORM\Entity()
* @UniqueEntity({"name", "attachment_type", "element"})

View file

@ -81,7 +81,7 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
protected int $level = 0;
/**
* We can not define the mapping here or we will get an exception. Unfortunately we have to do the mapping in the
* We can not define the mapping here, or we will get an exception. Unfortunately we have to do the mapping in the
* subclasses.
*
* @var AbstractStructuralDBElement[]|Collection
@ -96,7 +96,7 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
*/
protected ?AbstractStructuralDBElement $parent = null;
/** @var string[] all names of all parent elements as a array of strings,
/** @var string[] all names of all parent elements as an array of strings,
* the last array element is the name of the element itself
*/
private array $full_path_strings = [];
@ -167,7 +167,7 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
/**
* Checks if this element is an root element (has no parent).
*
* @return bool true if the this element is an root element
* @return bool true if this element is a root element
*/
public function isRoot(): bool
{

View file

@ -27,7 +27,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* A entity with this class has a master attachment, which is used as a preview image for this object.
* An entity with this class has a master attachment, which is used as a preview image for this object.
*/
trait MasterAttachmentTrait
{

View file

@ -27,9 +27,9 @@ use DateTime;
interface TimeTravelInterface
{
/**
* Checks if this entry has informations which data has changed.
* Checks if this entry has information which data has changed.
*
* @return bool true if this entry has informations about the changed data
* @return bool true if this entry has information about the changed data
*/
public function hasOldDataInformations(): bool;
@ -39,7 +39,7 @@ interface TimeTravelInterface
public function getOldData(): array;
/**
* Returns the the timestamp associated with this change.
* Returns the timestamp associated with this change.
*/
public function getTimestamp(): DateTime;
}

View file

@ -48,7 +48,7 @@ use InvalidArgumentException;
use Psr\Log\LogLevel;
/**
* This entity describes a entry in the event log.
* This entity describes an entry in the event log.
*
* @ORM\Entity(repositoryClass="App\Repository\LogEntryRepository")
* @ORM\Table("log", indexes={
@ -340,7 +340,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
/**
* Returns the class name of the target element associated with this log entry.
* Returns null, if this log entry is not associated with an log entry.
* Returns null, if this log entry is not associated with a log entry.
*
* @return string|null the class name of the target class
*/
@ -355,7 +355,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
/**
* Returns the ID of the target element associated with this log entry.
* Returns null, if this log entry is not associated with an log entry.
* Returns null, if this log entry is not associated with a log entry.
*
* @return int|null the ID of the associated element
*/
@ -451,7 +451,7 @@ abstract class AbstractLogEntry extends AbstractDBElement
}
/**
* Converts an target type id to an full qualified class name.
* Converts a target type id to a full qualified class name.
*
* @param int $type_id The target type ID
*/

View file

@ -86,7 +86,7 @@ use InvalidArgumentException;
/**
* @ORM\Entity()
* This log entry is created when an element is deleted, that is used in a collection of an other entity.
* This log entry is created when an element is deleted, that is used in a collection of another entity.
* This is needed to signal time travel, that it has to undelete the deleted entity.
*/
class CollectionElementDeleted extends AbstractLogEntry implements LogWithEventUndoInterface

View file

@ -43,7 +43,7 @@ class DatabaseUpdatedLogEntry extends AbstractLogEntry
*/
public function isSuccessful(): bool
{
//We dont save unsuccessful updates now, so just assume it to save space.
//We don't save unsuccessful updates now, so just assume it to save space.
return $this->extra['s'] ?? true;
}

View file

@ -56,7 +56,7 @@ class LegacyInstockChangedLogEntry extends AbstractLogEntry
}
/**
* Returns the price that has to be payed for the change (in the base currency).
* Returns the price that has to be paid for the change (in the base currency).
*
* @param bool $absolute Set this to true, if you want only get the absolute value of the price (without minus)
*/
@ -92,9 +92,9 @@ class LegacyInstockChangedLogEntry extends AbstractLogEntry
}
/**
* Checks if the Change was an withdrawal of parts.
* Checks if the Change was a withdrawal of parts.
*
* @return bool true if the change was an withdrawal, false if not
* @return bool true if the change was a withdrawal, false if not
*/
public function isWithdrawal(): bool
{

View file

@ -117,7 +117,7 @@ class SecurityEventLogEntry extends AbstractLogEntry
}
/**
* Return the (anonymized) IP address used to login the user.
* Return the (anonymized) IP address used to log in the user.
*/
public function getIPAddress(): string
{
@ -125,9 +125,9 @@ class SecurityEventLogEntry extends AbstractLogEntry
}
/**
* Sets the IP address used to login the user.
* Sets the IP address used to log in the user.
*
* @param string $ip the IP address used to login the user
* @param string $ip the IP address used to log in the user
* @param bool $anonymize Anonymize the IP address (remove last block) to be GPDR compliant
*
* @return $this

View file

@ -42,7 +42,7 @@ class UserLoginLogEntry extends AbstractLogEntry
}
/**
* Return the (anonymized) IP address used to login the user.
* Return the (anonymized) IP address used to log in the user.
*/
public function getIPAddress(): string
{
@ -50,9 +50,9 @@ class UserLoginLogEntry extends AbstractLogEntry
}
/**
* Sets the IP address used to login the user.
* Sets the IP address used to log in the user.
*
* @param string $ip the IP address used to login the user
* @param string $ip the IP address used to log in the user
* @param bool $anonymize Anonymize the IP address (remove last block) to be GPDR compliant
*
* @return $this

View file

@ -40,7 +40,7 @@ class UserLogoutLogEntry extends AbstractLogEntry
}
/**
* Return the (anonymized) IP address used to login the user.
* Return the (anonymized) IP address used to log in the user.
*/
public function getIPAddress(): string
{
@ -48,9 +48,9 @@ class UserLogoutLogEntry extends AbstractLogEntry
}
/**
* Sets the IP address used to login the user.
* Sets the IP address used to log in the user.
*
* @param string $ip the IP address used to login the user
* @param string $ip the IP address used to log in the user
* @param bool $anonymize Anonymize the IP address (remove last block) to be GPDR compliant
*
* @return $this

View file

@ -139,7 +139,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
protected string $group = '';
/**
* Mapping is done in sub classes.
* Mapping is done in subclasses.
*
* @var AbstractDBElement|null the element to which this parameter belongs to
*/

View file

@ -47,7 +47,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* A attachment attached to a category element.
* An attachment attached to a category element.
*
* @ORM\Entity(repositoryClass="App\Repository\ParameterRepository")
* @UniqueEntity(fields={"name", "group", "element"})

View file

@ -46,7 +46,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
* Part class.
*
* The class properties are split over various traits in directory PartTraits.
* Otherwise this class would be too big, to be maintained.
* Otherwise, this class would be too big, to be maintained.
*
* @ORM\Entity(repositoryClass="App\Repository\PartRepository")
* @ORM\Table("`parts`", indexes={

View file

@ -130,7 +130,7 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
/**
* Check if the current part lot is expired.
* This is the case, if the expiration date is greater the the current date.
* This is the case, if the expiration date is greater the current date.
*
* @return bool|null True, if the part lot is expired. Returns null, if no expiration date was set.
*
@ -195,7 +195,7 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface, Named
}
/**
* Sets the expiration date for the part lot. Set to null, if the part lot does not expires.
* Sets the expiration date for the part lot. Set to null, if the part lot does not expire.
*
* @param DateTime|null $expiration_date
*

View file

@ -46,7 +46,7 @@ trait BasicPropertyTrait
protected string $comment = '';
/**
* @var bool Kept for compatibility (it is not used now, and I dont think it was used in old versions)
* @var bool Kept for compatibility (it is not used now, and I don't think it was used in old versions)
* @ORM\Column(type="boolean")
*/
protected bool $visible = true;
@ -136,7 +136,7 @@ trait BasicPropertyTrait
/**
* Gets the Footprint of this part (e.g. DIP8).
*
* @return Footprint|null The footprint of this part. Null if this part should no have a footprint.
* @return Footprint|null The footprint of this part. Null if this part should not have a footprint.
*/
public function getFootprint(): ?Footprint
{

View file

@ -122,7 +122,7 @@ trait InstockTrait
/**
* Get the count of parts which must be in stock at least.
* If a integer-based part unit is selected, the value will be rounded to integers.
* If an integer-based part unit is selected, the value will be rounded to integers.
*
* @return float count of parts which must be in stock at least
*/
@ -171,7 +171,7 @@ trait InstockTrait
//TODO: Find a method to do this natively in SQL, the current method could be a bit slow
$sum = 0;
foreach ($this->getPartLots() as $lot) {
//Dont use the instock value, if it is unkown
//Don't use the in stock value, if it is unknown
if ($lot->isInstockUnknown() || $lot->isExpired() ?? false) {
continue;
}

View file

@ -41,7 +41,7 @@ trait ProjectTrait
}
/**
* Returns the project that this part represents the builds of, or null if it doesnt
* Returns the project that this part represents the builds of, or null if it doesn't
* @return Project|null
*/
public function getBuiltProject(): ?Project

View file

@ -266,9 +266,9 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
*
* @param BigDecimal $new_price the new price as a float number
*
* * This is the price for "price_related_quantity" parts!!
* * Example: if "price_related_quantity" is '10',
* you have to set here the price for 10 parts!
* This is the price for "price_related_quantity" parts!!
* Example: if "price_related_quantity" is 10,
* you have to set here the price for 10 parts!
*
* @return $this
*/

View file

@ -34,7 +34,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
/**
* This entity represents an user group.
* This entity represents a user group.
*
* @ORM\Entity()
* @ORM\Table("`groups`", indexes={
@ -64,7 +64,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
protected Collection $users;
/**
* @var bool If true all users associated with this group must have enabled some kind of 2 factor authentication
* @var bool If true all users associated with this group must have enabled some kind of two-factor authentication
* @ORM\Column(type="boolean", name="enforce_2fa")
* @Groups({"extended", "full", "import"})
*/

View file

@ -57,7 +57,7 @@ final class PermissionData implements \JsonSerializable
/**
* Creates a new Permission Data Instance using the given data.
* By default, a empty array is used, meaning
* By default, an empty array is used, meaning
*/
public function __construct(array $data = [])
{

View file

@ -53,7 +53,7 @@ use Jbtronics\TFAWebauthn\Model\TwoFactorInterface as WebauthnTwoFactorInterface
/**
* This entity represents a user, which can log in and have permissions.
* Also this entity is able to save some informations about the user, like the names, email-address and other info.
* Also, this entity is able to save some information about the user, like the names, email-address and other info.
*
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
* @ORM\Table("`users`", indexes={
@ -130,7 +130,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/**
* @var Group|null the group this user belongs to
* DO NOT PUT A fetch eager here! Otherwise you can not unset the group of a user! This seems to be some kind of bug in doctrine. Maybe this is fixed in future versions.
* DO NOT PUT A fetch eager here! Otherwise, you can not unset the group of a user! This seems to be some kind of bug in doctrine. Maybe this is fixed in future versions.
* @ORM\ManyToOne(targetEntity="Group", inversedBy="users")
* @ORM\JoinColumn(name="group_id", referencedColumnName="id")
* @Selectable()
@ -139,7 +139,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
protected ?Group $group = null;
/**
* @var string|null The secret used for google authenticator
* @var string|null The secret used for Google authenticator
* @ORM\Column(name="google_authenticator_secret", type="string", nullable=true)
*/
protected ?string $googleAuthenticatorSecret = null;
@ -409,7 +409,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
}
/**
* Checks if this user is disabled (user cannot login any more).
* Checks if this user is disabled (user cannot log in any more).
*
* @return bool true, if the user is disabled
*/
@ -516,7 +516,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
public function getFullName(bool $including_username = false): string
{
$tmp = $this->getFirstName();
//Dont add a space, if the name has only one part (it would look strange)
//Don't add a space, if the name has only one part (it would look strange)
if (!empty($this->getFirstName()) && !empty($this->getLastName())) {
$tmp .= ' ';
}
@ -683,9 +683,9 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/**
* Gets the language the user prefers (as 2 letter ISO code).
* Gets the language the user prefers (as 2-letter ISO code).
*
* @return string|null The 2 letter ISO code of the preferred language (e.g. 'en' or 'de').
* @return string|null The 2-letter ISO code of the preferred language (e.g. 'en' or 'de').
* If null is returned, the user has not specified a language and the server wide language should be used.
*/
public function getLanguage(): ?string
@ -696,8 +696,8 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/**
* Change the language the user prefers.
*
* @param string|null $language The new language as 2 letter ISO code (e.g. 'en' or 'de').
* Set to null, to use the system wide language.
* @param string|null $language The new language as 2-letter ISO code (e.g. 'en' or 'de').
* Set to null, to use the system-wide language.
*
* @return User
*/
@ -744,8 +744,8 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/**
* Change the theme the user wants to see.
*
* @param string|null $theme The name of the theme (See See self::AVAILABLE_THEMES for valid values). Set to null
* if the system wide theme should be used.
* @param string|null $theme The name of the theme (See self::AVAILABLE_THEMES for valid values). Set to null
* if the system-wide theme should be used.
*
* @return $this
*/
@ -789,7 +789,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
}
/**
* Return the user name that should be shown in Google Authenticator.
* Return the username that should be shown in Google Authenticator.
*/
public function getGoogleAuthenticatorUsername(): string
{
@ -893,7 +893,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
/**
* Invalidate all trusted device tokens at once, by incrementing the token version.
* You have to flush the changes to database afterwards.
* You have to flush the changes to database afterward.
*/
public function invalidateTrustedDeviceTokens(): void
{