File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,10 @@ protected function getCasters()
131
131
$ casters ['Illuminate\Database\Eloquent\Model ' ] = 'Laravel\Tinker\TinkerCaster::castModel ' ;
132
132
}
133
133
134
+ if (class_exists ('Illuminate\Process\ProcessResult ' )) {
135
+ $ casters ['Illuminate\Process\ProcessResult ' ] = 'Laravel\Tinker\TinkerCaster::castProcessResult ' ;
136
+ }
137
+
134
138
if (class_exists ('Illuminate\Foundation\Application ' )) {
135
139
$ casters ['Illuminate\Foundation\Application ' ] = 'Laravel\Tinker\TinkerCaster::castApplication ' ;
136
140
}
Original file line number Diff line number Diff line change @@ -94,6 +94,22 @@ public static function castStringable($stringable)
94
94
];
95
95
}
96
96
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
+
97
113
/**
98
114
* Get an array representing the properties of a model.
99
115
*
You can’t perform that action at this time.
0 commit comments