Skip to content

Commit c038498

Browse files
committed
feature #60544 [JsonStreamer] Remove nikic/php-parser dependency (mtarld)
This PR was merged into the 7.4 branch. Discussion ---------- [JsonStreamer] Remove `nikic/php-parser` dependency | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | | License | MIT Remove `nikic/php-parser` dependency, and generate PHP code with strings. /cc `@nicolas`-grekas Commits ------- e5930b3 [JsonStreamer] Remove "nikic/php-parser" dependency
2 parents 5e1f34e + e5930b3 commit c038498

25 files changed

+798
-1480
lines changed

src/Symfony/Component/JsonStreamer/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.4
5+
---
6+
7+
* Remove `nikic/php-parser` dependency
8+
49
7.3
510
---
611

src/Symfony/Component/JsonStreamer/DataModel/DataAccessorInterface.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/Symfony/Component/JsonStreamer/DataModel/FunctionDataAccessor.php

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/Symfony/Component/JsonStreamer/DataModel/PhpExprDataAccessor.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/Symfony/Component/JsonStreamer/DataModel/PropertyDataAccessor.php

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/Symfony/Component/JsonStreamer/DataModel/Read/ObjectNode.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\JsonStreamer\DataModel\Read;
1313

14-
use Symfony\Component\JsonStreamer\DataModel\DataAccessorInterface;
1514
use Symfony\Component\TypeInfo\Type\ObjectType;
1615
use Symfony\Component\TypeInfo\Type\UnionType;
1716

@@ -25,7 +24,7 @@
2524
final class ObjectNode implements DataModelNodeInterface
2625
{
2726
/**
28-
* @param array<string, array{name: string, value: DataModelNodeInterface, accessor: callable(DataAccessorInterface): DataAccessorInterface}> $properties
27+
* @param array<string, array{name: string, value: DataModelNodeInterface, accessor: callable(string): string}> $properties
2928
*/
3029
public function __construct(
3130
private ObjectType $type,
@@ -50,7 +49,7 @@ public function getType(): ObjectType
5049
}
5150

5251
/**
53-
* @return array<string, array{name: string, value: DataModelNodeInterface, accessor: callable(DataAccessorInterface): DataAccessorInterface}>
52+
* @return array<string, array{name: string, value: DataModelNodeInterface, accessor: callable(string): string}>
5453
*/
5554
public function getProperties(): array
5655
{

src/Symfony/Component/JsonStreamer/DataModel/ScalarDataAccessor.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/Symfony/Component/JsonStreamer/DataModel/VariableDataAccessor.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/Symfony/Component/JsonStreamer/DataModel/Write/BackedEnumNode.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\JsonStreamer\DataModel\Write;
1313

14-
use Symfony\Component\JsonStreamer\DataModel\DataAccessorInterface;
1514
use Symfony\Component\TypeInfo\Type\BackedEnumType;
1615

1716
/**
@@ -26,12 +25,12 @@
2625
final class BackedEnumNode implements DataModelNodeInterface
2726
{
2827
public function __construct(
29-
private DataAccessorInterface $accessor,
28+
private string $accessor,
3029
private BackedEnumType $type,
3130
) {
3231
}
3332

34-
public function withAccessor(DataAccessorInterface $accessor): self
33+
public function withAccessor(string $accessor): self
3534
{
3635
return new self($accessor, $this->type);
3736
}
@@ -41,7 +40,7 @@ public function getIdentifier(): string
4140
return (string) $this->getType();
4241
}
4342

44-
public function getAccessor(): DataAccessorInterface
43+
public function getAccessor(): string
4544
{
4645
return $this->accessor;
4746
}

src/Symfony/Component/JsonStreamer/DataModel/Write/CollectionNode.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\JsonStreamer\DataModel\Write;
1313

14-
use Symfony\Component\JsonStreamer\DataModel\DataAccessorInterface;
1514
use Symfony\Component\TypeInfo\Type\CollectionType;
1615

1716
/**
@@ -24,13 +23,13 @@
2423
final class CollectionNode implements DataModelNodeInterface
2524
{
2625
public function __construct(
27-
private DataAccessorInterface $accessor,
26+
private string $accessor,
2827
private CollectionType $type,
2928
private DataModelNodeInterface $item,
3029
) {
3130
}
3231

33-
public function withAccessor(DataAccessorInterface $accessor): self
32+
public function withAccessor(string $accessor): self
3433
{
3534
return new self($accessor, $this->type, $this->item);
3635
}
@@ -40,7 +39,7 @@ public function getIdentifier(): string
4039
return (string) $this->getType();
4140
}
4241

43-
public function getAccessor(): DataAccessorInterface
42+
public function getAccessor(): string
4443
{
4544
return $this->accessor;
4645
}

src/Symfony/Component/JsonStreamer/DataModel/Write/CompositeNode.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\JsonStreamer\DataModel\Write;
1313

14-
use Symfony\Component\JsonStreamer\DataModel\DataAccessorInterface;
1514
use Symfony\Component\JsonStreamer\Exception\InvalidArgumentException;
1615
use Symfony\Component\TypeInfo\Type;
1716
use Symfony\Component\TypeInfo\Type\UnionType;
@@ -43,7 +42,7 @@ final class CompositeNode implements DataModelNodeInterface
4342
* @param list<DataModelNodeInterface> $nodes
4443
*/
4544
public function __construct(
46-
private DataAccessorInterface $accessor,
45+
private string $accessor,
4746
array $nodes,
4847
) {
4948
if (\count($nodes) < 2) {
@@ -60,7 +59,7 @@ public function __construct(
6059
$this->nodes = $nodes;
6160
}
6261

63-
public function withAccessor(DataAccessorInterface $accessor): self
62+
public function withAccessor(string $accessor): self
6463
{
6564
return new self($accessor, array_map(static fn (DataModelNodeInterface $n): DataModelNodeInterface => $n->withAccessor($accessor), $this->nodes));
6665
}
@@ -70,7 +69,7 @@ public function getIdentifier(): string
7069
return (string) $this->getType();
7170
}
7271

73-
public function getAccessor(): DataAccessorInterface
72+
public function getAccessor(): string
7473
{
7574
return $this->accessor;
7675
}

src/Symfony/Component/JsonStreamer/DataModel/Write/DataModelNodeInterface.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\JsonStreamer\DataModel\Write;
1313

14-
use Symfony\Component\JsonStreamer\DataModel\DataAccessorInterface;
1514
use Symfony\Component\TypeInfo\Type;
1615

1716
/**
@@ -27,7 +26,7 @@ public function getIdentifier(): string;
2726

2827
public function getType(): Type;
2928

30-
public function getAccessor(): DataAccessorInterface;
29+
public function getAccessor(): string;
3130

32-
public function withAccessor(DataAccessorInterface $accessor): self;
31+
public function withAccessor(string $accessor): self;
3332
}

0 commit comments

Comments
 (0)