Skip to content

Commit 63301fb

Browse files
authored
Merge pull request #15 from linna/b2.0.0
B2.0.1
2 parents 195aa1f + 95cf9e1 commit 63301fb

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

.scrutinizer.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,8 @@ build:
1818
tests:
1919
override:
2020
-
21-
command: '/usr/local/bin/phpunit --coverage-clover=clover.xml'
21+
command: './vendor/bin/phpunit --coverage-clover=clover.xml'
2222
coverage:
2323
file: 'clover.xml'
2424
format: 'clover'
2525

26-
project_setup:
27-
before:
28-
- wget https://phar.phpunit.de/phpunit.phar
29-
- chmod +x phpunit.phar
30-
- sudo mv phpunit.phar /usr/local/bin/phpunit

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](http://keepachangelog.com/)
77
and this project adheres to [Semantic Versioning](http://semver.org/).
88

9+
## [v2.0.1](https://github.com/linna/typed-array/compare/v2.0.0...v2.0.1) - 2019-03-XX
10+
11+
### Added
12+
- php 7.3 support
13+
14+
### Changed
15+
- `.scrutinizer.yml` updated for use phpunit from `vendor` direcotry
16+
- Merge pull request #14 from peter279k/enhance_stuffs with code enhancements
17+
918
## [v2.0.0](https://github.com/linna/typed-array/compare/v1.0.5...v2.0.0) - 2018-08-13
1019

1120
### 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
return $a instanceof $type;
@@ -96,7 +96,7 @@ public function __construct(string $type, array $array = [])
9696

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

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)