src/File/FileTrait.php
protected function isFileEmpty($value, $file = null)
    {
        $source   = null;
        $filename = null;

        if (is_string($value) && is_array($file)) {
            // Legacy Zend\Transfer API support
            $filename = $file['name'];
            $source   = $file['tmp_name'];
        } elseif (is_array($value)) {
            /** @noinspection UnSafeIsSetOverArrayInspection */
            if (isset($value['tmp_name'])) {
                $source = $value['tmp_name'];
            }

            /** @noinspection UnSafeIsSetOverArrayInspection */
            if (isset($value['name'])) {
                $filename = $value['name'];
            }
        } else {
            $source   = $value;
            $filename = basename($source);
        }

        /** @noinspection IsEmptyFunctionUsageInspection */
        return empty($source) || empty($filename);
    }
protected function isFileEmpty($value, $file = null)
    {
        $source   = null;
        $filename = null;

        if (is_string($value) && is_array($file)) {
            // Legacy Zend\Transfer API support
            $filename = $file['name'];
            $source   = $file['tmp_name'];
        } elseif (is_array($value)) {
            /** @noinspection UnSafeIsSetOverArrayInspection */
            if (isset($value['tmp_name'])) {
                $source = $value['tmp_name'];
            }

            /** @noinspection UnSafeIsSetOverArrayInspection */
            if (isset($value['name'])) {
                $filename = $value['name'];
            }
        } else {
            $source   = $value;
            $filename = basename($source);
        }

        /** @noinspection IsEmptyFunctionUsageInspection */
        return empty($source) || empty($filename);
    }
protected function isFileEmpty ( $ value , $ file = null ) { $ source = null ; $ filename = null ; if ( is_string ( $ value ) && is_array ( $ file ) ) { // Legacy Zend\Transfer API support $ filename = $ file [ 'name' ] ; $ source = $ file [ 'tmp_name' ] ; } elseif ( is_array ( $ value ) ) { /** @noinspection UnSafeIsSetOverArrayInspection */ if ( isset ( $ value [ 'tmp_name' ] ) ) { $ source = $ value [ 'tmp_name' ] ; } /** @noinspection UnSafeIsSetOverArrayInspection */ if ( isset ( $ value [ 'name' ] ) ) { $ filename = $ value [ 'name' ] ; } } else { $ source = $ value ; $ filename = basename ( $ source ) ; } /** @noinspection IsEmptyFunctionUsageInspection */ return empty ( $ source ) || empty ( $ filename ) ; }
Indicates whether the file is defined.

@param string|array $value Real file to check.
@param array        $file  File data from {@link \Zend\File\Transfer\Transfer} (optional).

@return bool
Indicates whether the file is defined .