Skip to content

Commit 95cf9e1

Browse files
committed
backslash in front of native funcs added
1 parent 1c31a4f commit 95cf9e1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/TypedArray.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class TypedArray extends ArrayObject
8282
*/
8383
public function __construct(string $type, array $array = [])
8484
{
85-
if (class_exists($type)) {
85+
if (\class_exists($type)) {
8686
//I like lambda functions ;)
8787
$this->allowedTypes[$type] = function ($a) use ($type) {
8888
if ($a instanceof $type) {
@@ -99,7 +99,7 @@ public function __construct(string $type, array $array = [])
9999

100100
//for not utilize foreach, compare sizes of array
101101
//before and after apply a filter :)
102-
if (count($array) > count(array_filter($array, $this->allowedTypes[$type]))) {
102+
if (\count($array) > \count(\array_filter($array, $this->allowedTypes[$type]))) {
103103
throw new InvalidArgumentException(__CLASS__.': Elements passed to '.__METHOD__.' must be of the type '.$type.'.');
104104
}
105105

tests/TypedArrayTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public function testIteratorClass()
287287
$arrayAsParam = ['a','b','c','d','e','f','g','h','i'];
288288
$array = new TypedArray('string', $arrayAsParam);
289289

290-
$this->assertEquals($arrayAsParam, iterator_to_array($array));
290+
$this->assertEquals($arrayAsParam, \iterator_to_array($array));
291291
}
292292

293293
/**
@@ -309,8 +309,8 @@ public function testCreateInstanceWithRightObjectTypedArray()
309309
TypedArray::class,
310310
(
311311
new TypedArray(
312-
ArrayObject::class,
313-
[
312+
ArrayObject::class,
313+
[
314314
new ArrayObject([1, 2, 3]),
315315
new ArrayObject([1.1, 2.2, 3.3]),
316316
new ArrayObject(['a', 'b', 'c']),
@@ -331,8 +331,8 @@ public function testCreateInstanceWithWrongObjectTypedArray()
331331
TypedArray::class,
332332
(
333333
new TypedArray(
334-
ArrayObject::class,
335-
[
334+
ArrayObject::class,
335+
[
336336
new ArrayObject([1, 2, 3]),
337337
new ArrayObject([1.1, 2.2, 3.3]),
338338
new SplStack(),

0 commit comments

Comments
 (0)