Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
17bb8f2
`ReadOnlyFileSystem` now `implements FilesystemAdapter`
BrianHenryIE Apr 21, 2025
9ad241b
Add `brianhenryie/color-logger`
BrianHenryIE Apr 24, 2025
c8f05a4
`getVendorRelativePath()`
BrianHenryIE Apr 24, 2025
5940c4d
`::setProjectDirectory()`
BrianHenryIE Apr 24, 2025
390ecf5
`::dirIsEmpty()`
BrianHenryIE Apr 24, 2025
971d989
whitespace / documentation
BrianHenryIE Apr 24, 2025
527bbc0
comments / variable name casing
BrianHenryIE Apr 24, 2025
d383a40
Create SymlinkProtectFilesystemAdapterTest.php
BrianHenryIE Apr 24, 2025
6ee0e1b
Delete unused imports
BrianHenryIE Apr 27, 2025
e876f83
Comments
BrianHenryIE Apr 27, 2025
f0a2770
Fix: use `self::class` not `this` in `get_parent_class()`
BrianHenryIE Apr 27, 2025
0a1beff
Improve `FlysystemBackCompatTrait` with interface
BrianHenryIE Apr 28, 2025
6e441ef
Remove unnecessary `ltrim`
BrianHenryIE Apr 28, 2025
0283429
Remove unnecessary `/`
BrianHenryIE Apr 28, 2025
4eefd61
Normalise paths #169
BrianHenryIE Apr 28, 2025
4cfdc4d
Rename method to `setProjectVendorDirectory()`
BrianHenryIE Apr 28, 2025
8927551
Add `PathPrefixer` to `FileSystem` helper
BrianHenryIE Apr 28, 2025
5e7aa2d
Update LicenserTest.php
BrianHenryIE Apr 28, 2025
86e5836
Improve variable names for paths
BrianHenryIE Apr 28, 2025
d19740c
Add `array` type to function signature
BrianHenryIE Apr 28, 2025
4445c49
Improve variable name
BrianHenryIE Apr 28, 2025
65bc257
Use `PathNormalizer` not `str_replace` / `ltrim`
BrianHenryIE Apr 28, 2025
1b53e9d
`phpcbf` whitespace
BrianHenryIE Apr 28, 2025
d4e93fb
`::setDoDelete()` for files outside vendor dir
BrianHenryIE Apr 28, 2025
c90f69d
`::setRealpath()` using `composer/installed.json`
BrianHenryIE Apr 28, 2025
c637bc9
`phpcbf` whitespace
BrianHenryIE Apr 28, 2025
7644d8c
Add ability to get underlying filsystem adapter
BrianHenryIE Apr 28, 2025
981adc4
Add `SymlinkProtectFilesystemAdapter`
BrianHenryIE Apr 28, 2025
9eae1e2
Create .editorconfig
BrianHenryIE Apr 28, 2025
8a44dc8
Check for parent class before checking for parent method
BrianHenryIE Apr 28, 2025
954858f
Use correct `::getTargetDirectory()` in `FileEnumerator`
BrianHenryIE Apr 28, 2025
b41fdc4
Try use Windows `PathPrefixer`
BrianHenryIE Apr 28, 2025
918a220
handle `Config::get('timestamp')` in newer `InMemoryFilesystemAdapter…
BrianHenryIE Apr 28, 2025
eeb2b5e
handle `Config::get('timestamp')` in other three tests
BrianHenryIE Apr 28, 2025
11d34f6
Check `packageAbsolutePath` for `isOutsideProjectDir`
BrianHenryIE Apr 28, 2025
f5f850a
Add read operations
BrianHenryIE Apr 28, 2025
827f2b9
Change to `extends LocalFilesystemAdapter`
BrianHenryIE Apr 28, 2025
9a479cd
Test fails when symlinked package might be deleted
BrianHenryIE Apr 28, 2025
5e3fd70
Improve accuracy of doc
BrianHenryIE Apr 28, 2025
5f8bc4d
Redirect stderr to stdout
BrianHenryIE Apr 28, 2025
4e2ec47
Move `testsWorkingDir` to `TestCase` and `::createWorkingDir()`
BrianHenryIE Apr 29, 2025
f6419f2
Add `PathNormalizer`
BrianHenryIE Apr 29, 2025
4912cf1
Add `::assertEqualsPaths()`
BrianHenryIE Apr 29, 2025
abe489e
Add `PathPrefixer` to `Filesystem`
BrianHenryIE Apr 29, 2025
6ad0588
Reimplement `PathPrefixer`
BrianHenryIE Apr 29, 2025
08d982c
Use `TestCase::createWorkingDir()`
BrianHenryIE Apr 29, 2025
8dcedc9
Use `TestCase::createWorkingDir()`
BrianHenryIE Apr 29, 2025
127084e
Use `TestCase::assertEqualsPaths()`
BrianHenryIE Apr 29, 2025
23becd9
Rename to `::prefixPath()`
BrianHenryIE Apr 29, 2025
a55f540
Prefix normalized file path before passing to non-flysystem operation
BrianHenryIE Apr 29, 2025
974b621
Prefix normalized file path before passing to non-flysystem operation
BrianHenryIE Apr 29, 2025
8c48fa6
Update ReadOnlyFileSystem.php
BrianHenryIE Apr 29, 2025
3b31a34
Update StraussConfig.php
BrianHenryIE Apr 29, 2025
97ba4a2
`StraussConfig::setProjectDirectory()`
BrianHenryIE Apr 29, 2025
2541246
`StraussConfig::setProjectDirectory()`
BrianHenryIE Apr 29, 2025
f9a9631
Update DependenciesCommandTest.php
BrianHenryIE Apr 29, 2025
a58774a
Update InstalledJsonTest.php
BrianHenryIE Apr 29, 2025
eafd472
Use `cweagans/composer-patches` during PR
BrianHenryIE May 2, 2025
4dc775c
Add (temporary?!) `::shouldUseFilesystemPrefix()`
BrianHenryIE May 2, 2025
06c5567
Create DumpAutoloadTest.php
BrianHenryIE May 2, 2025
663c7dc
Update TestCase.php
BrianHenryIE May 2, 2025
2e1090f
Add `windows-latest`
BrianHenryIE May 2, 2025
702dc3a
Remove Phive uses (failing on Windows)
BrianHenryIE May 2, 2025
f89f177
Update main.yml
BrianHenryIE May 2, 2025
616f5d3
Move instances towards constuctor
BrianHenryIE May 2, 2025
6261a9f
Update composer.json
BrianHenryIE May 2, 2025
084db03
Merge branch 'master' into add/SymlinkProtectFileSystem
BrianHenryIE May 9, 2025
58cabe6
Update DumpAutoloadTest.php
BrianHenryIE May 9, 2025
953a362
Merge branch 'master' into add/SymlinkProtectFileSystem
BrianHenryIE Jun 19, 2025
125b37e
Use `brianhenryie/composer` during development
BrianHenryIE Jun 19, 2025
e7334a9
Remove code now contained in `IntegrationTestCase`
BrianHenryIE Jun 19, 2025
53ed804
Require `elazar/flystream: ^0.6.0|^1.4`
BrianHenryIE Jun 19, 2025
1beeccf
Use `ConsoleLogger` in test
BrianHenryIE Jun 19, 2025
b528099
Pass constructor parameters that are no longer default
BrianHenryIE Jun 19, 2025
fcef7c3
Fix test
BrianHenryIE Jun 19, 2025
3c149d4
Add `GITHUB_TOKEN` for Composer
BrianHenryIE Jun 19, 2025
563797a
Update codecoverage.yml
BrianHenryIE Jun 20, 2025
52df9d1
Update main.yml
BrianHenryIE Jun 20, 2025
1b5844d
Output path on failure
BrianHenryIE Jun 20, 2025
640fa5a
Use `DIRECTORY_SEPARATOR`
BrianHenryIE Jun 20, 2025
0d5b286
Merge branch 'master' into add/SymlinkProtectFileSystem
BrianHenryIE Jul 2, 2025
93dd7f9
Fix merge
BrianHenryIE Jul 3, 2025
5dc9168
Improve setup/teardown stream wrapper tidyup
BrianHenryIE Jul 3, 2025
f1cf5cc
Fix was calling `isset()` on undefined variable
BrianHenryIE Jul 3, 2025
aa9b166
Create `ComposerAutoloadGeneratorFactory`
BrianHenryIE Jul 3, 2025
85361c5
FIx `DumpAutoload` test
BrianHenryIE Jul 3, 2025
d439ac6
Update TestCase.php
BrianHenryIE Jul 3, 2025
971286c
Change the signature; not sure why it ever worked
BrianHenryIE Jul 3, 2025
0c5b9e0
Merge branch 'master' into add/SymlinkProtectFileSystem
BrianHenryIE Jul 16, 2025
0c5c358
Update composer.json
BrianHenryIE Jul 16, 2025
f06567c
Improve testcase setup
BrianHenryIE Jul 16, 2025
469eb3c
Update ReadOnlyFileSystemIntegrationTest.php
BrianHenryIE Jul 16, 2025
01a9626
Update ReadOnlyFileSystem.php
BrianHenryIE Jul 16, 2025
2d7aded
Update `IntegrationTestCase` to override `DependenciesCommand` methods
BrianHenryIE Jul 16, 2025
f0dc397
Improve tests logger reliability
BrianHenryIE Jul 17, 2025
216b759
Update DumpAutoloadTest.php
BrianHenryIE Jul 17, 2025
4182af9
Use `Filesystem::prefixPath()` before sending path to third party lib…
BrianHenryIE Jul 17, 2025
d76d4a8
Update StraussConfig.php
BrianHenryIE Jul 17, 2025
0af107e
Check `::isAbsolutePath()` first
BrianHenryIE Jul 17, 2025
1bd12d2
Update test to check `TestLogger` for output
BrianHenryIE Jul 17, 2025
5097fb7
Use `::getTestLogger()`
BrianHenryIE Jul 19, 2025
59c1fa6
Update `@covers`
BrianHenryIE Jul 19, 2025
dc382d8
Enabled shared `ReadOnlyFilesystem` between code and tests
BrianHenryIE Jul 19, 2025
a844c78
Remove redundant code
BrianHenryIE Jul 19, 2025
b04c626
Enable controlling logger better in tests
BrianHenryIE Jul 19, 2025
773a87c
Add `TestCase::$symlinkProtectFilesystem` singleton
BrianHenryIE Jul 19, 2025
c9a485f
Move instance variables to top of file
BrianHenryIE Jul 19, 2025
0e31081
Extract `CustomAssertionsTrait`
BrianHenryIE Jul 19, 2025
80c5ccb
Move `IntegrationTestCase` abstract class
BrianHenryIE Jul 19, 2025
9218913
Update FileEnumeratorTest.php
BrianHenryIE Jul 19, 2025
cb8f4e3
Update tests to use `TestCase::getReadOnlyFileSystem()`
BrianHenryIE Jul 19, 2025
6341b08
Add TODO
BrianHenryIE Jul 19, 2025
e1c119e
Merge branch 'master' into add/SymlinkProtectFileSystem
BrianHenryIE Jul 24, 2025
a1ca83f
Update StraussIssue213Test.php
BrianHenryIE Jul 24, 2025
9381640
Update IntegrationTestCase.php
BrianHenryIE Jul 24, 2025
8a8b37c
Add notes.
BrianHenryIE Jul 24, 2025
8a0dd58
Merge branch 'master' into add/SymlinkProtectFileSystem
BrianHenryIE Nov 14, 2025
50b5ca8
Finish merge 0.25.0
BrianHenryIE Nov 14, 2025
396c7f3
Merge branch 'master' into add/SymlinkProtectFileSystem
BrianHenryIE Nov 17, 2025
8a878af
Merge branch 'master' into add/SymlinkProtectFileSystem
BrianHenryIE Jan 31, 2026
a2b8a3d
Mark parameters nullable
BrianHenryIE Jan 31, 2026
ed13022
Add missing closing `)`
BrianHenryIE Jan 31, 2026
f7eac8d
Allow `brianhenryie/composer-prefer-local`
BrianHenryIE Jan 31, 2026
7f83a69
Use better term: `delegateFilesystemAdapter` vs `parentFilesystemAdap…
BrianHenryIE Jan 31, 2026
999c48f
Fix some type errors after refactoring
BrianHenryIE Jan 31, 2026
ee57f23
Remove duplicate script after merge
BrianHenryIE Jan 31, 2026
07c9b65
Unregister inmemory filesystem
BrianHenryIE Jan 31, 2026
d98e769
`use`
BrianHenryIE Jan 31, 2026
96cd4af
Is config array or Config?
BrianHenryIE Jan 31, 2026
8db7516
Remove duplicate code after merge
BrianHenryIE Jan 31, 2026
4b6b4b8
Update LicenserTest.php
BrianHenryIE Jan 31, 2026
c8e5a30
Add back code presumed lost in merge
BrianHenryIE Jan 31, 2026
93b9da1
Remove `brianhenryie/composer-prefer-local`
BrianHenryIE Jan 31, 2026
b4cf715
Remove `::has()` now implemented in `FlysystemBackCompatTrait`
BrianHenryIE Jan 31, 2026
faf07ca
Change `delegateFilesystem` var name back to `filesystem`
BrianHenryIE Jan 31, 2026
a43677d
Update DumpAutoloadTest.php
BrianHenryIE Jan 31, 2026
ace7b8d
update imports
BrianHenryIE Jan 31, 2026
15533a0
Update AbstractRenamespacerCommand.php
BrianHenryIE Jan 31, 2026
c259f2e
Update FlysystemBackCompatTrait.php
BrianHenryIE Jan 31, 2026
f3c89e5
Update main.yml
BrianHenryIE Jan 31, 2026
1faea4f
Merge branch 'master' into add/SymlinkProtectFileSystem
BrianHenryIE Apr 14, 2026
44942fb
Add `: void` return type to tests
BrianHenryIE Apr 14, 2026
000dcb5
Add `: void` return type to tests
BrianHenryIE Apr 14, 2026
2f2f5a8
Fix unit tests
BrianHenryIE Apr 14, 2026
20cc818
Fix some integration tests
BrianHenryIE Apr 14, 2026
e4b8018
Add space before void
BrianHenryIE Apr 14, 2026
8ccc075
Merge branch 'master' into add/SymlinkProtectFileSystem
BrianHenryIE Apr 14, 2026
938e44d
Fix integration tests
BrianHenryIE Apr 14, 2026
8ac121a
Fix some issue tests
BrianHenryIE Apr 14, 2026
0a5f57d
Set `"block-insecure": false`
BrianHenryIE Apr 14, 2026
eea0ecc
Use readonlyfilesystem not inmem
BrianHenryIE Apr 14, 2026
4eb3e21
Remove log assertion
BrianHenryIE Apr 14, 2026
7d79947
Update pinned composer/composer
BrianHenryIE Apr 14, 2026
6a0fe78
Fix testLogger
BrianHenryIE Apr 14, 2026
8435ae4
Fix config / file permissions
BrianHenryIE Apr 14, 2026
4e5854c
Remove phive install
BrianHenryIE Apr 14, 2026
49a84b1
Fix spelling
BrianHenryIE Apr 14, 2026
5413603
Update ReadOnlyFileSystemIntegrationTest.php
BrianHenryIE Apr 14, 2026
7dd236a
Merge branch 'master' into add/SymlinkProtectFileSystem
BrianHenryIE Apr 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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
33 changes: 1 addition & 32 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2, phive
tools: composer:v2
extensions: fileinfo, gd
coverage: ${{ matrix.php == env.COVERAGE_PHP_VERSION && 'xdebug' || 'none' }}

Expand All @@ -70,37 +70,6 @@ jobs:
# TODO: merge master into this branch and run tests against what master will become, not just the isolated branch.
# NB: how would that affect tj-actions/changed-files?

- name: Install Phive tools
if: ${{ github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'OWNER' }} # secrets are not available to users without write access
# Keys taken from `phive status`
# `phive status | grep -oE '[A-F0-9]{16}' | tr '\n' ',' | sed 's/,$//'`
# sed -i "s|^\s*phive install --trust-gpg-keys .*| phive install --trust-gpg-keys $(phive status | grep -oE '[A-F0-9]{16}' | paste -sd,)|" .github/workflows/phpstan.yml
run: |
phive install --trust-gpg-keys A9DB489A9190DE9B,4AA394086372C20A
phive status
env:
# We need to be authenticated to skip GitHub rate limits
# Generate a key at: https://github.com/settings/tokens, "classic"
# Approve the 2FA notification on your phone (I presume/hope)
# "Note" what it is for, I use ~PHIVE_GH_RATE_LIMIT_BRIANHENRY_EXPIRES_DEC182026 etc.
# Choose "Expiration", "Custom"
# For "Select Date", the Expiration date can only be set ~364 days ahead
# No scopes are needed, scroll down and click "Generate Token"
# Copied the displayed key
# Visit https://github.com/your/repo/settings/secrets/actions
# Click "New repository secret" and fill it in
# Do the same at https://github.com/your/repo/settings/secrets/dependabot
#
# Fix for rate limited GitHub API requests. See https://github.com/phar-io/phive/issues/384#issuecomment-1337064012
GITHUB_AUTH_TOKEN: ${{ secrets.PHIVE_GH_RATE_LIMIT_BRIANHENRY_EXPIRES_DEC182026 }}

- name: Install Phive tools (unauthenticated)
# secrets are not available to users without write access
if: ${{ github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'OWNER' }}
run: |
phive install --trust-gpg-keys A9DB489A9190DE9B,4AA394086372C20A
phive status

- name: Install PHP dependencies
run: composer update --prefer-dist --verbose

Expand Down
70 changes: 4 additions & 66 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:

concurrency:
# Cancel previous runs of this workflow if they are testing the same branch
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.head_ref) || github.sha }}
cancel-in-progress: true

jobs:
Expand All @@ -42,40 +42,9 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2, phive
tools: composer:v2
extensions: fileinfo, gd, zip

- name: Install Phive tools
if: ${{ github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'OWNER' }}
# Keys taken from `phive status`
# `phive status | grep -oE '[A-F0-9]{16}' | tr '\n' ',' | sed 's/,$//'`
# sed -i "s|^\s*phive install --trust-gpg-keys .*| phive install --trust-gpg-keys $(phive status | grep -oE '[A-F0-9]{16}' | paste -sd,)|" .github/workflows/phpstan.yml
run: |
phive install --trust-gpg-keys A9DB489A9190DE9B,4AA394086372C20A
phive status
env:
# We need to be authenticated to skip GitHub rate limits
# Generate a key at: https://github.com/settings/tokens, "classic"
# Approve the 2FA notification on your phone (I presume/hope)
# "Note" what it is for, I use ~PHIVE_GH_RATE_LIMIT_BRIANHENRY_EXPIRES_DEC182026 etc.
# Choose "Expiration", "Custom"
# For "Select Date", the Expiration date can only be set ~364 days ahead
# No scopes are needed, scroll down and click "Generate Token"
# Copied the displayed key
# Visit https://github.com/your/repo/settings/secrets/actions
# Click "New repository secret" and fill it in
# Do the same at https://github.com/your/repo/settings/secrets/dependabot
#
# Fix for rate limited GitHub API requests. See https://github.com/phar-io/phive/issues/384#issuecomment-1337064012
GITHUB_AUTH_TOKEN: ${{ secrets.PHIVE_GH_RATE_LIMIT_BRIANHENRY_EXPIRES_DEC182026 }}

- name: Install Phive tools (unauthenticated)
# secrets are not available to users without write access
if: ${{ github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'OWNER' }}
run: |
phive install --trust-gpg-keys A9DB489A9190DE9B,4AA394086372C20A
phive status

- name: Setup problem matcher for PHPUnit
run: |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
Expand All @@ -87,7 +56,7 @@ jobs:
composer --version

- name: Install dependencies
run: composer install --prefer-dist --no-progress
run: composer install --prefer-dist --verbose

- name: Run previously workflows' failed tests first
uses: BrianHenryIE/bh-phpunit-failed-tests-action@main
Expand Down Expand Up @@ -142,40 +111,9 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer, cs2pr, phive
tools: composer:v2, cs2pr
extensions: fileinfo, gd

- name: Install Phive tools
if: ${{ github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'OWNER' }} # secrets are not available to users without write access
# Keys taken from `phive status`
# `phive status | grep -oE '[A-F0-9]{16}' | tr '\n' ',' | sed 's/,$//'`
# sed -i "s|^\s*phive install --trust-gpg-keys .*| phive install --trust-gpg-keys $(phive status | grep -oE '[A-F0-9]{16}' | paste -sd,)|" .github/workflows/phpstan.yml
run: |
phive install --trust-gpg-keys A9DB489A9190DE9B,4AA394086372C20A
phive status
env:
# We need to be authenticated to skip GitHub rate limits
# Generate a key at: https://github.com/settings/tokens, "classic"
# Approve the 2FA notification on your phone (I presume/hope)
# "Note" what it is for, I use ~PHIVE_GH_RATE_LIMIT_BRIANHENRY_EXPIRES_DEC182026 etc.
# Choose "Expiration", "Custom"
# For "Select Date", the Expiration date can only be set ~364 days ahead
# No scopes are needed, scroll down and click "Generate Token"
# Copied the displayed key
# Visit https://github.com/your/repo/settings/secrets/actions
# Click "New repository secret" and fill it in
# Do the same at https://github.com/your/repo/settings/secrets/dependabot
#
# Fix for rate limited GitHub API requests. See https://github.com/phar-io/phive/issues/384#issuecomment-1337064012
GITHUB_AUTH_TOKEN: ${{ secrets.PHIVE_GH_RATE_LIMIT_BRIANHENRY_EXPIRES_DEC182026 }}

- name: Install Phive tools (unauthenticated)
# secrets are not available to users without write access
if: ${{ github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'OWNER' }}
run: |
phive install --trust-gpg-keys A9DB489A9190DE9B,4AA394086372C20A
phive status

- name: Debugging
run: |
php --version
Expand Down
39 changes: 4 additions & 35 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,10 @@ jobs:
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
with:
php-version: 7.4
tools: composer:v2, phive, cs2pr
tools: composer:v2, cs2pr
extensions: fileinfo, gd
coverage: none

- name: Install Phive tools
if: ${{ github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'OWNER' }}
# Keys taken from `phive status`
# `phive status | grep -oE '[A-F0-9]{16}' | tr '\n' ',' | sed 's/,$//'`
# sed -i "s|^\s*phive install --trust-gpg-keys .*| phive install --trust-gpg-keys $(phive status | grep -oE '[A-F0-9]{16}' | paste -sd,)|" .github/workflows/phpstan.yml
run: |
phive install --trust-gpg-keys A9DB489A9190DE9B,4AA394086372C20A
phive status
env:
# We need to be authenticated to skip GitHub rate limits
# Generate a key at: https://github.com/settings/tokens, "classic"
# Approve the 2FA notification on your phone (I presume/hope)
# "Note" what it is for, I use ~PHIVE_GH_RATE_LIMIT_BRIANHENRY_EXPIRES_DEC182026 etc.
# Choose "Expiration", "Custom"
# For "Select Date", the Expiration date can only be set ~364 days ahead
# No scopes are needed, scroll down and click "Generate Token"
# Copied the displayed key
# Visit https://github.com/your/repo/settings/secrets/actions
# Click "New repository secret" and fill it in
# Do the same at https://github.com/your/repo/settings/secrets/dependabot
#
# Fix for rate limited GitHub API requests. See https://github.com/phar-io/phive/issues/384#issuecomment-1337064012
GITHUB_AUTH_TOKEN: ${{ secrets.PHIVE_GH_RATE_LIMIT_BRIANHENRY_EXPIRES_DEC182026 }}

- name: Install Phive tools (unauthenticated)
# secrets are not available to users without write access
if: ${{ github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'OWNER' }}
run: |
phive install --trust-gpg-keys A9DB489A9190DE9B,4AA394086372C20A
phive status

- name: Install Project Dependencies
run: composer install

Expand All @@ -77,11 +46,11 @@ jobs:
- name: Get PhpStan level
id: phpstan-level
run: |
# After adding the example commands at the top of the phpstan.neon file, which contain the word "level", we
# now have to use `tail`+`head` to skip the first few lines. (I'm sure there's a suitable regex, but this is
# After adding the example commands at the top of the phpstan.neon file, which contain the word "level", we
# now have to use `tail`+`head` to skip the first few lines. (I'm sure there's a suitable regex, but this is
# easy to implement and follow)
LEVEL=$(tail -n +3 phpstan.neon | head -n 10 | grep level | sed "s/[^0-9]*//")
echo "level=$LEVEL" >> "$GITHUB_OUTPUT"
echo "level=$LEVEL" >> "$GITHUB_OUTPUT"

- name: Check success
if: steps.run-phpstan.outcome == 'success'
Expand Down
33 changes: 1 addition & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,9 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2, phive
tools: composer:v2
extensions: fileinfo, gd

- name: Install Phive tools
if: ${{ github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'OWNER' }} # secrets are not available to users without write access
# Keys taken from `phive status`
# `phive status | grep -oE '[A-F0-9]{16}' | tr '\n' ',' | sed 's/,$//'`
# sed -i "s|^\s*phive install --trust-gpg-keys .*| phive install --trust-gpg-keys $(phive status | grep -oE '[A-F0-9]{16}' | paste -sd,)|" .github/workflows/phpstan.yml
run: |
phive install --trust-gpg-keys A9DB489A9190DE9B,4AA394086372C20A
phive status
env:
# We need to be authenticated to skip GitHub rate limits
# Generate a key at: https://github.com/settings/tokens, "classic"
# Approve the 2FA notification on your phone (I presume/hope)
# "Note" what it is for, I use ~PHIVE_GH_RATE_LIMIT_BRIANHENRY_EXPIRES_DEC182026 etc.
# Choose "Expiration", "Custom"
# For "Select Date", the Expiration date can only be set ~364 days ahead
# No scopes are needed, scroll down and click "Generate Token"
# Copied the displayed key
# Visit https://github.com/your/repo/settings/secrets/actions
# Click "New repository secret" and fill it in
# Do the same at https://github.com/your/repo/settings/secrets/dependabot
#
# Fix for rate limited GitHub API requests. See https://github.com/phar-io/phive/issues/384#issuecomment-1337064012
GITHUB_AUTH_TOKEN: ${{ secrets.PHIVE_GH_RATE_LIMIT_BRIANHENRY_EXPIRES_DEC182026 }}

- name: Install Phive tools (unauthenticated)
# secrets are not available to users without write access
if: ${{ github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'OWNER' }}
run: |
phive install --trust-gpg-keys A9DB489A9190DE9B,4AA394086372C20A
phive status

- name: Install dependencies
run: composer install --no-dev --prefer-dist --no-progress

Expand Down
5 changes: 0 additions & 5 deletions .phive/phars.xml

This file was deleted.

46 changes: 23 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@
"minimum-stability": "dev",
"prefer-stable": true,
"license": "MIT",
"repositories": {
"composer/composer": {
"type": "vcs",
"url": "https://github.com/brianhenryie/composer"
}
},
"require": {
"ext-json": "*",
"brianhenryie/simple-php-code-parser": "^0.15.3",
"composer-runtime-api": "^2.0",
"composer/class-map-generator": "^1.6.0",
"composer/composer": "^2.6.0",
"elazar/flystream": "^0.5.0|^1",
"composer/composer": "dev-main#4b766fabec26294c1aebbd828d359de642bf3099",
"composer-runtime-api": "^2.0",
"elazar/flystream": "^0.6.0|^1.4",
"json-mapper/json-mapper": "^2.0.0",
"league/flysystem": "^2.1|^3.0",
"league/flysystem-memory": "*",
Expand Down Expand Up @@ -65,6 +71,16 @@
"phpunit/phpunit": "^9|^10",
"squizlabs/php_codesniffer": "^3.5"
},
"extra": {
"patches": {
"composer/composer": {
"Improve stream wrapper support": "https://github.com/composer/composer/pull/12396.patch"
},
"elazar/flystream": {
"Catch exceptions; return false ": "https://github.com/elazar/flystream/pull/17.patch"
}
}
},
"conflict": {
"json-mapper/json-mapper": "2.23.0 | 2.24.0"
},
Expand All @@ -86,11 +102,6 @@
"phpcs || true",
"@analyze"
],
"cs-fix": [
"phpcbf || true",
"phpcs || true",
"@analyze"
],
"cs-changes": [
"updated_files=$(echo $(git diff --name-only `git merge-base origin/master HEAD` | grep php | tr '\\n' '\\0' | xargs -0 ls -1df 2>/dev/null)); if [ -n \"$updated_files\" ]; then phpcbf $updated_files || true; phpcs $updated_files || true; else echo \"No modified php files.\"; fi;",
"@analyze-changes"
Expand All @@ -99,6 +110,10 @@
"updated_files=$(echo $(git diff --name-only `git merge-base origin/master HEAD` | grep php | tr '\\n' '\\0' | xargs -0 ls -1df 2>/dev/null)); if [ -n \"$updated_files\" ]; then phpcbf $updated_files || true; phpcs $updated_files || true; else echo \"No modified php files.\"; fi;",
"@analyze-changes-strict"
],
"cs-fix": [
"phpcbf || true",
"@cs"
],
"install-phive-dependencies": [
"if [ -z \"$(command -v phive)\" ]; then echo \"Phive is not installed. Run 'brew install gpg phive' or see https://phar.io/.\"; exit 1; fi;",
"phive install"
Expand All @@ -107,21 +122,6 @@
"Composer\\Config::disableProcessTimeout",
"phpunit --stop-on-failure --order-by=random"
],
"test-changes": [
"if [ -z \"$(command -v ./tools/php-diff-test)\" ]; then echo \"Please install 'php-diff-test' with 'phive install'.\"; exit 1; fi;",
"if [ \"$XDEBUG_MODE\" != \"coverage\" ]; then echo 'Run with XDEBUG_MODE=coverage composer test-changes'; exit 1; fi;",
"phpunit --filter=\"$(./tools/php-diff-test filter --input-files tests/_reports/php.cov --granularity=line)\" --coverage-text;"
],
"test-changes-report": [
"if [ -z \"$(command -v ./tools/php-diff-test)\" ]; then echo \"Please install 'php-diff-test' with 'phive install'.\"; exit 1; fi;",
"if [ -z \"$(command -v ./tools/phpcov)\" ]; then echo \"Please install 'phpcov' with 'phive install'.\"; exit 1; fi;",
"if [ \"$XDEBUG_MODE\" != \"coverage\" ]; then echo 'Run with XDEBUG_MODE=coverage composer test-changes-report'; exit 1; fi;",
"if [ -d \"tests/_reports/diff\" ]; then rm -rf tests/_reports/diff; fi;",
"phpunit --filter=\"$(./tools/php-diff-test filter --input-files tests/_reports/php.cov --granularity file)\" --coverage-text --coverage-php tests/_reports/diff/php.cov -d memory_limit=-1;",
"./tools/php-diff-test coverage --input-files tests/_reports/diff/php.cov --output-file tests/_reports/diff/php.cov;",
"./tools/phpcov merge tests/_reports/diff --html tests/_reports/diff/html;",
"open tests/_reports/diff/html/index.html"
],
"test-coverage": [
"Composer\\Config::disableProcessTimeout",
"if [ \"$XDEBUG_MODE\" != \"coverage\" ]; then echo \"Run with 'XDEBUG_MODE=coverage composer test-coverage'\"; exit 1; fi;",
Expand Down
Loading
Loading