Skip to content

Commit b8aa92f

Browse files
committed
Remove NodeInterface<NodeInterface> declaration
1 parent 168805c commit b8aa92f

File tree

4 files changed

+6
-33
lines changed

4 files changed

+6
-33
lines changed

src/CfdiData.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,12 @@
99

1010
class CfdiData
1111
{
12-
/** @var NodeInterface<NodeInterface> */
1312
private NodeInterface $emisor;
1413

15-
/** @var NodeInterface<NodeInterface> */
1614
private NodeInterface $receptor;
1715

18-
/** @var NodeInterface<NodeInterface> */
1916
private NodeInterface $timbreFiscalDigital;
2017

21-
/**
22-
* @param NodeInterface<NodeInterface> $comprobante
23-
*/
2418
public function __construct(
2519
private readonly NodeInterface $comprobante,
2620
private readonly string $qrUrl,
@@ -44,33 +38,21 @@ public function __construct(
4438
$this->timbreFiscalDigital = $timbreFiscalDigital;
4539
}
4640

47-
/**
48-
* @return NodeInterface<NodeInterface>
49-
*/
5041
public function comprobante(): NodeInterface
5142
{
5243
return $this->comprobante;
5344
}
5445

55-
/**
56-
* @return NodeInterface<NodeInterface>
57-
*/
5846
public function emisor(): NodeInterface
5947
{
6048
return $this->emisor;
6149
}
6250

63-
/**
64-
* @return NodeInterface<NodeInterface>
65-
*/
6651
public function receptor(): NodeInterface
6752
{
6853
return $this->receptor;
6954
}
7055

71-
/**
72-
* @return NodeInterface<NodeInterface>
73-
*/
7456
public function timbreFiscalDigital(): NodeInterface
7557
{
7658
return $this->timbreFiscalDigital;

src/CfdiDataBuilder.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ public function xsltBuilder(): XsltBuilderInterface
4949
return $this->xsltBuilder;
5050
}
5151

52-
/**
53-
* @param NodeInterface<NodeInterface> $comprobante
54-
*/
5552
public function build(NodeInterface $comprobante): CfdiData
5653
{
5754
return new CfdiData(
@@ -61,9 +58,6 @@ public function build(NodeInterface $comprobante): CfdiData
6158
);
6259
}
6360

64-
/**
65-
* @param NodeInterface<NodeInterface> $comprobante
66-
*/
6761
public function createTfdSourceString(NodeInterface $comprobante): string
6862
{
6963
$tfd = $comprobante->searchNode('cfdi:Complemento', 'tfd:TimbreFiscalDigital');
@@ -77,9 +71,6 @@ public function createTfdSourceString(NodeInterface $comprobante): string
7771
);
7872
}
7973

80-
/**
81-
* @param NodeInterface<NodeInterface> $comprobante
82-
*/
8374
public function createQrUrl(NodeInterface $comprobante): string
8475
{
8576
$parameters = new RequestParameters(

tests/Unit/CfdiDataBuilderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function testBuild(): void
6262
public function testCreateTfdSourceStringWithoutTimbreFiscalDigital(): void
6363
{
6464
$comprobante = Cfdi::newFromString($this->fileContents('cfdi33-valid.xml'))->getNode();
65-
/** @var NodeInterface<NodeInterface> $complemento phpstan recognize null returned by searchNode */
65+
/** @phpstan-var NodeInterface $complemento */
6666
$complemento = $comprobante->searchNode('cfdi:Complemento');
6767
$complemento->children()->removeAll();
6868

@@ -85,9 +85,9 @@ public function testCreateTfdSourceStringWithTfd11(): void
8585
public function testCreateTfdSourceStringWithTfd10(): void
8686
{
8787
$comprobante = Cfdi::newFromString($this->fileContents('cfdi33-valid.xml'))->getNode();
88-
/** @var NodeInterface<NodeInterface> $complemento phpstan recognize null returned by searchNode */
88+
/** @phpstan-var NodeInterface $complemento */
8989
$complemento = $comprobante->searchNode('cfdi:Complemento');
90-
/** @var NodeInterface<NodeInterface> $tfd phpstan recognize null returned by firstNodeWithName */
90+
/** @phpstan-var NodeInterface $tfd */
9191
$tfd = $complemento->children()->firstNodeWithName('tfd:TimbreFiscalDigital');
9292
$tfd->addAttributes([
9393
'Version' => null,

tests/Unit/CfdiDataTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testConstructUsingValidContent(): void
3131
public function testConstructWithoutEmisor(): void
3232
{
3333
$comprobante = Cfdi::newFromString($this->fileContents('cfdi33-valid.xml'))->getNode();
34-
/** @var NodeInterface<NodeInterface> $emisor phpstan recognize null returned by searchNode */
34+
/** @phpstan-var NodeInterface $emisor */
3535
$emisor = $comprobante->searchNode('cfdi:Emisor');
3636
$comprobante->children()->remove($emisor);
3737

@@ -43,7 +43,7 @@ public function testConstructWithoutEmisor(): void
4343
public function testConstructWithoutReceptor(): void
4444
{
4545
$comprobante = Cfdi::newFromString($this->fileContents('cfdi33-valid.xml'))->getNode();
46-
/** @var NodeInterface<NodeInterface> $receptor phpstan recognize null returned by searchNode */
46+
/** @phpstan-var NodeInterface $receptor */
4747
$receptor = $comprobante->searchNode('cfdi:Receptor');
4848
$comprobante->children()->remove($receptor);
4949

@@ -55,7 +55,7 @@ public function testConstructWithoutReceptor(): void
5555
public function testConstructWithoutComplemento(): void
5656
{
5757
$comprobante = Cfdi::newFromString($this->fileContents('cfdi33-valid.xml'))->getNode();
58-
/** @var NodeInterface<NodeInterface> $complemento phpstan recognize null returned by searchNode */
58+
/** @phpstan-var NodeInterface $complemento */
5959
$complemento = $comprobante->searchNode('cfdi:Complemento');
6060
$complemento->children()->removeAll();
6161

0 commit comments

Comments
 (0)