PHP Class FileNamingResolver\NamingStrategy\AbstractHashNamingStrategy

Author: Victor Bocharsky ([email protected])
Inheritance: extends AbstractNamingStrategy
Show file Open project: bocharsky-bw/FileNamingResolver

Protected Properties

Property Type Description
$algorithm Hash algorithm
$partCount Count of parts
$partLength Length of each part

Public Methods

Method Description
__construct ( string $algorithm = self::ALGORITHM_MD5, integer $partCount = 2, integer $partLength = 2 )
getAlgorithm ( ) : string
getPartCount ( ) : integer
getPartLength ( ) : integer
provideNameByHash ( FileInfo $srcFileInfo, string $hash ) : FileInfo

Method Details

__construct() public method

public __construct ( string $algorithm = self::ALGORITHM_MD5, integer $partCount = 2, integer $partLength = 2 )
$algorithm string
$partCount integer
$partLength integer

getAlgorithm() public method

public getAlgorithm ( ) : string
return string

getPartCount() public method

public getPartCount ( ) : integer
return integer

getPartLength() public method

public getPartLength ( ) : integer
return integer

provideNameByHash() public method

public provideNameByHash ( FileInfo $srcFileInfo, string $hash ) : FileInfo
$srcFileInfo FileNamingResolver\FileInfo
$hash string
return FileNamingResolver\FileInfo

Property Details

$algorithm protected property

Hash algorithm
protected $algorithm

$partCount protected property

Count of parts
protected $partCount

$partLength protected property

Length of each part
protected $partLength