Skip to content

Commit

Permalink
move build method
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jun 21, 2017
1 parent fa8a333 commit 141e2d7
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/Param/FileParam.php
Expand Up @@ -38,7 +38,26 @@ class FileParam extends Param

public $putIn;

public function validExtensions($exts)



protected function build()
{
// XXX: use CascadingAttribute class setter instead.
$this->supportedAttributes['renameFile'] = self::ATTR_ANY;

// $this->renameFile = [FileRenameMethods::class, 'md5ize'];
$this->renameFile = new Md5Rename;

if (static::$defaultUploadDirectory) {
$this->putIn(static::$defaultUploadDirectory);
}
}




public function validExtensions(array $exts)
{
$this->validExtensions = $exts;

Expand All @@ -59,19 +78,6 @@ public function putIn($dir)
return $this;
}

protected function build()
{
// XXX: use CascadingAttribute class setter instead.
$this->supportedAttributes['renameFile'] = self::ATTR_ANY;

// $this->renameFile = [FileRenameMethods::class, 'md5ize'];
$this->renameFile = new Md5Rename;

if (static::$defaultUploadDirectory) {
$this->putIn(static::$defaultUploadDirectory);
}
}

public function validate($value)
{
$ret = (array) parent::validate($value);
Expand Down

0 comments on commit 141e2d7

Please sign in to comment.