Skip to content

Commit a818e2b

Browse files
authored
Merge pull request #19 from adamculp/master
Travis and Scrutinizer working as expected
2 parents 838ee4e + 6613354 commit a818e2b

13 files changed

Lines changed: 44 additions & 44 deletions

.env.default

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ BASE_URL='https://api.airtable.com'
22
VERSION='v0'
33
API_KEY=
44
TEST_BASE_ID=
5-
TEST_TABLE_NAME=
6-
TEST_VIEW_NAME=
5+
TEST_TABLE_NAME='Table 1'
6+
TEST_VIEW_NAME='Grid View'

.travis.yml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,25 @@
11
dist: trusty
22
language: php
3-
43
php:
5-
- 7.2
6-
- 7.3
7-
- 7.4
8-
- hhvm
9-
10-
## Cache composer
4+
- 7.2
5+
- 7.3
6+
- 7.4
117
cache:
128
directories:
13-
- $HOME/.composer/cache
14-
9+
- "$HOME/.composer/cache"
1510
matrix:
1611
include:
17-
- php: 7.2
18-
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
19-
12+
- php: 7.2
13+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
2014
before_script:
21-
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist
22-
15+
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist
16+
- touch .env
2317
script:
24-
- vendor/bin/phpcs --standard=psr2 src/
25-
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
26-
18+
- vendor/bin/phpcs --standard=psr2 src/
19+
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
2720
after_script:
28-
- |
29-
if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' ]]; then
30-
wget https://scrutinizer-ci.com/ocular.phar
31-
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
32-
fi
21+
- |
22+
if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' ]]; then
23+
wget https://scrutinizer-ci.com/ocular.phar
24+
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
25+
fi

src/AirtableClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AirtableClient
4040
public function __construct(string $baseId, Table $table)
4141
{
4242
$this->client = new Client([
43-
'base_uri' => $_ENV['BASE_URL'] . '/' . $_ENV['VERSION'] . '/' . $baseId . '/'
43+
'base_uri' => getenv('BASE_URL') . '/' . getenv('VERSION') . '/' . $baseId . '/'
4444
]);
4545

4646
$this->baseId = $baseId;
@@ -57,7 +57,7 @@ public function getClient(): Client
5757
$this->table->getName(),
5858
[
5959
'headers' => [
60-
'Authorization' => 'Bearer ' . $_ENV['API_KEY'],
60+
'Authorization' => 'Bearer ' . getenv('API_KEY'),
6161
]
6262
]
6363
);

src/Exception/BadGatewayException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ class BadGatewayException extends AirtableException
1818
/**
1919
* @var string
2020
*/
21-
protected $message = 'Airtable\'s servers are restarting or an unexpected outage is in progress. You should generally not receive this error, and requests are safe to retry.';
21+
protected $message = 'Airtable\'s servers are restarting, or an unexpected outage happened.';
2222
}

src/Exception/ForbiddenException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ class ForbiddenException extends AirtableException
1818
/**
1919
* @var string
2020
*/
21-
protected $message = 'Accessing a protected resource with API credentials that don\'t have access to that resource.';
21+
protected $message = 'Accessing a protected resource with bad API credentials.';
2222
}

src/Exception/InvalidRequestException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ class InvalidRequestException extends AirtableException
1818
/**
1919
* @var string
2020
*/
21-
protected $message = 'The request data is invalid. This includes most of the base-specific validations. You will receive a detailed error message and code pointing to the exact issue.';
21+
protected $message = 'The request data is invalid.';
2222
}

src/Exception/NotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ class NotFoundException extends AirtableException
1818
/**
1919
* @var string
2020
*/
21-
protected $message = 'Route or resource is not found. This error is returned when the request hits an undefined route, or if the resource doesn\'t exist (e.g. has been deleted).';
21+
protected $message = 'Route or resource not found.';
2222
}

src/Exception/PaymentRequiredException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ class PaymentRequiredException extends AirtableException
1818
/**
1919
* @var string
2020
*/
21-
protected $message = 'The account associated with the API key making requests hits a quota that can be increased by upgrading the Airtable account plan.';
21+
protected $message = 'Airtable quote hit for this account.';
2222
}

src/Exception/RequestEntityTooLargeException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ class RequestEntityTooLargeException extends AirtableException
1818
/**
1919
* @var string
2020
*/
21-
protected $message = 'The request exceeded the maximum allowed payload size. You shouldn\'t encounter this under normal use.';
21+
protected $message = 'The request exceeded the maximum allowed payload size.';
2222
}

src/Exception/ServiceUnavailableException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ class ServiceUnavailableException extends AirtableException
1818
/**
1919
* @var string
2020
*/
21-
protected $message = 'The server could not process your request in time. The server could be temporarily unavailable, or it could have timed out processing your request. You should retry the request with backoffs.';
21+
protected $message = 'The server could not process your request in time.';
2222
}

0 commit comments

Comments
 (0)