Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 7 additions & 11 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
14 changes: 7 additions & 7 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
8 changes: 4 additions & 4 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
5 changes: 5 additions & 0 deletions CHANGELOG-1.x.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.1.0
-----

* Upgrade PHP requirement to 8.3+

1.0.1
-----

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@
}
],
"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": [
"@cs:dry",
"@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": {
Expand Down
4 changes: 2 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -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
9 changes: 5 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd" colors="true">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" colors="true">
<testsuites>
<testsuite name="Leapt Flysystem OneDrive Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>

<coverage>
<coverage/>

<source>
<include>
<directory>./</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
<file>./.php-cs-fixer.dist.php</file>
</exclude>
</coverage>
</source>
</phpunit>
8 changes: 7 additions & 1 deletion src/OneDriveAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -340,6 +343,9 @@ private function getMetadata(string $path): OneDriveMetadata
);
}

/**
* @param array<mixed> $response
*/
private function normalizeResponse(array $response, string $path): StorageAttributes
{
$path = str_replace('root/children', 'root:/children', $path);
Expand Down
Loading