Skip to content

Commit 4419683

Browse files
committed
bump
1 parent f29901b commit 4419683

18 files changed

Lines changed: 82 additions & 164 deletions

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
php: [ '7.4', '8.0', '8.1' ]
18+
php: [ '8.1', '8.2', '8.3' ]
1919
latte: [ '', '--prefer-lowest' ]
2020
fail-fast: false
2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v4
2323
- uses: shivammathur/setup-php@v2
2424
with:
2525
php-version: ${{ matrix.php }}
@@ -32,10 +32,10 @@ jobs:
3232
coverage:
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v4
3636
- uses: shivammathur/setup-php@v2
3737
with:
38-
php-version: '8.0'
38+
php-version: '8.3'
3939
extensions: curl, iconv, json, mbstring, tokenizer
4040
coverage: pcov
4141
- run: composer install --no-interaction
@@ -45,21 +45,21 @@ jobs:
4545
phpstan:
4646
runs-on: ubuntu-latest
4747
steps:
48-
- uses: actions/checkout@v2
48+
- uses: actions/checkout@v4
4949
- uses: shivammathur/setup-php@v2
5050
with:
51-
php-version: '8.0'
51+
php-version: '8.3'
5252
coverage: none
5353
- run: composer install --no-interaction
5454
- run: make phpstan
5555

5656
coding-standard:
5757
runs-on: ubuntu-latest
5858
steps:
59-
- uses: actions/checkout@v2
59+
- uses: actions/checkout@v4
6060
- uses: shivammathur/setup-php@v2
6161
with:
62-
php-version: '8.0'
62+
php-version: '8.3'
6363
coverage: none
6464
- run: composer install --no-interaction
6565
- run: make cs

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ csf:
1212
vendor/bin/ecs check src tests --fix
1313

1414
phpstan:
15-
vendor/bin/phpstan analyze -l max src
15+
vendor/bin/phpstan analyze -l 8 src
1616

1717
tests:
1818
vendor/bin/tester -C tests

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ For details on how to use this package, check out our [documentation](.docs).
3535

3636
| State | Version | Branch | Nette | PHP |
3737
|-------------|--------------|----------|----------|----------|
38-
| dev | `^2.0.x-dev` | `master | `3.0+` | `>= 7.4` |
39-
| stable | `^2.0` | `master` | `3.0+` | `>= 7.4` |
38+
| dev | `^2.0.x-dev` | `master` | `3.0+` | `>= 8.1` |
39+
| stable | `^2.0` | `master` | `3.0+` | `>= 8.1` |
4040

4141
## Development
4242

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"issues": "https://github.com/contributte/webpack/issues"
2121
},
2222
"require": {
23-
"php": ">=7.4",
23+
"php": ">=8.1",
2424
"ext-curl": "*",
2525
"nette/di": "^3.0"
2626
},
@@ -29,8 +29,8 @@
2929
"nette/application": "^3.0",
3030
"nette/bootstrap": "^3.0",
3131
"nette/tester": "^2.0",
32-
"phpstan/phpstan": "^0.12",
33-
"symplify/easy-coding-standard": "^8.3",
32+
"phpstan/phpstan": "^1.0",
33+
"symplify/easy-coding-standard": "^12.0",
3434
"tracy/tracy": "^2.4"
3535
},
3636
"suggest": {

ecs.php

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,21 @@
22

33
declare(strict_types=1);
44

5-
use PhpCsFixer\Fixer\Basic\BracesFixer;
65
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
76
use PhpCsFixer\Fixer\Phpdoc\PhpdocLineSpanFixer;
87
use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer;
9-
use SlevomatCodingStandard\Sniffs\Variables\UnusedVariableSniff;
10-
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
8+
use Symplify\EasyCodingStandard\Config\ECSConfig;
119
use Symplify\EasyCodingStandard\ValueObject\Option;
1210
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
1311

14-
return static function (ContainerConfigurator $containerConfigurator): void {
15-
$services = $containerConfigurator->services();
16-
$parameters = $containerConfigurator->parameters();
12+
return static function (ECSConfig $ecsConfig): void {
13+
$ecsConfig->fileExtensions(['php', 'phpt']);
14+
$ecsConfig->skip(['temp/*']);
1715

18-
$parameters->set(Option::FILE_EXTENSIONS, ['php', 'phpt']);
19-
$parameters->set(Option::EXCLUDE_PATHS, ['temp/*']);
16+
$ecsConfig->sets([SetList::CLEAN_CODE, SetList::PSR_12]);
17+
$ecsConfig->indentation(Option::INDENTATION_TAB);
2018

21-
$parameters->set(Option::INDENTATION, Option::INDENTATION_TAB);
22-
$parameters->set(Option::SETS, [SetList::CLEAN_CODE, SetList::PSR_12, SetList::PHP_71, SetList::PHP_73_MIGRATION]);
23-
$services->set(SingleQuoteFixer::class);
24-
$services->set(ClassAttributesSeparationFixer::class);
25-
$services->set(PhpdocLineSpanFixer::class)
26-
->call('configure', [[
27-
'property' => 'single'
28-
]]);
29-
30-
$parameters->set(Option::SKIP, [
31-
UnusedVariableSniff::class => [
32-
__DIR__ . '/src/Debugging/WebpackPanel.php',
33-
],
34-
BracesFixer::class => [
35-
__DIR__ . '/src/Debugging/WebpackPanel.php',
36-
],
37-
]);
19+
$ecsConfig->rule(SingleQuoteFixer::class);
20+
$ecsConfig->rule(ClassAttributesSeparationFixer::class);
21+
$ecsConfig->ruleWithConfiguration(PhpdocLineSpanFixer::class, ['property' => 'single']);
3822
};

src/AssetLocator.php

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,16 @@
99

1010
final class AssetLocator
1111
{
12-
private BuildDirectoryProvider $directoryProvider;
13-
14-
private PublicPathProvider $publicPathProvider;
15-
16-
private AssetNameResolverInterface $assetResolver;
17-
18-
private DevServer $devServer;
19-
20-
/** @var string[] */
21-
private array $ignoredAssetNames;
22-
2312
/**
2413
* @param string[] $ignoredAssetNames
2514
*/
2615
public function __construct(
27-
BuildDirectoryProvider $directoryProvider,
28-
PublicPathProvider $publicPathProvider,
29-
AssetNameResolverInterface $assetResolver,
30-
DevServer $devServer,
31-
array $ignoredAssetNames
16+
private readonly BuildDirectoryProvider $directoryProvider,
17+
private readonly PublicPathProvider $publicPathProvider,
18+
private readonly AssetNameResolverInterface $assetResolver,
19+
private readonly DevServer $devServer,
20+
private readonly array $ignoredAssetNames,
3221
) {
33-
$this->directoryProvider = $directoryProvider;
34-
$this->publicPathProvider = $publicPathProvider;
35-
$this->assetResolver = $assetResolver;
36-
$this->devServer = $devServer;
37-
$this->ignoredAssetNames = $ignoredAssetNames;
3822
}
3923

4024
private function locateInPath(string $path, string $asset): string
@@ -64,6 +48,6 @@ public function locateInBuildDirectory(string $asset): string
6448

6549
private function isAbsoluteUrl(string $url): bool
6650
{
67-
return strpos($url, '://') !== false || substr($url, 0, 2) === '//';
51+
return \str_contains($url, '://') || \str_starts_with($url, '//');
6852
}
6953
}

src/AssetNameResolver/DebuggerAwareAssetNameResolver.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66

77
final class DebuggerAwareAssetNameResolver implements AssetNameResolverInterface
88
{
9-
private AssetNameResolverInterface $inner;
10-
119
/** @var array<array{string, string}> */
1210
private array $resolvedAssets = [];
1311

14-
public function __construct(AssetNameResolverInterface $inner)
15-
{
16-
$this->inner = $inner;
12+
public function __construct(
13+
private readonly AssetNameResolverInterface $inner,
14+
) {
1715
}
1816

1917
public function resolveAssetName(string $asset): string

src/AssetNameResolver/ManifestAssetNameResolver.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@
99

1010
final class ManifestAssetNameResolver implements AssetNameResolverInterface
1111
{
12-
private string $manifestName;
13-
14-
private ManifestLoader $loader;
15-
1612
/** @var array<string, string>|null */
1713
private ?array $manifestCache = null;
1814

19-
public function __construct(string $manifestName, ManifestLoader $loader)
20-
{
21-
$this->manifestName = $manifestName;
22-
$this->loader = $loader;
15+
public function __construct(
16+
private readonly string $manifestName,
17+
private readonly ManifestLoader $loader,
18+
) {
2319
}
2420

2521
public function resolveAssetName(string $asset): string

src/AssetNameResolver/StaticAssetNameResolver.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66

77
final class StaticAssetNameResolver implements AssetNameResolverInterface
88
{
9-
/** @var array<string, string> */
10-
private array $resolutions;
11-
129
/**
1310
* @param array<string, string> $resolutions
1411
*/
15-
public function __construct(array $resolutions)
16-
{
17-
$this->resolutions = $resolutions;
12+
public function __construct(
13+
private readonly array $resolutions,
14+
) {
1815
}
1916

2017
public function resolveAssetName(string $asset): string

src/BasePath/NetteHttpBasePathProvider.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88

99
final class NetteHttpBasePathProvider implements BasePathProvider
1010
{
11-
private IRequest $httpRequest;
12-
13-
public function __construct(IRequest $httpRequest)
14-
{
15-
$this->httpRequest = $httpRequest;
11+
public function __construct(
12+
private readonly IRequest $httpRequest,
13+
) {
1614
}
1715

1816
public function getBasePath(): string

0 commit comments

Comments
 (0)