Skip to content

Commit f1d0c23

Browse files
Merge pull request #273 from opentok/php-7.4-updates-and-cleanup
PHP 7.4 updates and cleanup
2 parents fcf206a + 7da3c73 commit f1d0c23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+460
-446
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!--- Provide a general summary of the issue in the Title above -->
2+
3+
## Expected Behavior
4+
<!--- If you're describing a bug, tell us what should happen -->
5+
<!--- If you're suggesting a change/improvement, tell us how it should work -->
6+
7+
## Current Behavior
8+
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
9+
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
10+
11+
## Possible Solution
12+
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
13+
<!--- or ideas how to implement the addition or change -->
14+
15+
## Steps to Reproduce (for bugs)
16+
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
17+
<!--- reproduce this bug. Include code to reproduce, if relevant -->
18+
1.
19+
2.
20+
3.
21+
4.
22+
23+
## Context
24+
<!--- How has this issue affected you? What are you trying to accomplish? -->
25+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
26+
27+
## Your Environment
28+
<!--- Include as many relevant details about the environment you experienced the bug in -->
29+
* Version used:
30+
* Environment name and version (e.g. PHP 5.4 on nginx 1.9.1):
31+
* Operating System and version:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
3+
## Description
4+
<!--- Describe your changes in detail -->
5+
6+
## Motivation and Context
7+
<!--- Why is this change required? What problem does it solve? -->
8+
<!--- If it fixes an open issue, please link to the issue here. -->
9+
10+
## How Has This Been Tested?
11+
<!--- Please describe in detail how you tested your changes. -->
12+
<!--- Include details of your testing environment, and the tests you ran to -->
13+
<!--- see how your change affects other areas of the code, etc. -->
14+
15+
## Example Output or Screenshots (if appropriate):
16+
17+
## Types of changes
18+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
19+
- [ ] Bug fix (non-breaking change which fixes an issue)
20+
- [ ] New feature (non-breaking change which adds functionality)
21+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
22+
23+
## Checklist:
24+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
25+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
26+
- [ ] My code follows the code style of this project.
27+
- [ ] My change requires a change to the documentation.
28+
- [ ] I have updated the documentation accordingly.
29+
- [ ] I have read the **CONTRIBUTING** document.
30+
- [ ] I have added tests to cover my changes.
31+
- [ ] All new and existing tests passed.

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: build
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
runs-on:
6+
- ubuntu-latest
7+
strategy:
8+
matrix:
9+
php: ['7.2', '7.3', '7.4']
10+
steps:
11+
- name: Configure Git
12+
if: ${{ matrix.os == 'windows-latest' }}
13+
run: |
14+
git config --system core.autocrlf false
15+
git config --ystem core.eol lf
16+
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php }}
24+
extensions: json
25+
tools: composer
26+
coverage: xdebug
27+
28+
- name: Get Composer cache directory
29+
id: composercache
30+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
31+
32+
- name: Cache Composer dependencies
33+
uses: actions/cache@v2
34+
with:
35+
path: ${{ steps.composercache.outputs.dir }}
36+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
37+
restore-keys: ${{ runner.os }}-composer-
38+
39+
- name: Install dependencies
40+
run: composer install --no-interaction --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }}
41+
42+
- name: Analyze & test
43+
run: |
44+
vendor/bin/phpunit -v --configuration ./phpunit.xml.dist --coverage-clover=coverage.xml
45+
46+
- name: Run codecov
47+
uses: codecov/codecov-action@v1

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ command line:
2525
$ ./composer.phar require opentok/opentok 4.4.x
2626
```
2727

28-
### Manually:
29-
30-
Download the `opentok.phar` file for the latest release from the [Releases](https://github.com/opentok/opentok-php-sdk/releases)
31-
page.
32-
33-
Place `opentok.phar` in the [include_path](http://www.php.net/manual/en/ini.core.php#ini.include-path) OR
34-
require it in any script which uses the `OpenTok\*` classes.
35-
3628
## Usage
3729

3830
### Initializing
@@ -239,9 +231,9 @@ $archive->delete();
239231
```
240232

241233
You can also get a list of all the Archives you've created (up to 1000) with your API Key. This is
242-
done using the `listArchives($offset, $count)` method of the `OpenTok/OpenTok` class. The parameters
243-
`$offset` and `$count` are optional and can help you paginate through the results. This will return
244-
an instance of the `OpenTok\ArchiveList` class.
234+
done using the `listArchives($offset, $count, $sessionId)` method of the `OpenTok/OpenTok` class. The parameters
235+
`$offset`, `$count`, and `$sessionId` are optional and can help you paginate through the results, and subset the
236+
data by a specific session. This will return an instance of the `OpenTok\ArchiveList` class.
245237

246238
```php
247239
$archiveList = $opentok->listArchives();
@@ -514,9 +506,7 @@ Reference documentation is available at
514506
You need an OpenTok API key and API secret, which you can obtain by logging into your
515507
[TokBox account](https://tokbox.com/account).
516508

517-
The OpenTok PHP SDK requires PHP 5.6+ or PHP 7+
518-
519-
For PHP 5.5 and lower please use PHP SDK v2.5
509+
The OpenTok PHP SDK requires PHP 7.2 or higher.
520510

521511
## Release Notes
522512

composer.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,26 @@
2828
"issues": "https://github.com/opentok/Opentok-PHP-SDK/issues"
2929
},
3030
"require": {
31-
"php": ">=5.6.0",
31+
"php": "^7.2",
32+
"ext-xml": "*",
3233
"johnstevenson/json-works": "~1.1",
3334
"firebase/php-jwt": "^5.0",
34-
"guzzlehttp/guzzle": "~6.0"
35+
"guzzlehttp/guzzle": "~6.0|~7.0"
3536
},
3637
"require-dev": {
37-
"phpunit/phpunit": "~5.7",
38+
"phpunit/phpunit": "^7.4",
39+
"php-http/mock-client": "^0.3.0",
40+
"estahn/phpunit-json-assertions": "^3.0.0",
41+
"squizlabs/php_codesniffer": "^3.1",
42+
"php-http/guzzle6-adapter": "^1.0",
43+
"phpstan/phpstan": "^0.11",
44+
"rector/rector": "^0.5.23",
3845
"phing/phing": "~2.16.0"
3946
},
4047
"autoload": {
4148
"psr-4": {
42-
"OpenTok\\": "src/OpenTok"
49+
"OpenTok\\": "src/OpenTok",
50+
"OpenTokTest\\": "tests/OpenTokTest"
4351
}
4452
}
4553
}

phpcs.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PSR12">
3+
<rule ref="PSR12"/>
4+
<file>./src</file>
5+
</ruleset>

phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 6
3+
paths:
4+
- src

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<phpunit bootstrap="tests/bootstrap.php" colors="true">
44
<testsuites>
55
<testsuite name="OpenTok Test Suite">
6-
<directory>tests/OpenTok/</directory>
6+
<directory>tests/</directory>
77
</testsuite>
88
</testsuites>
99

1010
<filter>
1111
<whitelist>
12-
<directory suffix=".php">src/OpenTok/</directory>
12+
<directory suffix=".php">src/</directory>
1313
</whitelist>
1414
</filter>
1515

rector.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
php_version_features: '7.1'
3+
import_short_classes: false
4+
sets:
5+
- dead-code

0 commit comments

Comments
 (0)