-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c7e4b2
commit 6314169
Showing
10 changed files
with
133 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Intervention\Image\Geometry\Factories; | ||
|
||
class Drawable | ||
{ | ||
/** | ||
* Create circle factory statically | ||
* | ||
* @return CircleFactory | ||
*/ | ||
public static function circle(): CircleFactory | ||
{ | ||
return new CircleFactory(); | ||
} | ||
|
||
/** | ||
* Create ellipse factory statically | ||
* | ||
* @return EllipseFactory | ||
*/ | ||
public static function ellipse(): EllipseFactory | ||
{ | ||
return new EllipseFactory(); | ||
} | ||
|
||
/** | ||
* Create line factory statically | ||
* | ||
* @return LineFactory | ||
*/ | ||
public static function line(): LineFactory | ||
{ | ||
return new LineFactory(); | ||
} | ||
|
||
/** | ||
* Create polygon factory statically | ||
* | ||
* @return PolygonFactory | ||
*/ | ||
public static function polygon(): PolygonFactory | ||
{ | ||
return new PolygonFactory(); | ||
} | ||
|
||
/** | ||
* Create rectangle factory statically | ||
* | ||
* @return RectangleFactory | ||
*/ | ||
public static function rectangle(): RectangleFactory | ||
{ | ||
return new RectangleFactory(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Intervention\Image\Tests\Unit\Geometry\Factories; | ||
|
||
use Intervention\Image\Geometry\Factories\CircleFactory; | ||
use Intervention\Image\Geometry\Factories\Drawable; | ||
use Intervention\Image\Geometry\Factories\EllipseFactory; | ||
use Intervention\Image\Geometry\Factories\LineFactory; | ||
use Intervention\Image\Geometry\Factories\PolygonFactory; | ||
use Intervention\Image\Geometry\Factories\RectangleFactory; | ||
use Intervention\Image\Tests\BaseTestCase; | ||
|
||
final class DrawableTest extends BaseTestCase | ||
{ | ||
public function testCircle(): void | ||
{ | ||
$this->assertInstanceOf(CircleFactory::class, Drawable::circle()); | ||
} | ||
|
||
public function testEllipse(): void | ||
{ | ||
$this->assertInstanceOf(EllipseFactory::class, Drawable::ellipse()); | ||
} | ||
|
||
public function testLine(): void | ||
{ | ||
$this->assertInstanceOf(LineFactory::class, Drawable::line()); | ||
} | ||
|
||
public function testPolygon(): void | ||
{ | ||
$this->assertInstanceOf(PolygonFactory::class, Drawable::polygon()); | ||
} | ||
|
||
public function testRectangle(): void | ||
{ | ||
$this->assertInstanceOf(RectangleFactory::class, Drawable::rectangle()); | ||
} | ||
} |