public function validate($license)
    {
        if (is_array($license)) {
            $count = count($license);
            if ($count !== count(array_filter($license, 'is_string'))) {
                throw new \InvalidArgumentException('Array of strings expected.');
            }
            $license = $count > 1  ? '(' . implode(' OR ', $license) . ')' : (string) reset($license);
        }

        if (!is_string($license)) {
            throw new \InvalidArgumentException(sprintf(
                'Array or String expected, %s given.',
                gettype($license)
            ));
        }

        return $this->isValidLicenseString($license);
    }
public function validate($license)
    {
        if (is_array($license)) {
            $count = count($license);
            if ($count !== count(array_filter($license, 'is_string'))) {
                throw new \InvalidArgumentException('Array of strings expected.');
            }
            $license = $count > 1  ? '(' . implode(' OR ', $license) . ')' : (string) reset($license);
        }

        if (!is_string($license)) {
            throw new \InvalidArgumentException(sprintf(
                'Array or String expected, %s given.',
                gettype($license)
            ));
        }

        return $this->isValidLicenseString($license);
    }
public function validate ( $ license ) { if ( is_array ( $ license ) ) { $ count = count ( $ license ) ; if ( $ count !== count ( array_filter ( $ license , 'is_string' ) ) ) { throw new \ InvalidArgumentException ( 'Array of strings expected.' ) ; } $ license = $ count > 1 ? '(' . implode ( ' OR ' , $ license ) . ')' : ( string ) reset ( $ license ) ; } if ( ! is_string ( $ license ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Array or String expected, %s given.' , gettype ( $ license ) ) ) ; } return $ this -> isValidLicenseString ( $ license ) ; }
@param array|string $license

@throws \InvalidArgumentException

@return bool
@param array|string $license