<commit_before><?php

namespace luya\admin\file;

use Yii;
use luya\helpers\Url;
use luya\helpers\FileHelper;
use luya\admin\helpers\I18n;
use luya\admin\storage\ItemTrait;

/**
 * Storage File Item.
 *
 * @property string $caption The file caption
 * @property array $captionArray Contains the captions for all languages
 * @property integer $id The File id
 * @property integer $folderId The id of the folder the file is stored in.
 * @property \luya\admin\folder\Item $folder Get the folder item object.
 * @property string $name Get the original file name of the file.
 * @property string $systemFileName The new file name inside the storage folder.
 * @property string $mimeType The MIME type of the file while uploading.
 * @property string $extension The file extension name like jpg, gif, png etc.
 * @property integer $size Size of the file in Bytes.
 * @property string $sizeReadable The humand readable size.
 * @property integer $uploadTimestamp Unix timestamp when the file has been uploaded.
 * @property boolean $isImage Whether the file is of type image or not.
 * @property string $hashName The 8 chars long unique hash name of the file.
 * @property string $source The source url to the file inside the storage folder with nice Urls.
 * @property string $sourceStatic The absolute source url to the file inside the storage folder with nice Urls.
 * @property string $httpSource The raw path to the file inside the storage folder.
 * @property string $serverSource The path to the file on the filesystem of the server.
 * @property boolean $isHidden Whether the file is marked as hidden or not.
 * @property boolean $isDeleted Return whether the file has been removed from the filesytem or not.
 *
 * @author <NAME> <<EMAIL>>
 */
class Item extends \yii\base\Object
{
    use ItemTrait;
    
    private $_imageMimeTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/jpg', 'image/bmp', '	image/tiff'];
    
    private $_caption = null;
    
    /**
     * Set caption for file item, override existings values
     *
     * @param string $text The caption text for this image
     * @since 1.0.0-beta7
     */
    public function setCaption($text)
    {
        $this->_caption = trim($text);
    }
    
    /**
     * Return the caption text for this file, if not defined the item array will be collected
     *
     * @return string The caption text for this image<commit_msg>add fileExists phpdoc property from getter method.<commit_after><?php

namespace luya\admin\file;

use Yii;
use luya\helpers\Url;
use luya\helpers\FileHelper;
use luya\admin\helpers\I18n;
use luya\admin\storage\ItemTrait;

/**
 * Storage File Item.
 *
 * @property string $caption The file caption
 * @property array $captionArray Contains the captions for all languages
 * @property integer $id The File id
 * @property integer $folderId The id of the folder the file is stored in.
 * @property \luya\admin\folder\Item $folder Get the folder item object.
 * @property string $name Get the original file name of the file.
 * @property string $systemFileName The new file name inside the storage folder.
 * @property string $mimeType The MIME type of the file while uploading.
 * @property string $extension The file extension name like jpg, gif, png etc.
 * @property integer $size Size of the file in Bytes.
 * @property string $sizeReadable The humand readable size.
 * @property integer $uploadTimestamp Unix timestamp when the file has been uploaded.
 * @property boolean $isImage Whether the file is of type image or not.
 * @property string $hashName The 8 chars long unique hash name of the file.
 * @property string $source The source url to the file inside the storage folder with nice Urls.
 * @property string $sourceStatic The absolute source url to the file inside the storage folder with nice Urls.
 * @property string $httpSource The raw path to the file inside the storage folder.
 * @property string $serverSource The path to the file on the filesystem of the server.
 * @property boolean $isHidden Whether the file is marked as hidden or not.
 * @property boolean $isDeleted Return whether the file has been removed from the filesytem or not.
 * @property booelan $fileExists Whether the file resource exists in the storage folder or not.
 *
 * @author <NAME> <<EMAIL>>
 */
class Item extends \yii\base\Object
{
    use ItemTrait;
    
    private $_imageMimeTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/jpg', 'image/bmp', '	image/tiff'];
    
    private $_caption = null;
    
    /**
     * Set caption for file item, override existings values
     *
     * @param string $text The caption text for this image
     * @since 1.0.0-beta7
     */
    public function setCaption($text)
    {
        $this->_caption = trim($text);
    }
    
    /**
     * Return the caption text for this file, if not defined the item array will be collected
     *
     * @return string The caption text for this image
{'fraction_non_alphanumeric': 0.08051105252484284, 'fraction_numerical': 0.002839180693571284, 'mean_word_length': 3.5289256198347108, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3287018', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1333, 'n_words': 639}