Utility Classes :: IsOnlyOneOf

Overview

The IsOnlyOneOf() is related to the IsOneOf() class, but with a major difference:

IsOneof(IsIterable(), IsCallable())
IsOnlyOneOf(IsIterable(), IsCallable())

Where IsIterable() and IsCallable() are the IsIterable() and IsCallable() utility classes, respectively.

The first signature will accept the object if it's iterable, callable or both. In the second signature, however, the object must be either callable or iterable; if it's both iterable and callable, that's a no-go.

Details

Valid XHTML 1.0 Transitional