@@ -36,7 +36,7 @@ class File implements WithJsonSchemaInterface
36
36
/**
37
37
* @var string|null The base64 data for inline files.
38
38
*/
39
- private ?string $ data = null ;
39
+ private ?string $ base64Data = null ;
40
40
41
41
/**
42
42
* Constructor.
@@ -78,7 +78,7 @@ private function detectAndProcessFile(string $file, ?string $providedMimeType):
78
78
79
79
if (preg_match ($ dataUriPattern , $ file , $ matches )) {
80
80
$ this ->fileType = FileTypeEnum::inline ();
81
- $ this ->data = $ matches [2 ]; // Extract just the base64 data
81
+ $ this ->base64Data = $ matches [2 ]; // Extract just the base64 data
82
82
$ extractedMimeType = empty ($ matches [1 ]) ? null : $ matches [1 ];
83
83
$ this ->mimeType = $ this ->determineMimeType ($ providedMimeType , $ extractedMimeType , null );
84
84
return ;
@@ -92,15 +92,15 @@ private function detectAndProcessFile(string $file, ?string $providedMimeType):
92
92
);
93
93
}
94
94
$ this ->fileType = FileTypeEnum::inline ();
95
- $ this ->data = $ file ;
95
+ $ this ->base64Data = $ file ;
96
96
$ this ->mimeType = new MimeType ($ providedMimeType );
97
97
return ;
98
98
}
99
99
100
100
// If none of the above, assume it's a local file path
101
101
if (file_exists ($ file )) {
102
102
$ this ->fileType = FileTypeEnum::inline ();
103
- $ this ->data = $ this ->convertFileToBase64 ($ file );
103
+ $ this ->base64Data = $ this ->convertFileToBase64 ($ file );
104
104
$ this ->mimeType = $ this ->determineMimeType ($ providedMimeType , null , $ file );
105
105
return ;
106
106
}
@@ -179,7 +179,7 @@ public function getUrl(): ?string
179
179
*/
180
180
public function getBase64Data (): ?string
181
181
{
182
- return $ this ->data ;
182
+ return $ this ->base64Data ;
183
183
}
184
184
185
185
/**
@@ -191,11 +191,11 @@ public function getBase64Data(): ?string
191
191
*/
192
192
public function getDataUri (): ?string
193
193
{
194
- if ($ this ->data === null ) {
194
+ if ($ this ->base64Data === null ) {
195
195
return null ;
196
196
}
197
197
198
- return sprintf ('data:%s;base64,%s ' , $ this ->getMimeType (), $ this ->data );
198
+ return sprintf ('data:%s;base64,%s ' , $ this ->getMimeType (), $ this ->base64Data );
199
199
}
200
200
201
201
/**
0 commit comments