Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/symfony.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: symfony
MYSQL_DATABASE: symfony
MYSQL_DATABASE: symfony_test
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: [ "8.3" ]
php-versions: [ "8.3", "8.4" ]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
26 changes: 16 additions & 10 deletions assets/controllers.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"controllers": {
"@symfony/ux-live-component": {
"live": {
"enabled": true,
"fetch": "eager",
"autoimport": {
"@symfony/ux-live-component/dist/live.min.css": true
}
}
"controllers": {
"@symfony/ux-live-component": {
"live": {
"enabled": true,
"fetch": "eager",
"autoimport": {
"@symfony/ux-live-component/dist/live.min.css": true
}
}
},
"entrypoints": []
"@tito10047/batch-selection-bundle": {
"batch-selection": {
"enabled": true,
"fetch": "eager"
}
}
},
"entrypoints": []
}
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "symfony-bundle",
"license": "MIT",
"description": "Catch all bugs from all your applications in one place",
"minimum-stability": "stable",
"minimum-stability": "dev",
"require": {
"php": ">=8.3",
"api-platform/core": "^3.3",
Expand All @@ -21,7 +21,7 @@
"symfony/rate-limiter": "7.3.*",
"symfony/security-bundle": "7.3.*",
"symfony/serializer": "7.3.*",
"symfony/stimulus-bundle": "^2.17",
"symfony/stimulus-bundle": "2.x-dev",
"symfony/string": "7.3.*",
"symfony/translation": "7.3.*",
"symfony/twig-bundle": "7.3.*",
Expand All @@ -30,7 +30,8 @@
"symfony/ux-live-component": "^2.17",
"symfony/validator": "7.3.*",
"symfony/web-link": "7.3.*",
"symfony/webpack-encore-bundle": "^2.1",
"symfony/webpack-encore-bundle": "2.x-dev",
"tito10047/batch-selection-bundle": "dev-main",
"tito10047/doctrine-transaction": "^0.1.1",
"tito10047/php-sparkline": "^1.0",
"twig/extra-bundle": "^2.12|^3.0",
Expand Down Expand Up @@ -68,6 +69,7 @@
"symfony/messenger": "7.3.*",
"symfony/phpunit-bridge": "7.3.*",
"symfony/runtime": "7.3.*",
"symfony/var-exporter": "7.3.*",
"symfony/yaml": "7.3.*",
"zenstruck/foundry": "^2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions config/doctrine/Record.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
<custom-id-generator class="Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator"/>
</id>

<field name="date" type="datetime" nullable="false"/>
<field name="date" type="datetime_immutable" nullable="false"/>
<field name="status" type="string" length="50"/>
<field name="hash" type="string" length="32" nullable="true"/>
<field name="code" type="string" length="15" nullable="true"/>
<field name="metadata" type="array" nullable="true"/>
<field name="metadata" type="simple_array" nullable="true"/>
<many-to-one field="project" target-entity="BugCatcher\Entity\Project">
<join-column name="project_id" referenced-column-name="id" on-delete="CASCADE" nullable="false"/>
</many-to-one>
Expand Down
60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"devDependencies": {
"@babel/core": "^7.17.0",
"@babel/preset-env": "^7.16.0",
"@hotwired/stimulus": "^3.0.0",
"@hotwired/turbo": "^7.1.1 || ^8.0",
"@symfony/stimulus-bridge": "^3.2.0",
"@symfony/ux-live-component": "file:vendor/symfony/ux-live-component/assets",
"@symfony/webpack-encore": "^4.0.0",
"core-js": "^3.23.0",
"regenerator-runtime": "^0.13.9",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-notifier": "^1.15.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
},
"dependencies": {
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.3",
"file-loader": "^6.2.0",
"sass": "^1.77.4",
"sass-loader": "^14.2.1",
"stimulus-use": "^0.52.2"
}
"devDependencies": {
"@babel/core": "^7.17.0",
"@babel/preset-env": "^7.16.0",
"@hotwired/stimulus": "^3.0.0",
"@symfony/ux-live-component": "file:vendor/symfony/ux-live-component/assets",
"@tito10047/batch-selection-bundle": "file:vendor/tito10047/batch-selection-bundle/assets",
"@symfony/stimulus-bridge": "^4.0.1",
"@symfony/webpack-encore": "^5.0.0",
"core-js": "^3.38.0",
"regenerator-runtime": "^0.13.9",
"stimulus": "^3.2.2",
"webpack": "^5.74.0",
"webpack-cli": "^5.1.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
},
"dependencies": {
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.3",
"file-loader": "^6.2.0",
"sass": "^1.77.4",
"sass-loader": "^16.0.1",
"stimulus-use": "^0.52.2"
}
}
2 changes: 2 additions & 0 deletions public/197.4fd6492e.js

Large diffs are not rendered by default.

File renamed without changes.
2 changes: 0 additions & 2 deletions public/579.c35234fc.js

This file was deleted.

6 changes: 0 additions & 6 deletions public/bug_catcher.2165f9c7.css

This file was deleted.

1 change: 1 addition & 0 deletions public/bug_catcher.848f89da.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/bug_catcher.b421cb92.js

This file was deleted.

6 changes: 6 additions & 0 deletions public/bug_catcher.e4e77c43.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/entrypoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"bug_catcher": {
"js": [
"/bundles/bugcatcher/runtime.f29bab85.js",
"/bundles/bugcatcher/579.c35234fc.js",
"/bundles/bugcatcher/bug_catcher.b421cb92.js"
"/bundles/bugcatcher/197.4fd6492e.js",
"/bundles/bugcatcher/bug_catcher.848f89da.js"
],
"css": [
"/bundles/bugcatcher/bug_catcher.2165f9c7.css"
"/bundles/bugcatcher/bug_catcher.e4e77c43.css"
]
}
}
Expand Down
6 changes: 3 additions & 3 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"/bug_catcher.css": "/bundles/bugcatcher/bug_catcher.2165f9c7.css",
"/bug_catcher.js": "/bundles/bugcatcher/bug_catcher.b421cb92.js",
"/bug_catcher.css": "/bundles/bugcatcher/bug_catcher.e4e77c43.css",
"/bug_catcher.js": "/bundles/bugcatcher/bug_catcher.848f89da.js",
"/runtime.js": "/bundles/bugcatcher/runtime.f29bab85.js",
"/579.c35234fc.js": "/bundles/bugcatcher/579.c35234fc.js",
"/197.4fd6492e.js": "/bundles/bugcatcher/197.4fd6492e.js",
"/assets/mama-mia.mp3": "/bundles/bugcatcher/assets/mama-mia.4c2a7475.mp3",
"/assets/logo/green/vertical.svg": "/bundles/bugcatcher/assets/logo/green/vertical.8a1f42b5.svg",
"/assets/logo/blue/vertical.svg": "/bundles/bugcatcher/assets/logo/blue/vertical.c5a6d0aa.svg",
Expand Down
20 changes: 10 additions & 10 deletions src/Entity/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace BugCatcher\Entity;

use DateTimeInterface;
use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
Expand All @@ -26,7 +26,7 @@ abstract class Notifier {

protected ?int $delayInterval = null;

protected ?DateTimeInterface $lastFailedStatus = null;
protected ?DateTimeImmutable $lastFailedStatus = null;
protected int $failedStatusCount = 0;

protected NotifyRepeat $repeat = NotifyRepeat::FrequencyRecords;
Expand All @@ -38,9 +38,9 @@ abstract class Notifier {

protected ?int $clearInterval = null;

protected ?DateTimeInterface $lastNotified = null;
protected ?DateTimeImmutable $lastNotified = null;

protected ?DateTimeInterface $firstOkStatus = null;
protected ?DateTimeImmutable $firstOkStatus = null;

protected int $lastOkStatusCount = 0;

Expand Down Expand Up @@ -105,21 +105,21 @@ public function setClearInterval(?int $clearInterval): self {
return $this;
}

public function getLastNotified(): ?DateTimeInterface {
public function getLastNotified(): ?DateTimeImmutable {
return $this->lastNotified;
}

public function setLastNotified(?DateTimeInterface $lastNotified): self {
public function setLastNotified(?DateTimeImmutable $lastNotified): self {
$this->lastNotified = $lastNotified;

return $this;
}

public function getFirstOkStatus(): ?DateTimeInterface {
public function getFirstOkStatus(): ?DateTimeImmutable {
return $this->firstOkStatus;
}

public function setFirstOkStatus(?DateTimeInterface $firstOkStatus): self {
public function setFirstOkStatus(?DateTimeImmutable $firstOkStatus): self {
$this->firstOkStatus = $firstOkStatus;

return $this;
Expand Down Expand Up @@ -174,11 +174,11 @@ public function setDelayInterval(?int $delayInterval): self {
return $this;
}

public function getLastFailedStatus(): ?DateTimeInterface {
public function getLastFailedStatus(): ?DateTimeImmutable {
return $this->lastFailedStatus;
}

public function setLastFailedStatus(?DateTimeInterface $lastFailedStatus): self {
public function setLastFailedStatus(?DateTimeImmutable $lastFailedStatus): self {
$this->lastFailedStatus = $lastFailedStatus;

return $this;
Expand Down
16 changes: 7 additions & 9 deletions src/Entity/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace BugCatcher\Entity;

use ApiPlatform\Metadata\ApiProperty;
use DateTime;
use DateTimeImmutable;
use DateTimeInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Uid\Uuid;
use Symfony\Component\Validator\Constraints as Assert;
Expand All @@ -17,7 +15,7 @@ abstract class Record {
protected ?Uuid $id = null;

#[Assert\NotBlank()]
protected ?DateTimeInterface $date = null;
protected ?DateTimeImmutable $date = null;

#[Assert\NotNull(groups: ['Default'])]
protected ?Project $project = null;
Expand Down Expand Up @@ -45,7 +43,7 @@ abstract class Record {
])]
public ?array $metadata = null;

public function __construct(?DateTimeInterface $date = null) {
public function __construct(?DateTimeImmutable $date = null) {
if ($date) {
$this->date = $date;
} else {
Expand All @@ -54,17 +52,17 @@ public function __construct(?DateTimeInterface $date = null) {
}

private int $count = 1;
private ?DateTime $firstOccurrence = null;
private ?DateTimeImmutable $firstOccurrence = null;

public function getId(): ?Uuid {
return $this->id;
}

public function getDate(): ?DateTimeInterface {
public function getDate(): ?DateTimeImmutable {
return $this->date;
}

public function setDate(DateTimeInterface $date): static {
public function setDate(DateTimeImmutable $date): static {
$this->date = $date;

return $this;
Expand Down Expand Up @@ -102,12 +100,12 @@ public function setCount(int $count): self {
return $this;
}

public function getFirstOccurrence(): ?DateTime
public function getFirstOccurrence(): ?DateTimeImmutable
{
return $this->firstOccurrence;
}

public function setFirstOccurrence(?DateTime $firstOccurrence): self
public function setFirstOccurrence(?DateTimeImmutable $firstOccurrence): self
{
$this->firstOccurrence = $firstOccurrence;
return $this;
Expand Down
3 changes: 1 addition & 2 deletions src/Repository/NotifierRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace BugCatcher\Repository;

use DateTime;
use DateTimeImmutable;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
Expand Down Expand Up @@ -124,7 +123,7 @@ public function isDelayed(Notifier $notifier, $flush = true): bool {

return true;
case NotifyRepeat::PeriodTime:
if ($notifier->getLastFailedStatus()?->getTimestamp() <= (new DateTime())->getTimestamp() - $notifier->getDelayInterval()) {
if ($notifier->getLastFailedStatus()?->getTimestamp() <= (new DateTimeImmutable())->getTimestamp() - $notifier->getDelayInterval()) {
return false;
}
if ($notifier->getLastFailedStatus() === null) {
Expand Down
8 changes: 4 additions & 4 deletions src/Repository/RecordLogRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace BugCatcher\Repository;

use DateTimeInterface;
use DateTimeImmutable;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ManagerRegistry;
Expand Down Expand Up @@ -30,8 +30,8 @@ public function __construct(

public function setStatusBetween(
array $projects,
DateTimeInterface $from,
DateTimeInterface $to,
DateTimeImmutable $from,
DateTimeImmutable $to,
string $newStatus,
string $previousStatus = 'new',
?callable $qbCreator = null
Expand All @@ -41,7 +41,7 @@ public function setStatusBetween(

public function setStatus(
Record $log,
DateTimeInterface $lastDate,
DateTimeImmutable $lastDate,
string $newStatus,
string $previousStatus = 'new',
bool $flush = false,
Expand Down
Loading