Skip to content

Commit a7a1223

Browse files
committed
移除無用函式
1 parent 0a3c457 commit a7a1223

File tree

2 files changed

+2
-44
lines changed

2 files changed

+2
-44
lines changed

src/AutoMountDependencies.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ protected function mountDependencies($override = false)
3636
/**
3737
* 指定屬性或屬性名稱;嘗試解析它定義的型別,並進行依賴注入。
3838
*
39-
* @param \ReflectionProperty|string $property
40-
* @param bool $override
39+
* @param \ReflectionProperty|string $property
40+
* @param bool $override
4141
* @return void
4242
*
4343
* @throws \ReflectionException

src/Support/Reflector.php

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace A2Workspace\AutoMount\Support;
44

55
use ReflectionClass;
6-
use ReflectionObject;
76
use ReflectionProperty;
87
use ReflectionNamedType;
98

@@ -63,45 +62,4 @@ public static function getPropertyHintedClassName(ReflectionProperty $property):
6362

6463
return $name;
6564
}
66-
67-
/**
68-
* 取得包含類別名的完整屬性名稱。
69-
*
70-
* @param \ReflectionProperty $property
71-
* @return string
72-
*/
73-
public static function getPropertyFullName(ReflectionProperty $property): string
74-
{
75-
return sprintf(
76-
'%s::$%s',
77-
$property->getDeclaringClass()->getName(),
78-
$property->getName()
79-
);
80-
}
81-
82-
/**
83-
* 取得物件的動態屬性 (dynamic properties) 列表。
84-
*
85-
* 回傳一個陣列,包含物件在執行階段宣告的,且未定義為成員的屬性。
86-
*
87-
* @param object $object
88-
* @return array
89-
*/
90-
public static function getDynamicProperties(object $object): array
91-
{
92-
$reflector = new ReflectionObject($object);
93-
94-
$properties = $reflector->getProperties();
95-
$properties = array_filter($properties, function (ReflectionProperty $property) {
96-
return ! $property->isDefault();
97-
});
98-
99-
$results = [];
100-
101-
foreach ($properties as $property) {
102-
$results[$property->getName()] = $property->getValue($object);
103-
}
104-
105-
return $results;
106-
}
10765
}

0 commit comments

Comments
 (0)