Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Resolved merge conflict in Zend\GData\AuthSub
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 31 deletions.
7 changes: 1 addition & 6 deletions src/Renderer/AbstractRenderer.php
Expand Up @@ -317,13 +317,8 @@ public function getAutomaticRenderError()
* @param Object\ObjectInterface $barcode
* @return AbstractRenderer
*/
public function setBarcode($barcode)
public function setBarcode(Object\ObjectInterface $barcode)
{
if (!$barcode instanceof Object\ObjectInterface) {
throw new Exception\InvalidArgumentException(
'Invalid barcode object provided to setBarcode()'
);
}
$this->barcode = $barcode;
return $this;
}
Expand Down
8 changes: 5 additions & 3 deletions src/Renderer/RendererInterface.php
Expand Up @@ -21,6 +21,8 @@

namespace Zend\Barcode\Renderer;

use Zend\Barcode\Object\ObjectInterface;

/**
* Class for rendering the barcode
*
Expand Down Expand Up @@ -146,14 +148,14 @@ public function getAutomaticRenderError();

/**
* Set the barcode object
* @param Object\ObjectInterface $barcode
* @param ObjectInterface $barcode
* @return Renderer
*/
public function setBarcode($barcode);
public function setBarcode(ObjectInterface $barcode);

/**
* Retrieve the barcode object
* @return Object\ObjectInterface
* @return ObjectInterface
*/
public function getBarcode();

Expand Down
10 changes: 2 additions & 8 deletions src/Renderer/Svg.php
Expand Up @@ -116,17 +116,11 @@ public function getWidth()
/**
* Set an image resource to draw the barcode inside
*
* @param DOMDocument $value
* @param DOMDocument $svg
* @return Svg
* @throw Exception
*/
public function setResource($svg)
public function setResource(DOMDocument $svg)
{
if (!$svg instanceof DOMDocument) {
throw new Exception\InvalidArgumentException(
'Invalid DOMDocument resource provided to setResource()'
);
}
$this->resource = $svg;
return $this;
}
Expand Down
7 changes: 0 additions & 7 deletions test/Renderer/SvgTest.php
Expand Up @@ -81,13 +81,6 @@ public function testGoodSvgResource()
$this->renderer->setResource($svgResource, 10);
}

public function testObjectSvgResource()
{
$this->setExpectedException('Zend\Barcode\Renderer\Exception\ExceptionInterface');
$svgResource = new \StdClass();
$this->renderer->setResource($svgResource);
}

public function testDrawReturnResource()
{
Barcode\Barcode::setBarcodeFont(__DIR__ . '/../Object/_fonts/Vera.ttf');
Expand Down
7 changes: 0 additions & 7 deletions test/Renderer/TestCommon.php
Expand Up @@ -74,13 +74,6 @@ public function testSetBarcodeObject()
$this->assertSame($barcode, $this->renderer->getBarcode());
}

public function testSetInvalidBarcodeObject()
{
$this->setExpectedException('\Zend\Barcode\Renderer\Exception\ExceptionInterface');
$barcode = new \StdClass();
$this->renderer->setBarcode($barcode);
}

public function testGoodModuleSize()
{
$this->renderer->setModuleSize(2.34);
Expand Down

0 comments on commit d07707d

Please sign in to comment.