@@ -48,6 +48,11 @@ class Update extends BaseCommand
4848 */
4949 protected bool $ ignoreScripts = false ;
5050
51+ /**
52+ * Use dry-run mode
53+ */
54+ protected bool $ dryRun = false ;
55+
5156 /**
5257 * Whether this command has already been executed
5358 */
@@ -102,7 +107,8 @@ public function handle(
102107 bool $ lockFileOnly = false ,
103108 bool $ ignorePlatformReqs = false ,
104109 string $ installPreference = 'none ' ,
105- bool $ ignoreScripts = false
110+ bool $ ignoreScripts = false ,
111+ bool $ dryRun = false
106112 ) {
107113 if ($ this ->executed ) {
108114 return ;
@@ -112,6 +118,7 @@ public function handle(
112118 $ this ->lockFileOnly = $ lockFileOnly ;
113119 $ this ->ignorePlatformReqs = $ ignorePlatformReqs ;
114120 $ this ->ignoreScripts = $ ignoreScripts ;
121+ $ this ->dryRun = $ dryRun ;
115122
116123 if (in_array ($ installPreference , [self ::PREFER_NONE , self ::PREFER_DIST , self ::PREFER_SOURCE ])) {
117124 $ this ->installPreference = $ installPreference ;
@@ -166,6 +173,11 @@ public function isSuccessful(): bool
166173 return $ this ->successful === true ;
167174 }
168175
176+ public function getRawOutput (): array
177+ {
178+ return $ this ->rawOutput ;
179+ }
180+
169181 /**
170182 * Returns installed packages.
171183 *
@@ -335,6 +347,10 @@ public function arguments(): array
335347 {
336348 $ arguments = [];
337349
350+ if ($ this ->dryRun ) {
351+ $ arguments ['--dry-run ' ] = true ;
352+ }
353+
338354 if ($ this ->includeDev ) {
339355 $ arguments ['--dev ' ] = true ;
340356 } else {
0 commit comments