Skip to content

Commit e2b5b5f

Browse files
martinjindajiripudil
authored andcommitted
fix() rename proxy to publicUrl + replace if set with null-coalescing operator
1 parent 34d6de1 commit e2b5b5f

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/DI/WebpackExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class WebpackExtension extends CompilerExtension
3838
'devServer' => [
3939
'enabled' => NULL,
4040
'url' => NULL,
41-
'proxy' => NULL,
41+
'publicUrl' => NULL,
4242
'timeout' => 0.1,
4343
'ignoredAssets' => [],
4444
],
@@ -97,7 +97,7 @@ public function loadConfiguration(): void
9797
->setFactory(DevServer::class, [
9898
$config['devServer']['enabled'],
9999
$config['devServer']['url'] ?? '',
100-
$config['devServer']['proxy'] ?? '',
100+
$config['devServer']['publicUrl'] ?? '',
101101
$config['devServer']['timeout'],
102102
new Statement(Client::class),
103103
]);
@@ -175,7 +175,7 @@ private function setupAssetResolver(array $config): ServiceDefinition
175175
$devServerInstance = new DevServer(
176176
$config['devServer']['enabled'],
177177
$config['devServer']['url'] ?? '',
178-
$config['devServer']['proxy'] ?? '',
178+
$config['devServer']['publicUrl'] ?? '',
179179
$config['devServer']['timeout'] ?? 0.1,
180180
new Client()
181181
);

src/DevServer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DevServer
2929
/**
3030
* @var string
3131
*/
32-
private $proxy;
32+
private $publicUrl;
3333

3434
/**
3535
* @var float
@@ -42,19 +42,19 @@ class DevServer
4242
private $httpClient;
4343

4444

45-
public function __construct(bool $enabled, string $url, string $proxy, float $timeout, ClientInterface $httpClient)
45+
public function __construct(bool $enabled, string $url, string $publicUrl, float $timeout, ClientInterface $httpClient)
4646
{
4747
$this->enabled = $enabled;
4848
$this->url = $url;
49-
$this->proxy = $proxy;
49+
$this->publicUrl = $publicUrl;
5050
$this->timeout = $timeout;
5151
$this->httpClient = $httpClient;
5252
}
5353

5454

5555
public function getUrl(): string
5656
{
57-
return $this->proxy ? $this->proxy : $this->url;
57+
return $this->publicUrl ?? $this->url;
5858
}
5959

6060

0 commit comments

Comments
 (0)