Skip to content

Commit

Permalink
Apply fixes from StyleCI (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot authored Sep 25, 2018
1 parent 37947d4 commit 89081e5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/Extensions/ElementButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function disableShare()

return $this;
}

/**
* @return $this
*/
Expand Down Expand Up @@ -185,7 +185,7 @@ public function toArray()

if ($this->type === self::TYPE_WEB_URL) {
if (! is_null($this->webview_height_ratio)) {
$buttonArray['webview_height_ratio'] = $this->webview_height_ratio;
$buttonArray['webview_height_ratio'] = $this->webview_height_ratio;
}
if (! is_null($this->webview_share_button)) {
$buttonArray['webview_share_button'] = $this->webview_share_button;
Expand Down
8 changes: 4 additions & 4 deletions src/Extensions/OpenGraphElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ class OpenGraphElement implements JsonSerializable
{
/** @var string */
protected $url;

/** @var object */
protected $buttons;

/**
* @return static
*/
public static function create()
{
return new static;
}

/**
* @param string $url
* @return $this
Expand Down Expand Up @@ -58,7 +58,7 @@ public function addButtons(array $buttons)

return $this;
}

/**
* @return array
*/
Expand Down
2 changes: 1 addition & 1 deletion src/FacebookDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
use BotMan\Drivers\Facebook\Events\MessagingDeliveries;
use BotMan\Drivers\Facebook\Extensions\GenericTemplate;
use BotMan\Drivers\Facebook\Extensions\ReceiptTemplate;
use BotMan\Drivers\Facebook\Extensions\OpenGraphTemplate;
use BotMan\Drivers\Facebook\Exceptions\FacebookException;
use BotMan\Drivers\Facebook\Extensions\OpenGraphTemplate;

class FacebookDriver extends HttpDriver implements VerifiesService
{
Expand Down
19 changes: 9 additions & 10 deletions tests/Extensions/OpenGraphElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use Illuminate\Support\Arr;
use PHPUnit_Framework_TestCase;
use BotMan\Drivers\Facebook\Extensions\OpenGraphElement;
use BotMan\Drivers\Facebook\Extensions\ElementButton;
use BotMan\Drivers\Facebook\Extensions\OpenGraphElement;

class ElementTest extends PHPUnit_Framework_TestCase
class OpenGraphElementTest extends PHPUnit_Framework_TestCase
{
/** @test */
public function it_can_be_created()
Expand Down Expand Up @@ -44,8 +44,8 @@ public function it_can_add_a_button()
{
$template = new Element('Here are some buttons');
$template->addButton(ElementButton::create('button1')
->url('https://en.wikipedia.org/wiki/Rickrolling')
->removeHeightRatio());
->url('https://en.wikipedia.org/wiki/Rickrolling')
->removeHeightRatio());

$this->assertSame('button1', Arr::get($template->toArray(), 'buttons.0.title'));
}
Expand All @@ -57,14 +57,13 @@ public function it_can_add_multiple_buttons()
{
$template = new Element('Here are some buttons');
$template->addButtons([ElementButton::create('button1')
->url('https://en.wikipedia.org/wiki/Rickrolling')
->removeHeightRatio(),
ElementButton::create('button2')
->url('https://en.wikipedia.org/')
->removeHeightRatio()]);
->url('https://en.wikipedia.org/wiki/Rickrolling')
->removeHeightRatio(),
ElementButton::create('button2')
->url('https://en.wikipedia.org/')
->removeHeightRatio(), ]);

$this->assertSame('button1', Arr::get($template->toArray(), 'buttons.0.title'));
$this->assertSame('button2', Arr::get($template->toArray(), 'buttons.1.title'));
}

}
2 changes: 1 addition & 1 deletion tests/Extensions/OpenGraphTemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Illuminate\Support\Arr;
use PHPUnit_Framework_TestCase;
use BotMan\Drivers\Facebook\Extensions\OpenGraphTemplate;
use BotMan\Drivers\Facebook\Extensions\OpenGraphElement;
use BotMan\Drivers\Facebook\Extensions\OpenGraphTemplate;

class OpenGraphTemplateTest extends PHPUnit_Framework_TestCase
{
Expand Down

0 comments on commit 89081e5

Please sign in to comment.