Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ disable_upload_dirs_warning: true
# If the name is omitted, the project will take the name of the enclosing directory,
# which is useful if you want to have a copy of the project side by side with this one.

# type: <projecttype> # backdrop, cakephp, craftcms, drupal, drupal6, drupal7, drupal8, drupal9, drupal10, drupal11, generic, laravel, magento, magento2, php, shopware6, silverstripe, symfony, typo3, wordpress
# type: <projecttype> # backdrop, cakephp, codeigniter, craftcms, drupal, drupal6, drupal7, drupal8, drupal9, drupal10, drupal11, drupal12, generic, laravel, magento, magento2, php, shopware6, silverstripe, symfony, typo3, wordpress
# See https://docs.ddev.com/en/stable/users/quickstart/ for more
# information on the different project types

# docroot: <relative_path> # Relative path to the directory containing index.php.

# php_version: "8.3" # PHP version to use, "5.6" through "8.5"
# php_version: "8.4" # PHP version to use, "5.6" through "8.5"

# You can explicitly specify the webimage but this
# is not recommended, as the images are often closely tied to DDEV's' behavior,
Expand Down Expand Up @@ -65,8 +65,7 @@ disable_upload_dirs_warning: true
# bind_all_ports is used (normally with router disabled)

# xhprof_mode: [prepend|xhgui|global]
# Set to "xhgui" to enable XHGui features
# "xhgui" will become default in a future major release
# Default is "xhgui"

# webserver_type: nginx-fpm, apache-fpm, generic

Expand All @@ -92,14 +91,12 @@ disable_upload_dirs_warning: true
# - preview
# - snapshot
# Alternatively, an explicit Composer version may be specified, for example "2.2.18".
# To reinstall Composer after the image was built, run "ddev debug rebuild".
# To reinstall Composer after the image was built, run "ddev utility rebuild".

# nodejs_version: "22"
# nodejs_version: "24"
# change from the default system Node.js version to any other version.
# See https://docs.ddev.com/en/stable/users/configuration/config/#nodejs_version for more information
# and https://www.npmjs.com/package/n#specifying-nodejs-versions for the full documentation,
# Note that using of 'ddev nvm' is discouraged because "nodejs_version" is much easier to use,
# can specify any version, and is more robust than using 'nvm'.
# and https://www.npmjs.com/package/n#specifying-nodejs-versions for the full documentation.

# corepack_enable: false
# Change to 'true' to 'corepack enable' and gain access to latest versions of yarn/pnpm
Expand Down Expand Up @@ -159,9 +156,7 @@ disable_upload_dirs_warning: true
# - "global": uses the value from the global config.
# - "none": disables performance optimization for this project.
# - "mutagen": enables Mutagen for this project.
# - "nfs": enables NFS for this project.
#
# See https://docs.ddev.com/en/stable/users/install/performance/#nfs
# See https://docs.ddev.com/en/stable/users/install/performance/#mutagen

# fail_on_hook_fail: False
Expand Down Expand Up @@ -206,12 +201,15 @@ disable_upload_dirs_warning: true
# project_tld: ddev.site
# The top-level domain used for project URLs
# The default "ddev.site" allows DNS lookup via a wildcard
# If you prefer you can change this to "ddev.local" to preserve
# pre-v1.9 behavior.

# ngrok_args: --basic-auth username:pass1234
# Provide extra flags to the "ngrok http" command, see
# https://ngrok.com/docs/agent/config/v3/#agent-configuration or run "ngrok http -h"
# share_default_provider: ngrok
# The default share provider to use for "ddev share"
# Defaults to global configuration, usually "ngrok"
# Can be "ngrok" or "cloudflared" or the name of a custom provider from .ddev/share-providers/

# share_provider_args: --basic-auth username:pass1234
# Provide extra flags to the share provider script
# See https://docs.ddev.com/en/stable/users/configuration/config/#share_provider_args

# disable_settings_management: false
# If true, DDEV will not create CMS-specific settings files like
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"symfony/options-resolver": "^6.4|^7.4|^8.0"
},
"require-dev": {
"monolog/monolog": "^3.9",
"monolog/monolog": "^3.10",
"nyholm/psr7": "^1.8",
"php-http/mock-client": "^1.6",
"phpunit/phpunit": "^10.5",
Expand Down
6 changes: 3 additions & 3 deletions docs/05-entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
- `getDateTime()`: `\DateTimeImmutable`
- `getTemperature()`: `float`
- `getTemperatureFeelsLike()`: `float`
- `getVisibility()`: `int`
- `getVisibility()`: `?int`
- `getPrecipitationProbability()`: `int`
- `getAtmosphericPressure()`: `int`
- `getHumidity()`: `int`
Expand Down Expand Up @@ -214,7 +214,7 @@
- `getMaxTemperature()`: `float`
- `getHumidity()`: `int`
- `getCloudiness()`: `int`
- `getVisibility()`: `int`
- `getVisibility()`: `?int`
- `getAtmosphericPressure()`: `int`
- `getConditions()`: [`Condition[]`](#condition)
- `getWind()`: [`Wind`](#wind)
Expand All @@ -237,7 +237,7 @@
- `getMaxTemperature()`: `float`
- `getHumidity()`: `int`
- `getCloudiness()`: `int`
- `getVisibility()`: `int`
- `getVisibility()`: `?int`
- `getAtmosphericPressure()`: `int`
- `getConditions()`: [`Condition[]`](#condition)
- `getWind()`: [`Wind`](#wind)
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Assistant/WeatherData.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class WeatherData extends BaseWeather

private float $temperatureFeelsLike;

private int $visibility;
private ?int $visibility;

private \DateTimeImmutable $sunriseAt;

Expand All @@ -25,7 +25,7 @@ public function __construct(string $locationName, array $data)
$this->locationName = $locationName;
$this->temperature = $data['temp'];
$this->temperatureFeelsLike = $data['feels_like'];
$this->visibility = $data['visibility'];
$this->visibility = $data['visibility'] ?? null;
$this->sunriseAt = \DateTimeImmutable::createFromFormat('U', $data['sunrise']);
$this->sunsetAt = \DateTimeImmutable::createFromFormat('U', $data['sunset']);
}
Expand All @@ -45,7 +45,7 @@ public function getTemperatureFeelsLike(): float
return $this->temperatureFeelsLike;
}

public function getVisibility(): int
public function getVisibility(): ?int
{
return $this->visibility;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/OneCall/HourData.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class HourData extends BaseWeather

private float $temperatureFeelsLike;

private int $visibility;
private ?int $visibility;

private int $precipitationProbability;

Expand All @@ -20,7 +20,7 @@ public function __construct(array $data)

$this->temperature = $data['temp'];
$this->temperatureFeelsLike = $data['feels_like'];
$this->visibility = $data['visibility'];
$this->visibility = $data['visibility'] ?? null;
$this->precipitationProbability = round($data['pop'] * 100);
}

Expand All @@ -34,7 +34,7 @@ public function getTemperatureFeelsLike(): float
return $this->temperatureFeelsLike;
}

public function getVisibility(): int
public function getVisibility(): ?int
{
return $this->visibility;
}
Expand Down
12 changes: 4 additions & 8 deletions src/Entity/Weather/WeatherData.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class WeatherData

private int $cloudiness;

private int $visibility;
private ?int $visibility;

private int $atmosphericPressure;

Expand All @@ -46,15 +46,11 @@ public function __construct(array $data)
$this->maxTemperature = $data['main']['temp_max'];
$this->humidity = $data['main']['humidity'];
$this->cloudiness = $data['clouds']['all'];
$this->visibility = $data['visibility'];
$this->visibility = $data['visibility'] ?? null;
$this->atmosphericPressure = $data['main']['pressure'];
$this->conditions = EntityHelper::createEntityList(Condition::class, $data['weather']);
$this->wind = new Wind($data['wind']);

$this->precipitationProbability = isset($data['pop'])
? round($data['pop'] * 100)
: null;

$this->precipitationProbability = isset($data['pop']) ? round($data['pop'] * 100) : null;
$this->rainVolume = $data['rain']['1h'] ?? $data['rain']['3h'] ?? null;
$this->snowVolume = $data['snow']['1h'] ?? $data['snow']['3h'] ?? null;
}
Expand Down Expand Up @@ -101,7 +97,7 @@ public function getCloudiness(): int
* Visibility, meters
* Maximum value is 10000
*/
public function getVisibility(): int
public function getVisibility(): ?int
{
return $this->visibility;
}
Expand Down