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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2.1.1
=====

* (improvement) Replace `.` with `:` in `TaskMetaData::getKey`.
* (improvement) Change column of `TaskRun::$taskLog` to be not nullable.
* (internal) Update `21torr/janus` and use `phpunit` instead of `simple-phpunit`.


2.1.0
=====

Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"symfony/uid": "^7.2"
},
"require-dev": {
"21torr/janus": "^1.4.0",
"bamarni/composer-bin-plugin": "^1.8",
"21torr/janus": "^2.0.0",
"bamarni/composer-bin-plugin": "^1.8.2",
"phpunit/phpunit": "^12.2.5",
"roave/security-advisories": "dev-latest",
"symfony/phpunit-bridge": "^7.2",
"symfony/translation-contracts": "^3.6"
},
"autoload": {
Expand All @@ -48,6 +48,7 @@
},
"config": {
"allow-plugins": {
"21torr/janus": true,
"bamarni/composer-bin-plugin": true
},
"sort-packages": true
Expand All @@ -72,7 +73,7 @@
"PHP_CS_FIXER_IGNORE_ENV=1 vendor-bin/cs-fixer/vendor/bin/php-cs-fixer check --diff --config vendor-bin/cs-fixer/vendor/21torr/php-cs-fixer/.php-cs-fixer.dist.php --no-interaction --ansi"
],
"test": [
"simple-phpunit",
"phpunit",
"vendor-bin/phpstan/vendor/bin/phpstan analyze -c phpstan.neon . --ansi -v"
]
}
Expand Down
14 changes: 10 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
includes:
- vendor/21torr/janus/phpstan/lib.neon

# If you use simple-phpunit, you need to uncomment the following line.
# Always make sure to first run simple-phpunit and then PHPStan.
parameters:
bootstrapFiles:
- vendor/bin/.phpunit/phpunit/vendor/autoload.php

# These are temporarily copied here, as normally they should be in the lib.neon of janus.
# However, due to a bug in PHPStan, this currently doesn't work (https://github.com/phpstan/phpstan/issues/12844)
excludePaths:
analyse:
- vendor
analyseAndScan:
- node_modules (?)
- var (?)
- vendor-bin
1 change: 1 addition & 0 deletions src/Entity/TaskRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class TaskRun
/**
*/
#[ORM\ManyToOne(targetEntity: TaskLog::class, inversedBy: "runs")]
#[ORM\JoinColumn(name: "task_log_id", referencedColumnName: "id", nullable: false)]
private TaskLog $taskLog;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Task/TaskMetaData.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function getKey () : string
// these are validated to be safe, so we can keep using these
if (null !== $this->uniqueTaskId)
{
return $this->uniqueTaskId;
return strtr($this->uniqueTaskId, ".", ":");
}

$slugger = new AsciiSlugger("en");
Expand Down
2 changes: 1 addition & 1 deletion src/TaskManagerBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class TaskManagerBundle extends Bundle
/**
* @inheritDoc
*/
public function getContainerExtension () : ?ExtensionInterface
public function getContainerExtension () : ExtensionInterface
{
return new ConfigurableBundleExtension(
$this,
Expand Down
21 changes: 11 additions & 10 deletions tests/Task/TaskMetaDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Tests\Torr\TaskManager\Task;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Torr\TaskManager\Exception\Task\InvalidTaskDefinitionException;
use Torr\TaskManager\Task\TaskMetaData;
Expand All @@ -13,21 +14,21 @@ final class TaskMetaDataTest extends TestCase
{
public static function provideValidUniqueTaskIds () : iterable
{
yield "plain" => ["test"];
yield "with dash" => ["a-b"];
yield "with underscore" => ["a-b_c"];
yield "all characters" => ["a-b_c.d"];
yield "numbers" => ["5"];
yield "numbers longer" => ["1-2-3-4"];
yield "plain" => ["test", "test"];
yield "with dash" => ["a-b", "a-b"];
yield "with underscore" => ["a-b_c", "a-b_c"];
yield "all characters" => ["a-b_c.d", "a-b_c:d"];
yield "numbers" => ["5", "5"];
yield "numbers longer" => ["1-2-3-4", "1-2-3-4"];
}

/**
* @dataProvider provideValidUniqueTaskIds
*/
public function testValidUniqueTaskIds (string $uniqueTaskId) : void
#[DataProvider("provideValidUniqueTaskIds")]
public function testValidUniqueTaskIds (string $uniqueTaskId, string $expected) : void
{
$metadata = new TaskMetaData("Test", uniqueTaskId: $uniqueTaskId);
self::assertSame($uniqueTaskId, $metadata->getKey());
self::assertSame($expected, $metadata->getKey());
}

public static function provideInvalidUniqueTaskIds () : iterable
Expand All @@ -45,8 +46,8 @@ public static function provideInvalidUniqueTaskIds () : iterable
}

/**
* @dataProvider provideInvalidUniqueTaskIds
*/
#[DataProvider("provideInvalidUniqueTaskIds")]
public function testInvalidUniqueTaskIds (string $uniqueTaskId) : void
{
$this->expectException(InvalidTaskDefinitionException::class);
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/c-norm/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require-dev": {
"ergebnis/composer-normalize": "^2.42",
"ergebnis/composer-normalize": "^2.47",
"roave/security-advisories": "dev-latest"
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/cs-fixer/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require-dev": {
"21torr/php-cs-fixer": "^1.1.1",
"21torr/php-cs-fixer": "^1.1.5",
"roave/security-advisories": "dev-latest"
}
}
14 changes: 7 additions & 7 deletions vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"php": "^8.3"
},
"require-dev": {
"phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan-deprecation-rules": "^1.2",
"phpstan/phpstan-doctrine": "^1.4",
"phpstan/phpstan-phpunit": "^1.4",
"phpstan/phpstan-symfony": "^1.4",
"phpstan/extension-installer": "^1.4.2",
"phpstan/phpstan": "^2.1.11",
"phpstan/phpstan-deprecation-rules": "^2.0.1",
"phpstan/phpstan-doctrine": "^2.0.2",
"phpstan/phpstan-phpunit": "^2.0.6",
"phpstan/phpstan-symfony": "^2.0.4",
"roave/security-advisories": "dev-latest",
"staabm/phpstan-todo-by": "^0.1.25"
"staabm/phpstan-todo-by": "^0.2"
},
"config": {
"sort-packages": true,
Expand Down