Esempio n. 1
0
 /**
  * @inheritDoc
  */
 protected function validateArguments(array $args)
 {
     $valA1 = new HasTypeMap(['size' => 'integer']);
     $valA2 = new Lambda(function ($args) {
         return $args['size'] > 0;
     }, new StringType(self::ERR1));
     $validator = new LAnd($valA1, $valA2);
     if (!$validator->isValid($args)) {
         throw new InvalidParameterException(implode(':', $validator->getMessages()));
     }
 }
Esempio n. 2
0
 /**
  * @inheritDoc
  */
 protected function validateArguments(array $args)
 {
     $valA1 = new HasTypeMap(['rows' => 'integer', 'cols' => 'integer', 'f' => function ($val) {
         return $val instanceof \Closure;
     }]);
     $valA2 = new Lambda(function ($args) {
         return $args['rows'] > 0 && $args['cols'] > 0;
     }, new StringType(self::ERR1));
     $validator = new LAnd($valA1, $valA2);
     if (!$validator->isValid($args)) {
         throw new InvalidParameterException(implode(':', $validator->getMessages()));
     }
 }