Skip to content

Commit

Permalink
Parameters should be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jordikroon committed Aug 20, 2018
1 parent 513c51d commit 52e20af
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
18 changes: 9 additions & 9 deletions src/Annotation/Paragraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
class Paragraph
{
/**
* @var TextProperty
* @var TextProperty|null
*/
protected $property;
protected $property = null;

/**
* @var BoundingPoly
* @var BoundingPoly|null
*/
protected $boundingBox;
protected $boundingBox = null;

/**
* @var Word[]
Expand All @@ -24,39 +24,39 @@ class Paragraph
* @param BoundingPoly $boundingBox
* @param Word[] $words
*/
public function __construct(TextProperty $property, BoundingPoly $boundingBox, array $words)
public function __construct(TextProperty $property = null, BoundingPoly $boundingBox = null, array $words = [])
{
$this->property = $property;
$this->boundingBox = $boundingBox;
$this->words = $words;
}

/**
* @return TextProperty
* @return TextProperty|null
*/
public function getProperty()
{
return $this->property;
}

/**
* @param TextProperty $property
* @param TextProperty|null $property
*/
public function setProperty($property)
{
$this->property = $property;
}

/**
* @return BoundingPoly
* @return BoundingPoly|null
*/
public function getBoundingBox()
{
return $this->boundingBox;
}

/**
* @param BoundingPoly $boundingBox
* @param BoundingPoly|null $boundingBox
*/
public function setBoundingBox($boundingBox)
{
Expand Down
24 changes: 12 additions & 12 deletions src/Annotation/Symbol.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,74 @@
class Symbol
{
/**
* @var TextProperty
* @var TextProperty|null
*/
protected $property;

/**
* @var BoundingPoly
* @var BoundingPoly|null
*/
protected $boundingBox;

/**
* @var string
* @var string|null
*/
protected $text;

/**
* @param TextProperty $property
* @param BoundingPoly $boundingBox
* @param TextProperty|null $property
* @param BoundingPoly|null $boundingBox
* @param string $text
*/
public function __construct(TextProperty $property, BoundingPoly $boundingBox, $text)
public function __construct(TextProperty $property = null, BoundingPoly $boundingBox = null, $text = null)
{
$this->property = $property;
$this->boundingBox = $boundingBox;
$this->text = $text;
}

/**
* @return TextProperty
* @return TextProperty|null
*/
public function getProperty()
{
return $this->property;
}

/**
* @param TextProperty $property
* @param TextProperty|null $property
*/
public function setProperty($property)
{
$this->property = $property;
}

/**
* @return BoundingPoly
* @return BoundingPoly|null
*/
public function getBoundingBox()
{
return $this->boundingBox;
}

/**
* @param BoundingPoly $boundingBox
* @param BoundingPoly|null $boundingBox
*/
public function setBoundingBox($boundingBox)
{
$this->boundingBox = $boundingBox;
}

/**
* @return string
* @return string|null
*/
public function getText()
{
return $this->text;
}

/**
* @param string $text
* @param string|null $text
*/
public function setText($text)
{
Expand Down

0 comments on commit 52e20af

Please sign in to comment.