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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/composer.lock
/phpstan.neon
/vendor
7 changes: 7 additions & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ To run a single test use PHPUnit's `--filter` option:
```
ddev exec phpunit ./tests --debug --filter=testCannotProtectNonComposerRepository
```

## Static analysis

To run PHPStan against the codebase:
```
ddev composer phpstan
```
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
},
"autoload-dev": {
"psr-4": {
"Tuf\\ComposerIntegration\\Tests\\": "tests/"
"Tuf\\ComposerIntegration\\Tests\\": "tests/",
"Tuf\\Tests\\": "vendor/php-tuf/php-tuf/tests/"
}
},
"extra": {
Expand All @@ -37,9 +38,11 @@
"composer/composer": "^2.9",
"phpunit/phpunit": "^9.5",
"symfony/process": "^6",
"dms/phpunit-arraysubset-asserts": "^0.5.0"
"dms/phpunit-arraysubset-asserts": "^0.5.0",
"phpstan/phpstan": "^2.1"
},
"scripts": {
"phpstan": "phpstan",
"test": [
"phpunit ./tests --debug"
]
Expand Down
5 changes: 5 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 0
paths:
- src
- tests
2 changes: 1 addition & 1 deletion src/ComposerFileStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ComposerFileStorage extends FileStorage
/**
* {@inheritDoc}
*/
public function __construct(string $basePath)
final public function __construct(string $basePath)
{
(new Filesystem())->ensureDirectoryExists($basePath);
parent::__construct($basePath);
Expand Down
4 changes: 0 additions & 4 deletions tests/FunctionalTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ protected function setUp(): void
$this->workingDir = uniqid(sys_get_temp_dir() . '/');
mkdir($this->workingDir . '/tuf', recursive: true);

// Make PHP-TUF's fixture builder available.
$loaders = ClassLoader::getRegisteredLoaders();
reset($loaders)->addPsr4('Tuf\\Tests\\', key($loaders) . '/php-tuf/php-tuf/tests');

// Generate the fixture.
$this->fixture = new Fixture($this->workingDir);
$this->fixture->root->consistentSnapshot = true;
Expand Down
Loading