From e054e4380c0bd62164c649538a7717c0339675b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 2 May 2024 16:25:44 +0200 Subject: [PATCH] Clean code --- htdocs/api/class/api_documents.class.php | 28 ------------------------ 1 file changed, 28 deletions(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 385360608eb..5821df74946 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -32,13 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; */ class Documents extends DolibarrApi { - /** - * @var array $DOCUMENT_FIELDS Mandatory fields, checked when create and update object - */ - public static $DOCUMENT_FIELDS = array( - 'modulepart' - ); - /** * Constructor */ @@ -993,25 +986,4 @@ class Documents extends DolibarrApi throw new RestException(403); } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName - /** - * Validate fields before create or update object - * - * @param array $data Array with data to verify - * @return array - * @throws RestException - */ - private function _validate_file($data) - { - // phpcs:enable - $result = array(); - foreach (Documents::$DOCUMENT_FIELDS as $field) { - if (!isset($data[$field])) { - throw new RestException(400, "$field field missing"); - } - $result[$field] = $data[$field]; - } - return $result; - } }