<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
imanaging-document / check-format-bundle example snippets
use Imanaging\CheckFormatBundle\CheckFormatFile;
class MyBeautifulService
{
/**
* ...
*/
public function myBeautifulFunction(...){
...
$result = CheckFormatFile::checkFormatLine($structureDescription, $myLineToCheckFormat));
...
}
...
}
$structure = [
// Type, Column Name, Nullable
new FieldCheckFormat("string", "Name", false),
new FieldCheckFormat("integer", "Age", true),
new FieldCheckFormat("integer", "Height", true),
new FieldCheckFormat("string", "City", true),
];
$myLine = ['Rémi', '26', '170', 'San Francisco'];
$result = CheckFormatFile::checkFormatLine($structure, $myLine));
// In this case, error equals false and the errors list is empty because there is no error
// $result['error'] = false;
// $result['errors_list'] = [];
$structure = [
// Type, Column Name, Nullable
new FieldCheckFormat("string", "Name", false),
new FieldCheckFormat("integer", "Age", true),
new FieldCheckFormat("integer", "Height", true),
new FieldCheckFormat("string", "City", true),
];
$lines = [
['Rémi', '26', '170', 'San Francisco'],
['Antonin', '26', '181', 'Miami'],
];
$result = CheckFormatFile::checkFormatFile($structure, $lines));
// In this case, error equals false and the errors list is empty because there is no error
// $result['error'] = false;
// $result['errors_list'] = [];
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.