Fixed coding style.

This commit is contained in:
Jan Böhmer 2020-03-15 13:56:31 +01:00
parent 24939f2342
commit fd61c8d9e2
129 changed files with 962 additions and 1091 deletions

View file

@ -173,7 +173,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
/**
* Set the addres.
*
* @param string $new_address the new address (with "\n" as line break)
* @param string $new_address the new address (with "\n" as line break)
*
* @return $this
*/
@ -188,6 +188,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
* Set the phone number.
*
* @param string $new_phone_number the new phone number
*
* @return $this
*/
public function setPhoneNumber(string $new_phone_number): self
@ -201,6 +202,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
* Set the fax number.
*
* @param string $new_fax_number the new fax number
*
* @return $this
*/
public function setFaxNumber(string $new_fax_number): self
@ -214,6 +216,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
* Set the e-mail address.
*
* @param string $new_email_address the new e-mail address
*
* @return $this
*/
public function setEmailAddress(string $new_email_address): self
@ -227,6 +230,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
* Set the website.
*
* @param string $new_website the new website
*
* @return $this
*/
public function setWebsite(string $new_website): self
@ -240,6 +244,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
* Set the link to the website of an article.
*
* @param string $new_url the new URL with the placeholder %PARTNUMBER% for the part number
*
* @return $this
*/
public function setAutoProductUrl(string $new_url): self

View file

@ -57,6 +57,15 @@ abstract class AbstractNamedDBElement extends AbstractDBElement implements Named
return $this->getName();
}
public function __clone()
{
if ($this->id) {
//We create a new object, so give it a new creation date
$this->addedDate = null;
}
parent::__clone(); // TODO: Change the autogenerated stub
}
/********************************************************************************
*
* Getters
@ -89,15 +98,7 @@ abstract class AbstractNamedDBElement extends AbstractDBElement implements Named
public function setName(string $new_name): self
{
$this->name = $new_name;
return $this;
}
public function __clone()
{
if ($this->id) {
//We create a new object, so give it a new creation date
$this->addedDate = null;
}
parent::__clone(); // TODO: Change the autogenerated stub
}
}

View file

@ -115,7 +115,7 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
* Check if this element is a child of another element (recursive).
*
* @param AbstractStructuralDBElement $another_element the object to compare
* IMPORTANT: both objects to compare must be from the same class (for example two "Device" objects)!
* IMPORTANT: both objects to compare must be from the same class (for example two "Device" objects)!
*
* @return bool True, if this element is child of $another_element.
*
@ -316,13 +316,14 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
}
/**
* @param static[]|Collection $elements
* @param static[]|Collection $elements
*
* @return $this
*/
public function setChildren($elements): self
{
if (!is_array($elements) && !$elements instanceof Collection) {
throw new InvalidArgumentException('$elements must be an array or Collection!');
if (! is_array($elements) && ! $elements instanceof Collection) {
throw new InvalidArgumentException('$elements must be an array or Collection!');
}
$this->children = $elements;
@ -331,7 +332,6 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
}
/**
* @param bool $not_selectable
* @return AbstractStructuralDBElement
*/
public function setNotSelectable(bool $not_selectable): self

View file

@ -72,7 +72,6 @@ trait MasterAttachmentTrait
/**
* Sets the new master picture for this part.
*
* @param Attachment|null $new_master_attachment
* @return $this
*/
public function setMasterPictureAttachment(?Attachment $new_master_attachment): self