Skip to content

Commit 85fa4da

Browse files
committed
Fix Codestyle
1 parent a67105d commit 85fa4da

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Action/ServeBundleAssetsAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(private string $projectDir)
2424

2525
public function __invoke(string $directory, string $file)
2626
{
27-
$baseDir = $this->projectDir.'/public'. ('/' !== $directory ? '/'.$directory : '');
27+
$baseDir = $this->projectDir.'/public'.('/' !== $directory ? '/'.$directory : '');
2828
$path = realpath($baseDir.'/'.$file);
2929
if (false === $path || !is_readable($path) || is_dir($path) || !str_starts_with($path, $baseDir)) {
3030
throw new NotFoundHttpException();

src/Routing/Loader/ReactPhpBundleLoader.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function supports($resource, $type = null): bool
2929

3030
public function setProjectDir(string $path): void
3131
{
32-
$this->publicPath = rtrim($path, '/') . '/public';
32+
$this->publicPath = rtrim($path, '/').'/public';
3333
}
3434

3535
public function setAssetPaths(array $paths): void
@@ -42,16 +42,16 @@ public function load(mixed $resource, ?string $type = null): RouteCollection
4242
$routes = new RouteCollection();
4343
foreach ($this->assetPaths as $assetPath) {
4444
$target = trim($assetPath, '/');
45-
if (!is_readable($this->publicPath . '/'. $target)) {
46-
user_error('Tried to register "'. $target . '" asset path, but it does not exist or is not readable.', E_USER_WARNING);
45+
if (!is_readable($this->publicPath.'/'.$target)) {
46+
trigger_error('Tried to register "'.$target.'" asset path, but it does not exist or is not readable.', \E_USER_WARNING);
4747
continue;
4848
}
4949

50-
if (is_file($this->publicPath . '/'. $target)) {
50+
if (is_file($this->publicPath.'/'.$target)) {
5151
$routes->add(
52-
name: 'zolex:reactphp_bundle:' . str_replace('/', '_', $target),
52+
name: 'zolex:reactphp_bundle:'.str_replace('/', '_', $target),
5353
route: new Route(
54-
path: '/' . $target,
54+
path: '/'.$target,
5555
defaults: [
5656
'_controller' => 'zolex.reactphp_bundle.serve_bundle_assets_action',
5757
'directory' => '/',
@@ -62,9 +62,9 @@ public function load(mixed $resource, ?string $type = null): RouteCollection
6262
);
6363
} else {
6464
$routes->add(
65-
name: 'zolex:reactphp_bundle:' . str_replace('/', '_', $target),
65+
name: 'zolex:reactphp_bundle:'.str_replace('/', '_', $target),
6666
route: new Route(
67-
path: '/' . $target . '/{file}',
67+
path: '/'.$target.'/{file}',
6868
defaults: [
6969
'_controller' => 'zolex.reactphp_bundle.serve_bundle_assets_action',
7070
'directory' => $target,

0 commit comments

Comments
 (0)