diff --git a/.gitattributes b/.gitattributes index bb6265e..2f843b6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,11 +1,7 @@ -# Path-based git attributes -# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html - -# Ignore all test and documentation with "export-ignore". -/.gitattributes export-ignore -/.gitignore export-ignore -/.travis.yml export-ignore -/phpunit.xml.dist export-ignore -/.scrutinizer.yml export-ignore -/tests export-ignore -/.editorconfig export-ignore +/.github export-ignore +/tests export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.php-cs-fixer.dist.php export-ignore +/phpstan.neon.dist export-ignore +/phpunit.xml.dist export-ignore diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index cb19b59..82843af 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -9,16 +9,16 @@ on: jobs: php-cs-fixer: name: PHP CS Fixer (PHP ${{ matrix.php-version }}) - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: php-version: - - '8.1' + - '8.4' steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -28,7 +28,7 @@ jobs: tools: cs2pr - name: Install Composer dependencies - uses: ramsey/composer-install@v2 + uses: ramsey/composer-install@v3 - name: Run PHP CS Fixer - run: 'vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr' + run: 'PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr' diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e2e4d1a..e7e2120 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -9,17 +9,17 @@ on: jobs: phpunit: name: PHPUnit (PHP ${{ matrix.php-version }}) - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: php-version: - - '8.1' - - '8.2' + - '8.3' + - '8.4' steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP with pcov uses: shivammathur/setup-php@v2 @@ -28,11 +28,11 @@ jobs: php-version: ${{ matrix.php-version }} - name: Install Composer dependencies - uses: ramsey/composer-install@v2 + uses: ramsey/composer-install@v3 - name: Run PHPUnit run: vendor/bin/phpunit --coverage-clover=coverage.xml - name: Upload to Codecov - uses: codecov/codecov-action@v3 - if: matrix.php-version == '8.1' + uses: codecov/codecov-action@v5 + if: matrix.php-version == '8.4' diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 4d2a3d2..411a38e 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -9,16 +9,16 @@ on: jobs: phpstan: name: PHPStan (PHP ${{ matrix.php-version }}) - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: php-version: - - '8.1' + - '8.4' steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -28,7 +28,7 @@ jobs: tools: cs2pr - name: Install Composer dependencies - uses: ramsey/composer-install@v2 + uses: ramsey/composer-install@v3 - name: Run PHPStan run: 'vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr' diff --git a/CHANGELOG-1.x.md b/CHANGELOG-1.x.md index 0fdc3d1..00bf5a9 100644 --- a/CHANGELOG-1.x.md +++ b/CHANGELOG-1.x.md @@ -1,3 +1,8 @@ +1.1.0 +----- + +* Upgrade PHP requirement to 8.3+ + 1.0.1 ----- diff --git a/README.md b/README.md index 7d19962..183d037 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This package contains a [Flysystem](https://flysystem.thephpleague.com/) adapter ## Installation -This package requires PHP 8.1+ and Flysystem v3. +This package requires PHP 8.3+ and Flysystem v3. You can install the package using composer: diff --git a/composer.json b/composer.json index 78f493f..9620ed0 100644 --- a/composer.json +++ b/composer.json @@ -22,16 +22,16 @@ } ], "require": { - "php": "^8.1", + "php": "^8.3", "league/flysystem": "^3.0", "microsoft/microsoft-graph": "^1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.10.0", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan": "^1.8.2", - "phpunit/phpunit": "^9.5.23", - "symfony/var-dumper": "^6.1" + "friendsofphp/php-cs-fixer": "^3.69.0", + "phpstan/phpstan-deprecation-rules": "^2.0.1", + "phpstan/phpstan": "^2.1.5", + "phpunit/phpunit": "^12.0.3", + "symfony/var-dumper": "^7.2" }, "scripts": { "ci": [ @@ -39,8 +39,8 @@ "@phpstan", "vendor/bin/phpunit --colors=auto" ], - "cs:dry": "php-cs-fixer fix --diff --dry-run --no-interaction --ansi", - "cs:fix": "php-cs-fixer fix --ansi", + "cs:dry": "PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --diff --dry-run --no-interaction --ansi", + "cs:fix": "PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --ansi", "phpstan": "vendor/bin/phpstan analyse --ansi" }, "autoload": { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index f3c9b51..4652c16 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,9 +1,9 @@ includes: - - vendor/phpstan/phpstan/conf/bleedingEdge.neon + - phar://phpstan.phar/conf/bleedingEdge.neon - vendor/phpstan/phpstan-deprecation-rules/rules.neon parameters: paths: - src - tests - level: 5 + level: 6 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ac12b6a..b0f8617 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,20 +1,21 @@ - + ./tests/ - + + + ./ ./tests ./vendor - ./.php-cs-fixer.dist.php - + diff --git a/src/OneDriveAdapter.php b/src/OneDriveAdapter.php index 292fe37..707fe4b 100644 --- a/src/OneDriveAdapter.php +++ b/src/OneDriveAdapter.php @@ -271,7 +271,10 @@ private function applyPathPrefix(string $path): string return '/' . trim($this->prefixer->prefixPath($path), '/'); } - private function upload(string $path, $contents) + /** + * @param string|resource $contents + */ + private function upload(string $path, $contents): void { $filename = basename($path); $path = $this->applyPathPrefix($path); @@ -340,6 +343,9 @@ private function getMetadata(string $path): OneDriveMetadata ); } + /** + * @param array $response + */ private function normalizeResponse(array $response, string $path): StorageAttributes { $path = str_replace('root/children', 'root:/children', $path);