Skip to content

Commit

Permalink
Revert "Work on #4502 should be done in a branch"
Browse files Browse the repository at this point in the history
This reverts commit 212f9e1.
  • Loading branch information
sebastianbergmann committed Apr 20, 2021
1 parent af2b8a5 commit eceec4d
Show file tree
Hide file tree
Showing 62 changed files with 1,894 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .psalm/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,9 @@
<code>getName</code>
</UndefinedInterfaceMethod>
</file>
<file src="src/Util/Metadata/MetadataCollection.php">
<InvalidArgument occurrences="1"/>
</file>
<file src="src/Util/PHP/AbstractPhpProcess.php">
<ArgumentTypeCoercion occurrences="5">
<code>$this-&gt;getException($failures[0])</code>
Expand Down
17 changes: 17 additions & 0 deletions src/Framework/Attributes/After.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_METHOD)]
final class After
{
}
17 changes: 17 additions & 0 deletions src/Framework/Attributes/AfterClass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_METHOD)]
final class AfterClass
{
}
31 changes: 31 additions & 0 deletions src/Framework/Attributes/BackupGlobals.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class BackupGlobals
{
/**
* @var bool
*/
private $enabled;

public function __construct(bool $enabled)
{
$this->enabled = $enabled;
}

public function enabled(): bool
{
return $this->enabled;
}
}
31 changes: 31 additions & 0 deletions src/Framework/Attributes/BackupStaticProperties.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class BackupStaticProperties
{
/**
* @var bool
*/
private $enabled;

public function __construct(bool $enabled)
{
$this->enabled = $enabled;
}

public function enabled(): bool
{
return $this->enabled;
}
}
17 changes: 17 additions & 0 deletions src/Framework/Attributes/Before.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_METHOD)]
final class Before
{
}
17 changes: 17 additions & 0 deletions src/Framework/Attributes/BeforeClass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_METHOD)]
final class BeforeClass
{
}
17 changes: 17 additions & 0 deletions src/Framework/Attributes/CodeCoverageIgnore.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class CodeCoverageIgnore
{
}
37 changes: 37 additions & 0 deletions src/Framework/Attributes/CoversClass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
final class CoversClass
{
/**
* @psalm-var class-string
*/
private $className;

/**
* @psalm-param class-string $className
*/
public function __construct(string $className)
{
$this->className = $className;
}

/**
* @psalm-return class-string
*/
public function className(): string
{
return $this->className;
}
}
31 changes: 31 additions & 0 deletions src/Framework/Attributes/CoversFunction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
final class CoversFunction
{
/**
* @var string
*/
private $functionName;

public function __construct(string $functionName)
{
$this->functionName = $functionName;
}

public function functionName(): string
{
return $this->functionName;
}
}
17 changes: 17 additions & 0 deletions src/Framework/Attributes/CoversNothing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
final class CoversNothing
{
}
31 changes: 31 additions & 0 deletions src/Framework/Attributes/DataProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::IS_REPEATABLE)]
final class DataProvider
{
/**
* @var string
*/
private $methodName;

public function __construct(string $methodName)
{
$this->methodName = $methodName;
}

public function methodName(): string
{
return $this->methodName;
}
}
48 changes: 48 additions & 0 deletions src/Framework/Attributes/DataProviderExternal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::IS_REPEATABLE)]
final class DataProviderExternal
{
/**
* @psalm-var class-string
*/
private $className;

/**
* @var string
*/
private $methodName;

/**
* @psalm-param class-string $className
*/
public function __construct(string $className, string $methodName)
{
$this->className = $className;
$this->methodName = $methodName;
}

/**
* @psalm-return class-string
*/
public function className(): string
{
return $this->className;
}

public function methodName(): string
{
return $this->methodName;
}
}
31 changes: 31 additions & 0 deletions src/Framework/Attributes/Depends.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;

use Attribute;

#[Attribute(Attribute::IS_REPEATABLE)]
final class Depends
{
/**
* @var string
*/
private $methodName;

public function __construct(string $methodName)
{
$this->methodName = $methodName;
}

public function methodName(): string
{
return $this->methodName;
}
}
Loading

0 comments on commit eceec4d

Please sign in to comment.