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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ return new class implements ConfigInterface
};
```

### Configuration with Twig Extension
### Usage with Twig Extension
If you're using Twig, register the extension and enable Twig integration:

```php
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^v3.93",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^13",
"twig/twig": "^3"
},
Expand Down
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon

parameters:
level: 8
tmpDir: var/phpstan
Expand All @@ -6,6 +9,11 @@ parameters:
- tests

reportUnmatchedIgnoredErrors: true
checkDynamicProperties: true
reportNonIntStringArrayKey: true
checkMissingOverrideMethodAttribute: true
checkStrictPrintfPlaceholderTypes: true

ignoreErrors:
- identifier: missingType.iterableValue
path: tests/*Test.php
1 change: 1 addition & 0 deletions tests/Asset/AssetFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ final class AssetFactoryTest extends TestCase
{
private AssetFactory $factory;

#[\Override]
protected function setUp(): void
{
$this->factory = new AssetFactory();
Expand Down
1 change: 1 addition & 0 deletions tests/Integration/TwigExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ final class TwigExtensionTest extends TestCase
private TwigExtension $extension;
private AssetMapperInterface&MockObject $assetMapper;

#[\Override]
public function setUp(): void
{
$this->assetMapper = $this->createMock(AssetMapperInterface::class);
Expand Down
1 change: 1 addition & 0 deletions tests/Manifest/ManifestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ final class ManifestTest extends TestCase
{
private Manifest $manifest;

#[\Override]
protected function setUp(): void
{
$this->manifest = new Manifest(__DIR__ . '/../manifest.json');
Expand Down
4 changes: 2 additions & 2 deletions tests/Mapper/AssetMapperFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class AssetMapperFactoryTest extends TestCase
public function testCreateManifest(): void
{
$manifestPath = __DIR__ . '/../manifest.json';
$referenceParser = $this->createStub(ReferenceParserInterface::class);
$referenceParser = self::createStub(ReferenceParserInterface::class);
$assetMapper = AssetMapperFactory::create($manifestPath, $referenceParser);
self::assertInstanceOf(ManifestAssetMapper::class, $assetMapper);
}
Expand All @@ -24,7 +24,7 @@ public function testCreateDev(): void
{
putenv('APP_ENV=dev');
$manifestPath = __DIR__ . '/../manifest.json';
$referenceParser = $this->createStub(ReferenceParserInterface::class);
$referenceParser = self::createStub(ReferenceParserInterface::class);
$assetMapper = AssetMapperFactory::create($manifestPath, $referenceParser);
putenv('APP_ENV');
self::assertInstanceOf(DevAssetMapper::class, $assetMapper);
Expand Down
1 change: 1 addition & 0 deletions tests/Mapper/DevAssetMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class DevAssetMapperTest extends TestCase
private MockObject&ReferenceParserInterface $referenceParser;
private DevAssetMapper $mapper;

#[\Override]
protected function setUp(): void
{
$this->referenceParser = $this->createMock(ReferenceParserInterface::class);
Expand Down
1 change: 1 addition & 0 deletions tests/Mapper/ManifestAssetMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ final class ManifestAssetMapperTest extends TestCase
private MockObject&ReferenceParserInterface $referenceParser;
private ManifestAssetMapper $mapper;

#[\Override]
protected function setUp(): void
{
$this->referenceParser = $this->createMock(ReferenceParserInterface::class);
Expand Down
1 change: 1 addition & 0 deletions tests/Mapper/TagProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class TagProviderTest extends TestCase
{
private TagProvider $provider;

#[\Override]
protected function setUp(): void
{
$this->provider = new TagProvider();
Expand Down
4 changes: 2 additions & 2 deletions tests/StasisViteExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testCreate(): void

public function testCreateWithReferenceParser(): void
{
$referenceParser = $this->createStub(ReferenceParserInterface::class);
$referenceParser = self::createStub(ReferenceParserInterface::class);

$extension = StasisViteExtension::createWithReferenceParser(
assetsSourcePath: __DIR__ . '/dist_assets',
Expand All @@ -48,7 +48,7 @@ public function testWithTwig(): void
$twig
->expects($this->once())
->method('addExtension')
->with($this->isInstanceOf(AbstractExtension::class));
->with(self::isInstanceOf(AbstractExtension::class));

$extension = StasisViteExtension::create(
assetsSourcePath: __DIR__ . '/dist_assets',
Expand Down
Loading