cd test1
- run
php getCloseParenthesisIndex.php
Create a PSR-4 package that support both xlsx
& xls
cd test2
- run
composer install
- If you want to try this package, you can open
test.php
or create new file
<?php
require './vendor/autoload.php';
$inputFileName = 'Type_A.xlsx';
$validationResult = \Src\ValidateSheet::validate($inputFileName);
echo $validationResult;
- Test on Terminal/Git Bash using command
php test.php
- For example, create file
Type_C.php
in directorysrc/types
- Create class
Type_C
inType_C.php
<?php
class Type_C extends Type_Base implements Type_Interface {
// define your column rule here
private $columnRules = [
'Field_A*',
'#Field_B',
'Field_C'
];
/**
* @param array $sheetData
* @return string
*/
public function checkSheet($sheetData)
{
$check = $this->check($this->columnRules, $sheetData);
return $check;
}
}
- Last step, run
composer dump-autoload