File tree Expand file tree Collapse file tree 1 file changed +4
-18
lines changed
Expand file tree Collapse file tree 1 file changed +4
-18
lines changed Original file line number Diff line number Diff line change 2727use ReflectionObject ;
2828use ReflectionProperty ;
2929
30+ use function array_keys ;
31+ use function array_values ;
3032use function json_decode ;
3133use function json_encode ;
3234use function property_exists ;
@@ -86,14 +88,7 @@ public function __construct(string $saveToPath, Filesystem $filesystem)
8688 */
8789 public function getTokens (): array
8890 {
89- $ tokens = [];
90-
91- $ reflected = new ReflectionObject ($ this );
92- foreach ($ reflected ->getProperties (ReflectionProperty::IS_PUBLIC ) as $ property ) {
93- $ tokens [] = $ property ->getName ();
94- }
95-
96- return $ tokens ;
91+ return array_keys ($ this ->getArrayCopy ());
9792 }
9893
9994 /**
@@ -103,16 +98,7 @@ public function getTokens(): array
10398 */
10499 public function getValues (): array
105100 {
106- $ values = [];
107-
108- $ reflected = new ReflectionObject ($ this );
109- foreach ($ reflected ->getProperties (ReflectionProperty::IS_PUBLIC ) as $ property ) {
110- /** @var string | string[] | bool | null $value */
111- $ value = $ property ->getValue ($ this );
112- $ values [] = $ value ;
113- }
114-
115- return $ values ;
101+ return array_values ($ this ->getArrayCopy ());
116102 }
117103
118104 /**
You can’t perform that action at this time.
0 commit comments