public function validate() {
		$required = array_filter($this->orig, function($spec) {
			return $spec[3] & self::REQUIRED;
		});
		foreach ($required as $req) {
			if ($req[3] & self::MULTI) {
				if (is_array($this[$req[0]])) {
					continue;
				}
			} elseif (strlen($this[$req[0]])) {
				continue;
			}
			if (is_numeric($req[0])) {
				yield sprintf("Argument <%s> is required", $req[1]);
			} else {
				yield sprintf("Option --%s is required", $req[1]);
			}
		}
	}
public function validate() {
		$required = array_filter($this->orig, function($spec) {
			return $spec[3] & self::REQUIRED;
		});
		foreach ($required as $req) {
			if ($req[3] & self::MULTI) {
				if (is_array($this[$req[0]])) {
					continue;
				}
			} elseif (strlen($this[$req[0]])) {
				continue;
			}
			if (is_numeric($req[0])) {
				yield sprintf("Argument <%s> is required", $req[1]);
			} else {
				yield sprintf("Option --%s is required", $req[1]);
			}
		}
	}
public function validate ( ) { $ required = array_filter ( $ this -> orig , function ( $ spec ) { return $ spec [ 3 ] & self :: REQUIRED ; } ) ; foreach ( $ required as $ req ) { if ( $ req [ 3 ] & self :: MULTI ) { if ( is_array ( $ this [ $ req [ 0 ] ] ) ) { continue ; } } elseif ( strlen ( $ this [ $ req [ 0 ] ] ) ) { continue ; } if ( is_numeric ( $ req [ 0 ] ) ) { yield sprintf ( "Argument <%s> is required" , $ req [ 1 ] ) ; } else { yield sprintf ( "Option --%s is required" , $ req [ 1 ] ) ; } } }
Validate that all required options were given.

The Generator yields any validation errors.

@return Generator
Validate that all required options were given .