-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add full feature parity #71
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ARG VARIANT=8-bullseye | ||
FROM mcr.microsoft.com/vscode/devcontainers/php:0-${VARIANT} | ||
|
||
RUN pecl install ast && \ | ||
echo "extension=ast.so" >> "$PHP_INI_DIR/php.ini-development" && \ | ||
mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" | ||
|
||
ENV PHAN_ALLOW_XDEBUG 0 | ||
ENV PHAN_DISABLE_XDEBUG_WARN 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/php | ||
{ | ||
"name": "PHP", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
// Update VARIANT to pick a PHP version: 8, 8.0, 7, 7.4, 7.3 | ||
// Append -bullseye or -buster to pin to an OS version. | ||
// Use -bullseye variants on local on arm64/Apple Silicon. | ||
"VARIANT": "8-bullseye" | ||
} | ||
}, | ||
"settings": { | ||
"php.validate.executablePath": "/usr/local/bin/php", | ||
"php-cs-fixer.onsave": true, | ||
"php-cs-fixer.config": ".php-cs-fixer.dist.php", | ||
}, | ||
"extensions": [ | ||
"pkief.material-icon-theme", | ||
"eamodio.gitlens", | ||
"visualstudioexptteam.vscodeintellicode", | ||
"github.copilot", | ||
"felixfbecker.php-debug", | ||
"bmewburn.vscode-intelephense-client", | ||
"junstyle.php-cs-fixer" | ||
], | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [8080], | ||
// Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference. | ||
"portsAttributes": { | ||
"8000": { | ||
"label": "Stream PHP SDK", | ||
"onAutoForward": "notify" | ||
} | ||
}, | ||
// Use 'otherPortsAttributes' to configure any ports that aren't configured using 'portsAttributes'. | ||
// "otherPortsAttributes": { | ||
// "onAutoForward": "silent" | ||
// }, | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html" | ||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,18 @@ name: build | |
|
||
on: [pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: 🧪 Test & lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 1 | ||
matrix: | ||
php-versions: ['7.3', '7.4', '8.0'] | ||
php-versions: ['7.3', '7.4', '8.0', '8.1'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
@@ -23,22 +27,23 @@ jobs: | |
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring, intl | ||
extensions: ast, mbstring, intl | ||
ini-values: post_max_size=256M, max_execution_time=180 | ||
tools: composer:v2 | ||
|
||
- name: Deps | ||
run: composer install --no-interaction | ||
|
||
- name: Format | ||
run: vendor/bin/php-cs-fixer fix --config=.php_cs-fixer.dist.php -v --dry-run --stop-on-violation | ||
if: ${{ matrix.php-versions == '7.3' }} | ||
run: vendor/bin/php-cs-fixer fix -v --dry-run --stop-on-violation | ||
|
||
- name: Quality | ||
if: matrix.php-versions == '7.4' | ||
run: vendor/bin/phan --force-polyfill-parser || true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
if: ${{ matrix.php-versions == '7.3' }} | ||
run: vendor/bin/phan --no-progress-bar | ||
|
||
- name: Test | ||
env: | ||
STREAM_API_KEY: ${{ secrets.STREAM_API_KEY }} | ||
STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }} | ||
STREAM_KEY: ${{ secrets.STREAM_API_KEY }} | ||
STREAM_SECRET: ${{ secrets.STREAM_API_SECRET }} | ||
run: vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ composer.lock | |
.phplint-cache | ||
.phpunit.result.cache | ||
.envrc | ||
.php_cs.cache | ||
.php*cache | ||
.idea | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,39 @@ | |
// TODO: Set this. | ||
'target_php_version' => null, | ||
|
||
'plugins' => [ | ||
'AlwaysReturnPlugin', | ||
'DuplicateArrayKeyPlugin', | ||
'PrintfCheckerPlugin', | ||
'UnreachableCodePlugin', | ||
'UseReturnValuePlugin', | ||
'EmptyStatementListPlugin', | ||
'LoopVariableReusePlugin', | ||
'RedundantAssignmentPlugin', | ||
'UnknownClassElementAccessPlugin', | ||
'MoreSpecificElementTypePlugin', | ||
'UnsafeCodePlugin', | ||
'WhitespacePlugin', | ||
'PHPDocInWrongCommentPlugin', | ||
'NoAssertPlugin', | ||
'NumericalComparisonPlugin', | ||
'StrictLiteralComparisonPlugin', | ||
'DeprecateAliasPlugin', | ||
'ShortArrayPlugin', | ||
'AvoidableGetterPlugin', | ||
'RemoveDebugStatementPlugin', | ||
'HasPHPDocPlugin', | ||
], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these plugins are amazing. i was able to catch and fix a few issues with it. |
||
|
||
'suppress_issue_types' => [ | ||
'PhanPluginDescriptionlessCommentOnPublicMethod', | ||
'PhanPluginDescriptionlessCommentOnProtectedProperty', | ||
'PhanPluginDescriptionlessCommentOnPublicProperty', | ||
'PhanPluginDescriptionlessCommentOnPrivateMethod', | ||
'PhanPluginDescriptionlessCommentOnPrivateProperty', | ||
'PhanPluginDescriptionlessCommentOnProtectedMethod', | ||
], | ||
|
||
// A list of directories that should be parsed for class and | ||
// method information. After excluding the directories | ||
// defined in exclude_analysis_directory_list, the remaining | ||
|
@@ -49,6 +82,7 @@ | |
// should be added to both the `directory_list` | ||
// and `exclude_analysis_directory_list` arrays. | ||
'exclude_analysis_directory_list' => [ | ||
'vendor/' | ||
'vendor/', | ||
'tests/', | ||
], | ||
]; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# ♻️ Contributing | ||
|
||
We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our [Contributor License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) first. See our license file for more details. | ||
|
||
## Getting started | ||
|
||
### Restore dependencies | ||
|
||
Installing dependencies into `./vendor` folder: | ||
|
||
```bash | ||
$ composer install | ||
``` | ||
|
||
### Run tests | ||
|
||
The tests we have are full fledged integration tests, meaning they will actually reach out to a Stream app. Hence the tests require at least two environment variables: `STREAM_KEY` and `STREAM_SECRET`. | ||
|
||
```bash | ||
$ export STREAM_KEY="<your-key>" | ||
$ export STREAM_SECRET="<your-secret>" | ||
$ vendor/bin/phpunit | ||
``` | ||
|
||
> 💡 Note: On Unix systems you could use [direnv](https://direnv.net/) to set up these variables. | ||
|
||
## IDE specific setup | ||
|
||
If you use VS Code, you can pull up a Dockerized development environment with [Remote-Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. The proper configuration is already included in [.devcontainer](./.devcontainer/) folder. Once you're inside the container, just run the `composer install` command and you're good to go. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ast
gives a performance boost tophan