Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CannotBeInstantiated and throw UnsupportedMethod where appropriate #1211

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Console/LogVerbosity.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@

use function array_key_exists;
use function in_array;
use Infection\CannotBeInstantiated;
use Symfony\Component\Console\Input\InputInterface;

/**
* @internal
*/
final class LogVerbosity
{
use CannotBeInstantiated;

public const DEBUG = 'all';
public const NORMAL = 'default';
public const NONE = 'none';
Expand Down
4 changes: 4 additions & 0 deletions src/Mutant/DetectionStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@

namespace Infection\Mutant;

use Infection\CannotBeInstantiated;

/**
* @internal
*/
final class DetectionStatus
{
use CannotBeInstantiated;

public const KILLED = 'killed';
public const ESCAPED = 'escaped';
public const ERROR = 'error';
Expand Down
5 changes: 3 additions & 2 deletions tests/phpunit/Fixtures/TestFramework/FakeAwareAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use ErrorException;
use Infection\AbstractTestFramework\MemoryUsageAware;
use Infection\TestFramework\AbstractTestFrameworkAdapter;
use Infection\Tests\UnsupportedMethod;

class FakeAwareAdapter extends AbstractTestFrameworkAdapter implements MemoryUsageAware
{
Expand All @@ -22,12 +23,12 @@ public function hasJUnitReport(): bool

public function testsPass(string $output): bool
{
throw new ErrorException('this should never be called');
throw UnsupportedMethod::method(__CLASS__, __FUNCTION__);
}

public function getName(): string
{
throw new ErrorException('this should never be called');
throw UnsupportedMethod::method(__CLASS__, __FUNCTION__);
}

/**
Expand Down