Skip to content

Commit

Permalink
[BOT] Add compiled assets for #refs/heads/dev-main
Browse files Browse the repository at this point in the history
  • Loading branch information
inpsyde-deploybot committed Sep 6, 2024
1 parent 4c08035 commit e268f4f
Show file tree
Hide file tree
Showing 15 changed files with 235 additions and 120 deletions.
1 change: 1 addition & 0 deletions vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\FacultyRepository' => $vendorDir . '/rrze/fau-studium-common/src/Infrastructure/Repository/FacultyRepository.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\IdGenerator' => $vendorDir . '/rrze/fau-studium-common/src/Infrastructure/Repository/IdGenerator.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\StickyDegreeProgramRepository' => $vendorDir . '/rrze/fau-studium-common/src/Infrastructure/Repository/StickyDegreeProgramRepository.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\TimestampRepository' => $vendorDir . '/rrze/fau-studium-common/src/Infrastructure/Repository/TimestampRepository.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\WordPressDatabaseDegreeProgramCollectionRepository' => $vendorDir . '/rrze/fau-studium-common/src/Infrastructure/Repository/WordPressDatabaseDegreeProgramCollectionRepository.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\WordPressDatabaseDegreeProgramRepository' => $vendorDir . '/rrze/fau-studium-common/src/Infrastructure/Repository/WordPressDatabaseDegreeProgramRepository.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\WordPressDatabaseDegreeProgramViewRepository' => $vendorDir . '/rrze/fau-studium-common/src/Infrastructure/Repository/WordPressDatabaseDegreeProgramViewRepository.php',
Expand Down
1 change: 1 addition & 0 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class ComposerStaticInitcaf37a9a7e03b5b4a8fa1ed8a636e1ce
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\FacultyRepository' => __DIR__ . '/..' . '/rrze/fau-studium-common/src/Infrastructure/Repository/FacultyRepository.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\IdGenerator' => __DIR__ . '/..' . '/rrze/fau-studium-common/src/Infrastructure/Repository/IdGenerator.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\StickyDegreeProgramRepository' => __DIR__ . '/..' . '/rrze/fau-studium-common/src/Infrastructure/Repository/StickyDegreeProgramRepository.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\TimestampRepository' => __DIR__ . '/..' . '/rrze/fau-studium-common/src/Infrastructure/Repository/TimestampRepository.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\WordPressDatabaseDegreeProgramCollectionRepository' => __DIR__ . '/..' . '/rrze/fau-studium-common/src/Infrastructure/Repository/WordPressDatabaseDegreeProgramCollectionRepository.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\WordPressDatabaseDegreeProgramRepository' => __DIR__ . '/..' . '/rrze/fau-studium-common/src/Infrastructure/Repository/WordPressDatabaseDegreeProgramRepository.php',
'Fau\\DegreeProgram\\Common\\Infrastructure\\Repository\\WordPressDatabaseDegreeProgramViewRepository' => __DIR__ . '/..' . '/rrze/fau-studium-common/src/Infrastructure/Repository/WordPressDatabaseDegreeProgramViewRepository.php',
Expand Down
9 changes: 5 additions & 4 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,12 @@
"source": {
"type": "git",
"url": "https://github.com/RRZE-Webteam/FAU-Studium-Common.git",
"reference": "d8cb53c2cf24a6f28b07109cec9bb67c1d51d743"
"reference": "2314da111571d795a3f3d3dbe194680737a26e07"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/RRZE-Webteam/FAU-Studium-Common/zipball/d8cb53c2cf24a6f28b07109cec9bb67c1d51d743",
"reference": "d8cb53c2cf24a6f28b07109cec9bb67c1d51d743",
"url": "https://api.github.com/repos/RRZE-Webteam/FAU-Studium-Common/zipball/2314da111571d795a3f3d3dbe194680737a26e07",
"reference": "2314da111571d795a3f3d3dbe194680737a26e07",
"shasum": ""
},
"require": {
Expand All @@ -454,7 +454,8 @@
"suggest": {
"inpsyde/modularity": "Modular PSR-11 implementation for WordPress Plugins, Themes or Libraries"
},
"time": "2024-07-23T13:46:52+00:00",
"time": "2024-09-04T13:20:56+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down
10 changes: 6 additions & 4 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => 'rrze/fau-studium-embed',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '98ddde8cbf05002397083867addb16b6f27aeec8',
'reference' => '4c080352a968dd3739c0809a1fe10fcf177f3f32',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -76,16 +76,18 @@
'rrze/fau-studium-common' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => 'd8cb53c2cf24a6f28b07109cec9bb67c1d51d743',
'reference' => '2314da111571d795a3f3d3dbe194680737a26e07',
'type' => 'library',
'install_path' => __DIR__ . '/../rrze/fau-studium-common',
'aliases' => array(),
'aliases' => array(
0 => '9999999-dev',
),
'dev_requirement' => false,
),
'rrze/fau-studium-embed' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '98ddde8cbf05002397083867addb16b6f27aeec8',
'reference' => '4c080352a968dd3739c0809a1fe10fcf177f3f32',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down
57 changes: 0 additions & 57 deletions vendor/rrze/fau-studium-common/.github/workflows/build.yml

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/rrze/fau-studium-common/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
<code><![CDATA[AdmissionRequirementTranslatedType]]></code>
</InvalidReturnType>
</file>
<file src="src/Application/DegreeProgramViewTranslated.php">
<RiskyTruthyFalsyComparison>
<code><![CDATA[empty($data[self::TRANSLATIONS])]]></code>
</RiskyTruthyFalsyComparison>
</file>
<file src="src/Application/Filter/AdmissionRequirementTypeFilter.php">
<RiskyTruthyFalsyComparison>
<code><![CDATA[$sanitizedValue]]></code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
use Psr\SimpleCache\CacheInterface;
use Psr\SimpleCache\InvalidArgumentException;

/**
* @psalm-import-type Reason from CacheInvalidated
*/
final class CacheInvalidator
{
public function __construct(
Expand All @@ -21,7 +24,10 @@ public function __construct(
) {
}

public function invalidateFully(): bool
/**
* @psalm-param Reason $reason
*/
public function invalidateFully(string $reason = CacheInvalidated::ENFORCED): bool
{
$result = $this->cache->clear();
if (!$result) {
Expand All @@ -30,16 +36,17 @@ public function invalidateFully(): bool
}

$this->logger->info('Successful degree program full cache invalidation.');
$this->eventDispatcher->dispatch(CacheInvalidated::fully());
$this->eventDispatcher->dispatch(CacheInvalidated::fully($reason));
return true;
}

/**
* @psalm-param array<int> $ids
* @psalm-param Reason $reason
*
* @throws InvalidArgumentException
*/
public function invalidatePartially(array $ids): bool
public function invalidatePartially(array $ids, string $reason = CacheInvalidated::ENFORCED): bool
{
if (count($ids) === 0) {
$this->logger->debug(
Expand Down Expand Up @@ -81,7 +88,7 @@ public function invalidatePartially(array $ids): bool
implode(', ', $ids)
)
);
$this->eventDispatcher->dispatch(CacheInvalidated::partially($ids));
$this->eventDispatcher->dispatch(CacheInvalidated::partially($ids, $reason));

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@
* }
* @psalm-type DegreeProgramViewTranslatedArrayType = DegreeProgramTranslation & array{
* id: int,
* date: string,
* modified: string,
* translations: array<LanguageCodes, DegreeProgramTranslation>,
* }
*/
final class DegreeProgramViewTranslated implements JsonSerializable
{
public const DATE = 'date';
public const MODIFIED = 'modified';
public const LINK = 'link';
public const LANG = 'lang';
public const ADMISSION_REQUIREMENT_LINK = 'admission_requirement_link';
Expand All @@ -94,6 +98,8 @@ final class DegreeProgramViewTranslated implements JsonSerializable

public function __construct(
private DegreeProgramId $id,
private string $date,
private string $modified,
private string $link,
private string $slug,
/**
Expand Down Expand Up @@ -160,6 +166,8 @@ public static function empty(int $id, string $languageCode): self
{
return new self(
DegreeProgramId::fromInt($id),
date: '',
modified: '',
link: '',
slug: '',
lang: $languageCode,
Expand Down Expand Up @@ -220,6 +228,8 @@ public static function empty(int $id, string $languageCode): self
/**
* @psalm-param DegreeProgramTranslation & array{
* id: int | numeric-string,
* date: string,
* modified: string,
* translations?: array<LanguageCodes, DegreeProgramTranslation>,
* } $data
*
Expand All @@ -229,6 +239,8 @@ public static function fromArray(array $data): self
{
$main = new self(
id: DegreeProgramId::fromInt((int) $data[DegreeProgram::ID]),
date: $data[self::DATE] ?? '',
modified: $data[self::MODIFIED] ?? '',
link: $data[self::LINK],
slug: $data[DegreeProgram::SLUG],
lang: $data[self::LANG],
Expand Down Expand Up @@ -285,12 +297,14 @@ public static function fromArray(array $data): self
campoKeys: CampoKeys::fromArray($data[DegreeProgram::CAMPO_KEYS] ?? []),
);

if (empty($data[self::TRANSLATIONS])) {
if (!isset($data[self::TRANSLATIONS]) || count($data[self::TRANSLATIONS]) === 0) {
return $main;
}

foreach ($data[self::TRANSLATIONS] as $translationData) {
$translationData[DegreeProgram::ID] = $data[DegreeProgram::ID];
$translationData[self::DATE] = $data[self::DATE];
$translationData[self::MODIFIED] = $data[self::MODIFIED];
$main = $main->withTranslation(self::fromArray($translationData), $translationData[self::LANG]);
}

Expand All @@ -304,6 +318,8 @@ public function asArray(): array
{
return [
DegreeProgram::ID => $this->id->asInt(),
self::DATE => $this->date,
self::MODIFIED => $this->modified,
self::LINK => $this->link,
DegreeProgram::SLUG => $this->slug,
self::LANG => $this->lang,
Expand Down Expand Up @@ -361,6 +377,18 @@ public function asArray(): array
];
}

public function asSimplifiedArray(): array
{
return [
DegreeProgram::ID => $this->id->asInt(),
DegreeProgram::SLUG => $this->slug,
self::LINK => $this->link,
DegreeProgram::CAMPO_KEYS => $this->campoKeys->asArray(),
self::DATE => $this->date,
self::MODIFIED => $this->modified,
];
}

public function jsonSerialize(): array
{
return $this->asArray();
Expand Down Expand Up @@ -408,7 +436,12 @@ private function translationsAsArray(): array
{
return array_map(static function (DegreeProgramViewTranslated $view): array {
$result = $view->asArray();
unset($result[DegreeProgram::ID], $result[self::TRANSLATIONS]);
unset(
$result[DegreeProgram::ID],
$result[self::DATE],
$result[self::MODIFIED],
$result[self::TRANSLATIONS]
);

return $result;
}, $this->translations);
Expand All @@ -419,6 +452,16 @@ public function id(): int
return $this->id->asInt();
}

public function date(): string
{
return $this->date;
}

public function modified(): string
{
return $this->modified;
}

public function link(): string
{
return $this->link;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,41 @@

use Stringable;

/**
* @psalm-type Reason = self::ENFORCED | self::DATA_CHANGED
*/
final class CacheInvalidated implements Stringable
{
public const NAME = 'degree_program_cache_invalidated';
public const ENFORCED = 'enforced';
public const DATA_CHANGED = 'data_changed';

/**
* @param array<int> $ids
* @param Reason $reason
*/
private function __construct(
private bool $isFully,
private array $ids,
private string $reason,
) {
}

public static function fully(): self
/**
* @param Reason $reason
*/
public static function fully(string $reason): self
{
return new self(true, []);
return new self(true, [], $reason);
}

/**
* @param array<int> $ids
* @param Reason $reason
*/
public static function partially(array $ids): self
public static function partially(array $ids, string $reason): self
{
return new self(false, $ids);
return new self(false, $ids, $reason);
}

public function isFully(): bool
Expand All @@ -45,6 +56,14 @@ public function ids(): array
return $this->ids;
}

/**
* @return Reason
*/
public function reason(): string
{
return $this->reason;
}

public function __toString(): string
{
return self::NAME;
Expand Down
Loading

0 comments on commit e268f4f

Please sign in to comment.