@@ -189,7 +189,7 @@ object, which is what's returned after a ``file`` field is submitted::
189
189
public function upload()
190
190
{
191
191
// the file property can be empty if the field is not required
192
- if (empty( $this->file) ) {
192
+ if (null === $this->file) {
193
193
return;
194
194
}
195
195
@@ -246,7 +246,7 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
246
246
*/
247
247
public function preUpload()
248
248
{
249
- if (!empty( $this->file) ) {
249
+ if (null !== $this->file) {
250
250
// do whatever you want to generate a unique name
251
251
$this->setPath(uniq().'.'.$this->file->guessExtension());
252
252
}
@@ -257,7 +257,7 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
257
257
*/
258
258
public function upload()
259
259
{
260
- if (empty( $this->file) ) {
260
+ if (null === $this->file) {
261
261
return;
262
262
}
263
263
@@ -304,7 +304,7 @@ property, instead of the actual filename::
304
304
*/
305
305
public function preUpload()
306
306
{
307
- if (!empty( $this->file) ) {
307
+ if (null !== $this->file) {
308
308
$this->setPath($this->file->guessExtension());
309
309
}
310
310
}
@@ -314,7 +314,7 @@ property, instead of the actual filename::
314
314
*/
315
315
public function upload()
316
316
{
317
- if (empty( $this->file) ) {
317
+ if (null === $this->file) {
318
318
return;
319
319
}
320
320
0 commit comments