File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,8 +121,6 @@ public static function validate(string $uri): array
121121 * @param object $object Object exposing getMyKey()
122122 * @param array<string, mixed> $args Optional query parameters
123123 *
124- * @throws \InvalidArgumentException
125- *
126124 * @return string EaseURI
127125 */
128126 public static function fromObject (object $ object , array $ args = []): string
@@ -137,10 +135,6 @@ public static function fromObject(object $object, array $args = []): string
137135 $ class = $ ref ->getShortName ();
138136 $ id = (string ) $ object ->getMyKey ();
139137
140- if ($ id === '' ) {
141- throw new \InvalidArgumentException ('Object identifier is empty ' );
142- }
143-
144138 $ path = str_replace ('\\' , '/ ' , $ namespace );
145139 $ path = $ path ? $ path .'/ ' .$ class : $ class ;
146140
@@ -151,11 +145,11 @@ public static function fromObject(object $object, array $args = []): string
151145 $ base .= '? ' .http_build_query ($ args , '' , '& ' , \PHP_QUERY_RFC3986 );
152146 }
153147
154- return $ base .'# ' .rawurlencode ($ id );
148+ return $ base .( \strlen ( $ id ) ? '# ' .rawurlencode ($ id) : '' );
155149 }
156150
157151 /**
158- * Exctract Class part only.
152+ * Extract Class part only.
159153 *
160154 * @return string Class
161155 */
You can’t perform that action at this time.
0 commit comments