Skip to content

Commit

Permalink
100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ssitdikov committed Jan 2, 2018
1 parent e792010 commit f35acb5
Show file tree
Hide file tree
Showing 7 changed files with 427 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
@@ -1,3 +1,7 @@
[![Build Status](https://travis-ci.org/ssitdikov/telegraph-api-client.svg?branch=master)](https://travis-ci.org/ssitdikov/telegraph-api-client)
[![Coverage Status](https://coveralls.io/repos/github/ssitdikov/telegraph-api-client/badge.svg?branch=master)](https://coveralls.io/github/ssitdikov/telegraph-api-client?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/38edcd896a7a47a3ba790cdf4167b7bc)](https://www.codacy.com/app/sitsalavat/telegraph-api-client?utm_source=github.com&utm_medium=referral&utm_content=ssitdikov/telegraph-api-client&utm_campaign=Badge_Grade)

# Telegra.ph API PHP Client
## О продукте
Данная библиотека предназначена для работы с сервисом [Telegra.ph](https://telegra.ph).
Expand Down
2 changes: 1 addition & 1 deletion src/Request/CreatePageRequest.php
Expand Up @@ -58,7 +58,7 @@ public function handleResponse(ResponseInterface $response): Page
if (isset($json->result->can_edit)) {
$this->page->setCanEdit($json->result->can_edit);
}
if ($this->returnContent) {
if ($this->getReturnContent()) {
$this->page->setContent($json->result->content);
}
return $this->page;
Expand Down
5 changes: 4 additions & 1 deletion src/Request/EditPageRequest.php
Expand Up @@ -45,7 +45,10 @@ public function handleResponse(ResponseInterface $response): Page
if (isset($json->result->can_edit)) {
$this->page->setCanEdit($json->result->can_edit);
}
if ($this->returnContent) {
if (isset($json->result->image_url)) {
$this->page->setImageUrl($json->result->image_url);
}
if ($this->getReturnContent()) {
$this->page->setContent($json->result->content);
}
return $this->page;
Expand Down
7 changes: 7 additions & 0 deletions src/Request/GetPageListRequest.php
Expand Up @@ -14,6 +14,13 @@ class GetPageListRequest implements RequestInterface
private $offset;
private $limit;

/**
* GetPageListRequest constructor.
* @param Account $account
* @param int $offset
* @param int $limit
* @todo add additional checks for limits
*/
public function __construct(Account $account, $offset = 0, $limit = 50)
{
$this->account = $account;
Expand Down
2 changes: 1 addition & 1 deletion src/Request/GetPageRequest.php
Expand Up @@ -38,7 +38,7 @@ public function handleResponse(ResponseInterface $response): Page
if (isset($json->result->image_url)) {
$this->page->setImageUrl($json->result->image_url);
}
if ($this->returnContent) {
if ($this->getReturnContent()) {
$this->page->setContent($json->result->content);
}
return $this->page;
Expand Down
2 changes: 1 addition & 1 deletion src/Type/PageViews.php
Expand Up @@ -12,7 +12,7 @@ class PageViews

public function __construct(int $views)
{
$this->views = $views;
$this->setViews($views);
}

/**
Expand Down

0 comments on commit f35acb5

Please sign in to comment.