File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,10 @@ protected function getCasters()
131131 $ casters ['Illuminate\Database\Eloquent\Model ' ] = 'Laravel\Tinker\TinkerCaster::castModel ' ;
132132 }
133133
134+ if (class_exists ('Illuminate\Process\ProcessResult ' )) {
135+ $ casters ['Illuminate\Process\ProcessResult ' ] = 'Laravel\Tinker\TinkerCaster::castProcessResult ' ;
136+ }
137+
134138 if (class_exists ('Illuminate\Foundation\Application ' )) {
135139 $ casters ['Illuminate\Foundation\Application ' ] = 'Laravel\Tinker\TinkerCaster::castApplication ' ;
136140 }
Original file line number Diff line number Diff line change @@ -94,6 +94,22 @@ public static function castStringable($stringable)
9494 ];
9595 }
9696
97+ /**
98+ * Get an array representing the properties of a process result.
99+ *
100+ * @param \Illuminate\Process\ProcessResult $result
101+ * @return array
102+ */
103+ public static function castProcessResult ($ result )
104+ {
105+ return [
106+ Caster::PREFIX_VIRTUAL .'output ' => $ result ->output (),
107+ Caster::PREFIX_VIRTUAL .'errorOutput ' => $ result ->errorOutput (),
108+ Caster::PREFIX_VIRTUAL .'exitCode ' => $ result ->exitCode (),
109+ Caster::PREFIX_VIRTUAL .'successful ' => $ result ->successful (),
110+ ];
111+ }
112+
97113 /**
98114 * Get an array representing the properties of a model.
99115 *
You can’t perform that action at this time.
0 commit comments