Skip to content

Commit

Permalink
no Stringable in php7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
skoro committed Oct 28, 2022
1 parent 5dbaba5 commit f19a74c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Tkui;

use Stringable;

/**
* Contract for graphic images.
*
* TODO: extends Stringable
*/
interface Image extends Stringable
interface Image
{
public function width(): int;

Expand Down
5 changes: 4 additions & 1 deletion tests/Widgets/TextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Tkui\Widgets\Text\Text;
use Tkui\Widgets\Text\TextIndex;
use PHPUnit\Framework\MockObject\MockObject;
use Tkui\TclTk\TkImage;

class TextTest extends TestCase
{
Expand Down Expand Up @@ -174,7 +175,9 @@ public function insert_embedded_image_into_specified_position()
]);

/** @var Image|MockObject */
$image = $this->createMock(Image::class);
// FIXME: Since Image doesn't have Stringable TkImage is used here, after switching
// to PHP8 it must be changed to Image interface instead of TkImage.
$image = $this->createMock(TkImage::class);
$image->expects($this->once())
->method('__toString')
->willReturn('i0')
Expand Down

0 comments on commit f19a74c

Please sign in to comment.