Skip to content

Commit

Permalink
refactor: Merge formatters into matchers
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed Oct 9, 2024
1 parent e206999 commit 686440f
Show file tree
Hide file tree
Showing 180 changed files with 2,096 additions and 4,116 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace PhpPact\Consumer\Matcher\Formatters\Expression;

use PhpPact\Consumer\Matcher\Exception\MatcherNotSupportedException;
use PhpPact\Consumer\Matcher\Model\Expression;
use PhpPact\Consumer\Matcher\Model\FormatterInterface;
use PhpPact\Consumer\Matcher\Model\Matcher\ExpressionFormattableInterface;
use PhpPact\Consumer\Matcher\Model\MatcherInterface;

class ExpressionFormatter implements FormatterInterface
{
public function format(MatcherInterface $matcher): Expression
{
if (!$matcher instanceof ExpressionFormattableInterface) {
throw new MatcherNotSupportedException('Matcher does not support expression format');
}

return $matcher->formatExpression();
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 686440f

Please sign in to comment.