Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 47... Línea 47...
47
 
47
 
48
        return new self($cells, $rowStyle);
48
        return new self($cells, $rowStyle);
Línea 49... Línea 49...
49
    }
49
    }
-
 
50
 
-
 
51
    /**
-
 
52
     * @param array<array-key, null|bool|DateInterval|DateTimeInterface|float|int|string> $cellValues
-
 
53
     * @param array<array-key, Style>                                                     $columnStyles
-
 
54
     */
-
 
55
    public static function fromValuesWithStyles(array $cellValues = [], ?Style $rowStyle = null, array $columnStyles = []): self
-
 
56
    {
-
 
57
        $cells = array_map(static function (null|bool|DateInterval|DateTimeInterface|float|int|string $cellValue, int|string $key) use ($columnStyles): Cell {
-
 
58
            return Cell::fromValue($cellValue, $columnStyles[$key] ?? null);
-
 
59
        }, $cellValues, array_keys($cellValues));
-
 
60
 
-
 
61
        return new self($cells, $rowStyle);
-
 
62
    }
50
 
63
 
51
    /**
64
    /**
52
     * @return Cell[] $cells
65
     * @return Cell[] $cells
53
     */
66
     */
54
    public function getCells(): array
67
    public function getCells(): array