for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Class DMSRequestItem wrapper which represents a DocumentCartItem
*/
class DMSRequestItem extends ViewableData
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
* The number of copies required of @itemID
*
* @var int
private $quantity;
* The linked {@link DMSDocument} which was added to the cart.
* @var DMSDocument
private $document;
* If a document is provided on construction, set it to this item instance
* @param DMSDocument $document
$document
DMSDocument|null
This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.
@param
It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.
public function __construct($document = null)
if ($document instanceof DMSDocument) {
$this->setDocument($document);
}
parent::__construct();
* Returns the ID of the $this->document
* @return int
public function getItemId()
return $this->document->ID;
* Returns the linked item Quantity
public function getQuantity()
return $this->quantity;
* Sets the quantity of documents to be ordered.
* @param int $quantity
* @return DMSRequestItem
public function setQuantity($quantity)
$this->quantity = (int) $quantity;
return $this;
* Returns the linked DMSDocument
* @return DMSDocument
This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.
@return
public function getDocument()
if ($this->document) {
return DMSDocument::get()->byID($this->document->ID);
public function setDocument($document)
$this->document = $document;
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.