for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PubPeerFoundation\PublicationDataExtractor;
use Volan\Volan;
class ApiDataChecker
{
const SCHEMA = [
'root' => [
'authors' => [
'_type' => 'nested_array',
'first_name' => [
'_type' => 'string'
],
'last_name' => [
'_type' => 'required_string'
'orcid' => [
'affiliation' => [
'_type' => 'array'
'identifiers' => [
'value' => [
'type' => [
'journal' => [
'_type' => 'array',
'title' => [
'issn' => [
'publisher' => [
'publication' => [
'_type' => 'required_array',
'abstract' => [
'url' => [
'published_at' => [
'types' => [
'name' => [
'tags' => [
'updates' => [
'timestamp' => [
'identifier' => [
'doi' => [
]
];
public static function check($data)
$validator = new Volan(static::SCHEMA);
$result = $validator->validate($data);
return $result;
}