Skip to content

Commit db966ff

Browse files
authored
Merge branch 'master' into chore(deps)/dependency-update
2 parents 4017e5d + 52eb366 commit db966ff

File tree

11 files changed

+50
-31
lines changed

11 files changed

+50
-31
lines changed

.idea/php-test-framework.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/remote-mappings.xml

Lines changed: 2 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/symfony2.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.1.5-fpm
1+
FROM php:8.1.6-fpm
22

33
ENV APP_ENV prod
44
ENV APP_DEBUG 0
@@ -10,7 +10,7 @@ RUN apt-get update \
1010
&& rm -rf /var/lib/apt/lists/*
1111

1212
# Copy the install-php-extensions (Easily install PHP extension in official PHP Docker containers)
13-
COPY --from=mlocati/php-extension-installer:1.5.11 /usr/bin/install-php-extensions /usr/local/bin/
13+
COPY --from=mlocati/php-extension-installer:1.5.16 /usr/bin/install-php-extensions /usr/local/bin/
1414

1515
# Install and enable all necessary PHP extensions
1616
RUN install-php-extensions \

Dockerfile_dev

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.1.5-fpm
1+
FROM php:8.1.6-fpm
22

33
# Let's use bash as a default shell with login each time
44
SHELL ["/bin/bash", "--login", "-c"]
@@ -10,7 +10,7 @@ ARG HOST_GID
1010
# Declare constants
1111
ENV PATH "$PATH:/home/dev/.composer/vendor/bin:/app/vendor/bin"
1212
ENV NVM_VERSION v0.39.1
13-
ENV NODE_VERSION 18.0.0
13+
ENV NODE_VERSION 18.2.0
1414

1515
# Update package list and install necessary libraries
1616
RUN apt-get update \
@@ -20,7 +20,7 @@ RUN apt-get update \
2020
&& rm -rf /var/lib/apt/lists/*
2121

2222
# Copy the install-php-extensions (Easily install PHP extension in official PHP Docker containers)
23-
COPY --from=mlocati/php-extension-installer:1.5.11 /usr/bin/install-php-extensions /usr/local/bin/
23+
COPY --from=mlocati/php-extension-installer:1.5.16 /usr/bin/install-php-extensions /usr/local/bin/
2424

2525
# Enable all necessary PHP packages
2626
RUN install-php-extensions \

config/packages/doctrine.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ doctrine:
2424
prefix: 'App\Entity'
2525
alias: App
2626

27+
when@test:
28+
doctrine:
29+
dbal:
30+
logging: false
31+
2732
when@prod:
2833
doctrine:
34+
dbal:
35+
logging: false
2936
orm:
3037
auto_generate_proxy_classes: false
3138
query_cache_driver:

config/packages/security.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ security:
22
# https://symfony.com/doc/current/security/authenticator_manager.html
33
enable_authenticator_manager: true
44

5-
# https://symfony.com/doc/current/security.html#c-hashing-passwords
5+
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
66
password_hashers:
77
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
88

@@ -55,3 +55,9 @@ security:
5555
access_control:
5656
# - { path: ^/admin, roles: ROLE_ADMIN }
5757
# - { path: ^/profile, roles: ROLE_USER }
58+
59+
when@test:
60+
security:
61+
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
62+
password_hashers:
63+
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'md5'

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<env name="SHELL_VERBOSITY" value="-1" />
4141
<env name="USE_ALL_USER_COMBINATIONS" value="no" />
4242
<env name="APP_ENV" value="test" force="true" />
43-
<env name="APP_DEBUG" value="1" />
43+
<env name="APP_DEBUG" value="false" force="true" />
4444
<env name="APP_SECRET" value="93b60d4136baea83cf3821ee6a0a2adb" />
4545
<!--
4646
To make sure that application has no "direct" deprecations we use `max[direct]=0` as a default one

src/Service/Localization.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class Localization
3434
public const DEFAULT_TIMEZONE = 'Europe/Helsinki';
3535

3636
public function __construct(
37-
private CacheInterface $appCacheApcu,
38-
private LoggerInterface $logger,
37+
private readonly CacheInterface $appCacheApcu,
38+
private readonly LoggerInterface $logger,
3939
) {
4040
}
4141

@@ -63,6 +63,7 @@ public function getTimezones(): array
6363
$output = [];
6464

6565
try {
66+
/** @var array<int, array{timezone: string, identifier: string, offset: string, value: string}> $output */
6667
$output = $this->appCacheApcu->get('application_timezone', $this->getClosure());
6768
} catch (Throwable $exception) {
6869
$this->logger->error($exception->getMessage(), $exception->getTrace());

src/Service/Version.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
use Symfony\Contracts\Cache\CacheInterface;
1515
use Symfony\Contracts\Cache\ItemInterface;
1616
use Throwable;
17+
use function array_key_exists;
18+
use function assert;
19+
use function is_array;
20+
use function is_string;
1721

1822
/**
1923
* Class Version
@@ -24,9 +28,9 @@
2428
class Version
2529
{
2630
public function __construct(
27-
private string $projectDir,
28-
private CacheInterface $appCacheApcu,
29-
private LoggerInterface $logger
31+
private readonly string $projectDir,
32+
private readonly CacheInterface $appCacheApcu,
33+
private readonly LoggerInterface $logger
3034
) {
3135
}
3236

@@ -39,7 +43,7 @@ public function get(): string
3943
$output = '0.0.0';
4044

4145
try {
42-
$output = $this->appCacheApcu->get('application_version', $this->getClosure());
46+
$output = (string)$this->appCacheApcu->get('application_version', $this->getClosure());
4347
} catch (Throwable $exception) {
4448
$this->logger->error($exception->getMessage(), $exception->getTrace());
4549
}
@@ -53,9 +57,13 @@ private function getClosure(): Closure
5357
// One year
5458
$item->expiresAfter(31536000);
5559

56-
$composerData = JSON::decode((string)file_get_contents($this->projectDir . '/composer.json'));
60+
$composerData = JSON::decode((string)file_get_contents($this->projectDir . '/composer.json'), true);
5761

58-
return (string)($composerData->version ?? '0.0.0');
62+
assert(is_array($composerData));
63+
64+
return array_key_exists('version', $composerData) && is_string($composerData['version'])
65+
? $composerData['version']
66+
: '0.0.0';
5967
};
6068
}
6169
}

0 commit comments

Comments
 (0)