private function setStates(array $states)
    {
        foreach ($states as $state) {
            if (!is_string($state) || strlen($state) !== 1) {
                throw new \InvalidArgumentException(
                    'State must be a one character string'
                );
            }
        }

        $this->states = $states;
    }
private function setStates(array $states)
    {
        foreach ($states as $state) {
            if (!is_string($state) || strlen($state) !== 1) {
                throw new \InvalidArgumentException(
                    'State must be a one character string'
                );
            }
        }

        $this->states = $states;
    }
private function setStates ( array $ states ) { foreach ( $ states as $ state ) { if ( ! is_string ( $ state ) || strlen ( $ state ) !== 1 ) { throw new \ InvalidArgumentException ( 'State must be a one character string' ) ; } } $ this -> states = $ states ; }
Sets the rainbow states.

@param array $states The rainbow states.

@throws \InvalidArgumentException When a rainbow segment is not a one char string.
Sets the rainbow states .