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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- Requires PHP `8.4`
- Requires `innmind/filesystem:~9.0`

### Removed

- `Innmind\Graphviz\Edge\Shape` named constructors, use the cases directly

## 4.0.0 - 2025-04-18

### Added
Expand Down
99 changes: 0 additions & 99 deletions src/Edge/Shape.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,105 +20,6 @@ enum Shape
case tee;
case vee;

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function box(): self
{
return self::box;
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function crow(): self
{
return self::crow;
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function curve(): self
{
return self::curve;
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function icurve(): self
{
return self::icurve;
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function diamond(): self
{
return self::diamond;
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function dot(): self
{
return self::dot;
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function inv(): self
{
return self::inv;
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function none(): self
{
return self::none;
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function normal(): self
{
return self::normal;
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function tee(): self
{
return self::tee;
}

/**
* @psalm-pure
*/
#[\NoDiscard]
public static function vee(): self
{
return self::vee;
}

#[\NoDiscard]
public function toString(): string
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Edge/ShapeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public function testShape(): BlackBox\Proof
return $this
->forAll($this->shapes())
->prove(function(string $shape): void {
$this->assertInstanceOf(Shape::class, Shape::$shape());
$this->assertSame($shape, Shape::$shape()->toString());
$this->assertInstanceOf(Shape::class, Shape::{$shape});
$this->assertSame($shape, Shape::{$shape}->toString());
});
}

Expand Down
16 changes: 8 additions & 8 deletions tests/EdgeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public function testShaped()
Name::of('b'),
)
->shaped(
Shape::box(),
Shape::vee(),
Shape::tee(),
Shape::dot(),
Shape::box,
Shape::vee,
Shape::tee,
Shape::dot,
);

$this->assertSame(1, $edge->attributes()->size());
Expand All @@ -92,10 +92,10 @@ public function testShapedWhenBidirectional()
)
->asBidirectional()
->shaped(
Shape::box(),
Shape::vee(),
Shape::tee(),
Shape::dot(),
Shape::box,
Shape::vee,
Shape::tee,
Shape::dot,
);

$this->assertSame(3, $edge->attributes()->size());
Expand Down