Skip to content

Commit 7b490e3

Browse files
committed
- chore: use native functions
1 parent 404d275 commit 7b490e3

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

DIContainer.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function __destruct()
101101

102102
public function __invoke(callable $callable, array $arguments = [])
103103
{
104-
return call_user_func_array($callable, $this->reflection->processMethodArguments(
104+
return \call_user_func_array($callable, $this->reflection->processMethodArguments(
105105
$this, $this->reflection->newMethodFromCallable($callable), $arguments
106106
));
107107
}
@@ -187,7 +187,7 @@ public function share(object $instance, array $exclude = []): DIContainerInterfa
187187
*/
188188
public function bind(string $interface, string $class = ''): DIContainerInterface
189189
{
190-
assert(false === empty($interface), 'Dependency name for bind() method');
190+
\assert(false === empty($interface), 'Dependency name for bind() method');
191191
if ('$' === ($class[0] ?? null)) {
192192
$this->bindings[$interface] = $interface;
193193
$class && $this->bindings[$class] = $interface;
@@ -208,7 +208,7 @@ public function bind(string $interface, string $class = ''): DIContainerInterfac
208208
*/
209209
public function named(string $name, mixed $value): DIContainerInterface
210210
{
211-
if (1 !== preg_match('/\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $name)) {
211+
if (1 !== \preg_match('/\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $name)) {
212212
throw DIException::forInvalidParameterName($name);
213213
}
214214
$this->named[$name] = $value;
@@ -233,7 +233,7 @@ public function getStorage(): array
233233
*/
234234
public function has($id): bool
235235
{
236-
assert(false === empty($id), 'Dependency name for has() method');
236+
\assert(false === empty($id), 'Dependency name for has() method');
237237
return isset($this->bindings[$id]) || isset($this->named[$id]);
238238
}
239239

@@ -257,13 +257,13 @@ private function newInstance(string $class, array $arguments): object
257257

258258
private function getNameFromBindings(string $dependency): string
259259
{
260-
assert(false === empty($dependency), 'Dependency name for class/interface');
260+
\assert(false === empty($dependency), 'Dependency name for class/interface');
261261
return $this->bindings[$dependency] ?? $dependency;
262262
}
263263

264264
private function bindInterfaces(object $dependency, string $class): void
265265
{
266-
foreach (class_implements($dependency) as $interface) {
266+
foreach (\class_implements($dependency) as $interface) {
267267
if (isset($this->bindings[$interface])) {
268268
$this->bindings[$interface] = $class;
269269
break;

0 commit comments

Comments
 (0)