public function toWeekDays($pattern)
    {
        $weekDays = $this->getWeekDays();

        $formatedDays = [];

        foreach (str_split($pattern) as $key => $day) {
            if (array_key_exists($day, $weekDays) && intval($day) === 1) {
                $formatedDays[] = $weekDays[$key];
            }
        }

        return join(', ', $formatedDays);
    }
public function toWeekDays($pattern)
    {
        $weekDays = $this->getWeekDays();

        $formatedDays = [];

        foreach (str_split($pattern) as $key => $day) {
            if (array_key_exists($day, $weekDays) && intval($day) === 1) {
                $formatedDays[] = $weekDays[$key];
            }
        }

        return join(', ', $formatedDays);
    }
public function toWeekDays ( $ pattern ) { $ weekDays = $ this -> getWeekDays ( ) ; $ formatedDays = [ ] ; foreach ( str_split ( $ pattern ) as $ key => $ day ) { if ( array_key_exists ( $ day , $ weekDays ) && intval ( $ day ) === 1 ) { $ formatedDays [ ] = $ weekDays [ $ key ] ; } } return join ( ', ' , $ formatedDays ) ; }
Converts weekly pattern to week days string

@param type $pattern

@return string List of weekdays separated  by comma
Converts weekly pattern to week days string