| @@ 170-185 (lines=16) @@ | ||
| 167 | * |
|
| 168 | * @see https://www.w3.org/TR/appmanifest/#dir-member |
|
| 169 | */ |
|
| 170 | public function setDirection($direction) |
|
| 171 | { |
|
| 172 | if (!in_array( |
|
| 173 | $direction, |
|
| 174 | [ |
|
| 175 | self::DIRECTION_LEFT_TO_RIGHT, |
|
| 176 | self::DIRECTION_RIGHT_TO_LEFT, |
|
| 177 | self::DIRECTION_AUTO |
|
| 178 | ] |
|
| 179 | )) { |
|
| 180 | throw new \InvalidArgumentException("Use one of AppConfiguration::DIRECTION_* constants."); |
|
| 181 | } |
|
| 182 | ||
| 183 | $this->direction = $direction; |
|
| 184 | return $this; |
|
| 185 | } |
|
| 186 | ||
| 187 | /** |
|
| 188 | * Returns the preferred display mode. |
|
| @@ 206-222 (lines=17) @@ | ||
| 203 | * |
|
| 204 | * @see https://www.w3.org/TR/appmanifest/#display-member |
|
| 205 | */ |
|
| 206 | public function setDisplay($display) |
|
| 207 | { |
|
| 208 | if (!in_array( |
|
| 209 | $display, |
|
| 210 | [ |
|
| 211 | self::DISPLAY_FULLSCREEN, |
|
| 212 | self::DISPLAY_MINIMAL_UI, |
|
| 213 | self::DISPLAY_STANDALONE, |
|
| 214 | self::DISPLAY_BROWSER |
|
| 215 | ] |
|
| 216 | )) { |
|
| 217 | throw new \InvalidArgumentException("Use one of AppConfiguration::DISPLAY_* constants."); |
|
| 218 | } |
|
| 219 | ||
| 220 | $this->display = $display; |
|
| 221 | return $this; |
|
| 222 | } |
|
| 223 | ||
| 224 | /** |
|
| 225 | * Returns an array of all application icons. |
|