Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102005 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46471 invoked from network); 28 Mar 2018 10:39:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Mar 2018 10:39:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:53474] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 62/D0-38242-0C07BBA5 for ; Wed, 28 Mar 2018 05:38:59 -0500 Received: (qmail 96380 invoked by uid 89); 28 Mar 2018 10:38:53 -0000 Received: from unknown (HELO mail-io0-f182.google.com) (yohgaki@ohgaki.net@209.85.223.182) by 0 with ESMTPA; 28 Mar 2018 10:38:53 -0000 Received: by mail-io0-f182.google.com with SMTP id d5so2945797iob.9 for ; Wed, 28 Mar 2018 03:38:51 -0700 (PDT) X-Gm-Message-State: AElRT7HfPINd7kdLXl7EomPF4pKjGcKKC2S/r4QYiJMp1ktUExVf2q/D BAXNlW4HK/W/AXxi6ggEDK4dsanWoVcCk8qldw== X-Google-Smtp-Source: AG47ELsHvaUchoQMCVX9hS2Z7vZyHGTUtIkIyQFqUJv8VkECrE/uXYo8IH1BKrWIWn7OKitr1wHuktsokn8M/YW8zZE= X-Received: by 10.107.58.134 with SMTP id h128mr46752119ioa.299.1522233526344; Wed, 28 Mar 2018 03:38:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.151.162 with HTTP; Wed, 28 Mar 2018 03:38:05 -0700 (PDT) In-Reply-To: References: Date: Wed, 28 Mar 2018 19:38:05 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Crocodile Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="001a114aca549a65120568769c6f" Subject: Re: [PHP-DEV] Re: A validator module for PHP7 From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a114aca549a65120568769c6f Content-Type: text/plain; charset="UTF-8" On Tue, Mar 27, 2018 at 8:03 PM, Crocodile wrote: > It's almost always the case that you need to provide a meaningful feedback > about what exactly went wrong, rather then to just say "Failed!" While > simplicity is nice and you cannot overrate value of validation, this whole > thing is pretty much useless to me personally without this ability. Also, I > don't think it's a good idea to mix validation of scalar values, arrays and > even multiple arrays, in a single function. > There are 3 types of validations in general. There are only 3 types of inputs. Explaining them need lots of word as well as for other fundamentals/principles related to this. https://blog.ohgaki.net/computer-programming-fundamentals-and-basics-input-validation You are referring to "Business Logic Validation" which needs feedback to users in case they send incorrect values. "App Level Input Validation" does not require feedback other than "You sent really bad request. This has been reported to admins." Therefore, App Level Input Validation can validate ALL inputs at once and there is no good reason not to do this. Btw, you can use the validator for a single value validation as well. It also able to disable Exception so that one can use it for "Business Logic Validations" as well. https://github.com/yohgaki/validate-php-scr/tree/master/src/examples Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a114aca549a65120568769c6f--