for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WeDevBr\Mati\Inputs;
/**
* Wrapper for identity input
*
* @author Gabriel Mineiro <[email protected]>
*/
class DocumentPhoto extends BaseInput
{
use HasType;
protected $group;
protected $country;
protected $region;
protected $page;
public function setGroup(int $group): DocumentPhoto
$this->group = $group;
return $this;
}
public function setCountry(string $country): DocumentPhoto
$this->country = $country;
public function setRegion(string $region): DocumentPhoto
$this->region = $region;
public function setPage(string $page): DocumentPhoto
$this->page = $page;
public function setFilePath(string $path): DocumentPhoto
$this->file_path = $path;
public function getFileName(): string
return basename($this->file_path);
public function getFileContents()
return file_get_contents($this->file_path);
public function toArray()
return [
'inputType' => 'document-photo',
'group' => $this->group,
'data' => [
'type' => $this->type,
'country' => $this->country,
'region' => $this->region ?? '',
'page' => $this->page,
'filename' => $this->getFileName()
]
];