-
-
Notifications
You must be signed in to change notification settings - Fork 67
Modernize: PHP 8.2+, Flysystem 3, GitHub Actions, and security/correctness fixes #142
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
Open
tarikmanoar
wants to merge
6
commits into
masbug:2.x
Choose a base branch
from
tarikmanoar:feature/modernization
base: 2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1e813f0
ci: replace Travis/Scrutinizer/StyleCI with GitHub Actions + PHPStan …
tarikmanoar 6210081
build: require PHP 8.2+, modernize dependencies and test suites
tarikmanoar 8a13357
refactor: fix correctness/security bugs, add types, remove debug scaf…
tarikmanoar 6ae2a56
test: add credential-free unit tests for pure logic
tarikmanoar 3a77b1d
docs: refresh README, add CHANGELOG/CONTRIBUTING/SECURITY, fix packaging
tarikmanoar c646e51
fix: address PR review (StreamableUpload header/type safety)
tarikmanoar 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 hidden or 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,18 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_size = 4 | ||
| indent_style = space | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
|
|
||
| [*.md] | ||
| trim_trailing_whitespace = false | ||
|
|
||
| [*.{yml,yaml}] | ||
| indent_size = 2 | ||
|
|
||
| [*.{json,neon}] | ||
| indent_size = 4 |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,16 +1,16 @@ | ||
| # Path-based git attributes | ||
| # https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html | ||
|
|
||
| # Ignore all test and documentation with "export-ignore". | ||
| /.github export-ignore | ||
| /.gitattributes export-ignore | ||
| /.gitignore export-ignore | ||
| /.editorconfig export-ignore | ||
| /.php_cs.dist.php export-ignore | ||
| /.scrutinizer.yml export-ignore | ||
| /.styleci.yml export-ignore | ||
| /.travis.yml export-ignore | ||
| /phpunit.xml.dist export-ignore | ||
| /docs export-ignore | ||
| /tests export-ignore | ||
| /google-drive-service-account.json.example export-ignore | ||
| * text=auto eol=lf | ||
|
|
||
| # Files & directories excluded from the distributed package ("composer install") | ||
| /.github export-ignore | ||
| /.gitattributes export-ignore | ||
| /.gitignore export-ignore | ||
| /.editorconfig export-ignore | ||
| /phpstan.neon export-ignore | ||
| /pint.json export-ignore | ||
| /phpunit.xml.dist export-ignore | ||
| /tests export-ignore | ||
| /CONTRIBUTING.md export-ignore | ||
| /google-drive-service-account.json.example export-ignore |
This file contains hidden or 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,12 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "composer" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| open-pull-requests-limit: 10 | ||
|
|
||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" |
This file contains hidden or 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,31 @@ | ||
| name: code style | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "2.x", "3.x", "master", "main" ] | ||
| pull_request: | ||
| branches: [ "2.x", "3.x", "master", "main" ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| pint: | ||
| runs-on: ubuntu-latest | ||
| name: Pint | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: "8.3" | ||
| coverage: none | ||
| tools: composer:v2 | ||
|
|
||
| - name: Install dependencies | ||
| run: composer update --prefer-dist --no-interaction --no-progress | ||
|
|
||
| - name: Check code style (Pint) | ||
| run: vendor/bin/pint --test | ||
This file contains hidden or 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,32 @@ | ||
| name: static analysis | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "2.x", "3.x", "master", "main" ] | ||
| pull_request: | ||
| branches: [ "2.x", "3.x", "master", "main" ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| phpstan: | ||
| runs-on: ubuntu-latest | ||
| name: PHPStan | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: "8.3" | ||
| extensions: mbstring, fileinfo, json | ||
| coverage: none | ||
| tools: composer:v2 | ||
|
|
||
| - name: Install dependencies | ||
| run: composer update --prefer-dist --no-interaction --no-progress | ||
|
|
||
| - name: Run PHPStan | ||
| run: vendor/bin/phpstan analyse --no-progress |
This file contains hidden or 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,51 @@ | ||
| name: tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "2.x", "3.x", "master", "main" ] | ||
| pull_request: | ||
| branches: [ "2.x", "3.x", "master", "main" ] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| tests: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ ubuntu-latest ] | ||
| php: [ "8.2", "8.3", "8.4" ] | ||
| dependency-version: [ prefer-lowest, prefer-stable ] | ||
|
|
||
| name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: ${{ matrix.php }} | ||
| extensions: mbstring, fileinfo, json | ||
| coverage: none | ||
| tools: composer:v2 | ||
|
|
||
| - name: Get composer cache directory | ||
| id: composer-cache | ||
| run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Cache dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ steps.composer-cache.outputs.dir }} | ||
| key: ${{ matrix.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }}-${{ hashFiles('**/composer.json') }} | ||
| restore-keys: ${{ matrix.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }}- | ||
|
|
||
| - name: Install dependencies | ||
| run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress | ||
|
|
||
| - name: Execute tests | ||
| run: vendor/bin/phpunit |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,10 +1,15 @@ | ||
| .settings | ||
| .buildpath | ||
| .project | ||
| .idea | ||
| .vscode | ||
| composer.lock | ||
| composer.phar | ||
| google-drive-service-account.json | ||
| build | ||
| vendor | ||
| .phpunit.result.cache | ||
| .php_cs.cache | ||
| .phpunit.cache | ||
| .php-cs-fixer.cache | ||
| .pint.cache | ||
| .env |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
"master", "main"??those branches do not exist