Skip to content

Commit

Permalink
remove makeTwitter and makeVk methods
Browse files Browse the repository at this point in the history
  • Loading branch information
abordage committed Jun 3, 2022
1 parent ea08818 commit 0958a42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 42 deletions.
25 changes: 3 additions & 22 deletions src/OpenGraphImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,15 @@ public function make(string $text, string $preset = 'opengraph'): OpenGraphImage
case 'facebook':
default:
$this->imageHeight = 630;

break;
case 'twitter':
$this->imageHeight = 600;

break;
case 'vk':
$this->imageHeight = 536;

break;
}

Expand All @@ -268,28 +271,6 @@ public function make(string $text, string $preset = 'opengraph'): OpenGraphImage
return $this;
}

public function makeTwitter(string $text): OpenGraphImages
{
// https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image
$this->imageWidth = 1200;
$this->imageHeight = 600;

$this->createImage($text);

return $this;
}

public function makeVk(string $text): OpenGraphImages
{
// https://dev.vk.com/api/posts
$this->imageWidth = 1200;
$this->imageHeight = 536;

$this->createImage($text);

return $this;
}

public function get(): ?string
{
return $this->imageBlob;
Expand Down
20 changes: 0 additions & 20 deletions tests/OpenGraphImagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,6 @@ public function testMake(string $text): void
}
}

/**
* @dataProvider textProvider
*/
public function testMakeTwitter(string $text): void
{
$result = $this->openGraphImages->makeTwitter($text);
$this->assertInstanceOf(OpenGraphImages::class, $result);
$this->assertEquals('image/png', $this->getMimeTypeFromString($result->get()));
}

/**
* @dataProvider textProvider
*/
public function testMakeVk(string $text): void
{
$result = $this->openGraphImages->makeVk($text);
$this->assertInstanceOf(OpenGraphImages::class, $result);
$this->assertEquals('image/png', $this->getMimeTypeFromString($result->get()));
}

/**
* @dataProvider textProvider
*/
Expand Down

0 comments on commit 0958a42

Please sign in to comment.