Skip to content

Commit be8a20e

Browse files
Fix mounted runtime bootstrap lint
1 parent b2aaa12 commit be8a20e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

inc/Runtime/MountedSandboxBootstrap.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ public static function adopt_workspace_mounts(): void {
111111
return;
112112
}
113113

114-
$workspace_root = rtrim((string) DATAMACHINE_WORKSPACE_PATH, '/');
114+
$workspace_root = rtrim( (string) DATAMACHINE_WORKSPACE_PATH, '/');
115115
$mounts = self::workspace_mounts(self::$context, $workspace_root);
116116
foreach ( $mounts as $mount ) {
117117
if ( ! empty($mount['repo_backed']) ) {
118118
continue;
119119
}
120120

121-
$path = (string) ( $mount['path'] ?? '' );
121+
$path = (string) $mount['path'];
122122
if ( '' === $path || ! is_dir($path) || ! is_dir($path . '/.git') ) {
123123
continue;
124124
}
@@ -155,7 +155,7 @@ private static function workspace_mounts( array $context, string $workspace_root
155155
if ( ! is_array($mount) ) {
156156
continue;
157157
}
158-
$target = rtrim((string) ( $mount['target'] ?? '' ), '/');
158+
$target = rtrim( (string) ( $mount['target'] ?? '' ), '/');
159159
if ( '' === $target || 0 !== strpos($target . '/', $workspace_root . '/') ) {
160160
continue;
161161
}
@@ -170,7 +170,8 @@ private static function workspace_mounts( array $context, string $workspace_root
170170
return $mounts;
171171
}
172172

173-
foreach ( glob($workspace_root . '/*', GLOB_ONLYDIR) ?: array() as $path ) {
173+
$paths = glob($workspace_root . '/*', GLOB_ONLYDIR);
174+
foreach ( false !== $paths ? $paths : array() as $path ) {
174175
$mounts[] = array(
175176
'path' => $path,
176177
'repo_backed' => is_file($path . '/.git'),

0 commit comments

Comments
 (0)