Skip to content

Commit

Permalink
Use attributes instead of annotations in code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jun 27, 2024
1 parent 76cedc2 commit 03d8581
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 55 deletions.
17 changes: 8 additions & 9 deletions tests/unit/BuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@
*/
namespace SebastianBergmann\ObjectGraph;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use SebastianBergmann\ObjectGraph\TestFixture\ChildClass;
use stdClass;

/**
* @covers \SebastianBergmann\ObjectGraph\Builder
*
* @uses \SebastianBergmann\ObjectGraph\Node
* @uses \SebastianBergmann\ObjectGraph\NodeCollection
* @uses \SebastianBergmann\ObjectGraph\NodeCollectionIterator
* @uses \SebastianBergmann\ObjectGraph\NodeReference
* @uses \SebastianBergmann\ObjectGraph\NodeReferenceCollection
*/
#[CoversClass(Builder::class)]
#[UsesClass(Node::class)]
#[UsesClass(NodeCollection::class)]
#[UsesClass(NodeCollectionIterator::class)]
#[UsesClass(NodeReference::class)]
#[UsesClass(NodeReferenceCollection::class)]
final class BuilderTest extends TestCase
{
private Builder $builder;
Expand Down
21 changes: 10 additions & 11 deletions tests/unit/DotWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@
*/
namespace SebastianBergmann\ObjectGraph;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use stdClass;

/**
* @covers \SebastianBergmann\ObjectGraph\DotWriter
*
* @uses \SebastianBergmann\ObjectGraph\Builder
* @uses \SebastianBergmann\ObjectGraph\Node
* @uses \SebastianBergmann\ObjectGraph\NodeCollection
* @uses \SebastianBergmann\ObjectGraph\NodeCollectionIterator
* @uses \SebastianBergmann\ObjectGraph\NodeReference
* @uses \SebastianBergmann\ObjectGraph\NodeReferenceCollection
* @uses \SebastianBergmann\ObjectGraph\NodeReferenceCollectionIterator
*/
#[CoversClass(DotWriter::class)]
#[UsesClass(Builder::class)]
#[UsesClass(Node::class)]
#[UsesClass(NodeCollection::class)]
#[UsesClass(NodeCollectionIterator::class)]
#[UsesClass(NodeReference::class)]
#[UsesClass(NodeReferenceCollection::class)]
#[UsesClass(NodeReferenceCollectionIterator::class)]
final class DotWriterTest extends TestCase
{
public function testCanGenerateDotMarkupFromNodeCollection(): void
Expand Down
13 changes: 6 additions & 7 deletions tests/unit/node/NodeCollectionIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@
*/
namespace SebastianBergmann\ObjectGraph;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use stdClass;

/**
* @covers \SebastianBergmann\ObjectGraph\NodeCollectionIterator
*
* @uses \SebastianBergmann\ObjectGraph\Builder
* @uses \SebastianBergmann\ObjectGraph\Node
* @uses \SebastianBergmann\ObjectGraph\NodeCollection
*/
#[CoversClass(NodeCollectionIterator::class)]
#[UsesClass(Builder::class)]
#[UsesClass(Node::class)]
#[UsesClass(NodeCollection::class)]
final class NodeCollectionIteratorTest extends TestCase
{
public function testCanIterateNodeCollection(): void
Expand Down
13 changes: 6 additions & 7 deletions tests/unit/node/NodeCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@
*/
namespace SebastianBergmann\ObjectGraph;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use stdClass;

/**
* @covers \SebastianBergmann\ObjectGraph\NodeCollection
*
* @uses \SebastianBergmann\ObjectGraph\Builder
* @uses \SebastianBergmann\ObjectGraph\Node
* @uses \SebastianBergmann\ObjectGraph\NodeCollectionIterator
*/
#[CoversClass(NodeCollection::class)]
#[UsesClass(Builder::class)]
#[UsesClass(Node::class)]
#[UsesClass(NodeCollectionIterator::class)]
final class NodeCollectionTest extends TestCase
{
private NodeCollection $nodeCollection;
Expand Down
11 changes: 5 additions & 6 deletions tests/unit/node/NodeReferenceCollectionIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
*/
namespace SebastianBergmann\ObjectGraph;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;

/**
* @covers \SebastianBergmann\ObjectGraph\NodeReferenceCollectionIterator
*
* @uses \SebastianBergmann\ObjectGraph\NodeReference
* @uses \SebastianBergmann\ObjectGraph\NodeReferenceCollection
*/
#[CoversClass(NodeReferenceCollectionIterator::class)]
#[UsesClass(NodeReference::class)]
#[UsesClass(NodeReferenceCollection::class)]
final class NodeReferenceCollectionIteratorTest extends TestCase
{
public function testCanIterateNodeReferenceCollection(): void
Expand Down
11 changes: 5 additions & 6 deletions tests/unit/node/NodeReferenceCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
*/
namespace SebastianBergmann\ObjectGraph;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;

/**
* @covers \SebastianBergmann\ObjectGraph\NodeReferenceCollection
*
* @uses \SebastianBergmann\ObjectGraph\NodeReference
* @uses \SebastianBergmann\ObjectGraph\NodeReferenceCollectionIterator
*/
#[CoversClass(NodeReferenceCollection::class)]
#[UsesClass(NodeReference::class)]
#[UsesClass(NodeReferenceCollectionIterator::class)]
final class NodeReferenceCollectionTest extends TestCase
{
private NodeReferenceCollection $nodeReferenceCollection;
Expand Down
5 changes: 2 additions & 3 deletions tests/unit/node/NodeReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
*/
namespace SebastianBergmann\ObjectGraph;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;

/**
* @covers \SebastianBergmann\ObjectGraph\NodeReference
*/
#[CoversClass(NodeReference::class)]
final class NodeReferenceTest extends TestCase
{
private NodeReference $nodeReference;
Expand Down
11 changes: 5 additions & 6 deletions tests/unit/node/NodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
*/
namespace SebastianBergmann\ObjectGraph;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use stdClass;

/**
* @covers \SebastianBergmann\ObjectGraph\Node
*
* @uses \SebastianBergmann\ObjectGraph\NodeReference
* @uses \SebastianBergmann\ObjectGraph\NodeReferenceCollection
*/
#[CoversClass(Node::class)]
#[UsesClass(NodeReference::class)]
#[UsesClass(NodeReferenceCollection::class)]
final class NodeTest extends TestCase
{
private Node $node;
Expand Down

0 comments on commit 03d8581

Please sign in to comment.