Skip to content

Commit 89a494e

Browse files
authored
Merge pull request #16 from linna/b3.0.0
Align master to b3.0.0
2 parents 86b4751 + 42898a6 commit 89a494e

13 files changed

+138
-120
lines changed

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tools:
1414

1515
build:
1616
environment:
17-
php: 7.1
17+
php: 8.0
1818
tests:
1919
override:
2020
-

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ 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
9+
## [v2.0.1](https://github.com/linna/typed-array/compare/v2.0.0...v2.0.1) - 2020-03-23
1010

1111
### Added
1212
- php 7.3 support
13+
- php 7.4 support
1314

1415
### Changed
1516
- `.scrutinizer.yml` updated for use phpunit from `vendor` directory
1617
- Merge pull request #14 from peter279k/enhance_stuffs with code enhancements
1718

19+
### Removed
20+
- Travis CI usage for test build.
21+
1822
## [v2.0.0](https://github.com/linna/typed-array/compare/v1.0.5...v2.0.0) - 2018-08-13
1923

2024
### Changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<div align="center">
1414

15-
[![Build Status](https://travis-ci.org/linna/typed-array.svg?branch=master)](https://travis-ci.org/linna/typed-array)
15+
[![Tests](https://github.com/linna/typed-array/actions/workflows/tests.yml/badge.svg)](https://github.com/linna/typed-array/actions/workflows/tests.yml)
1616
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/linna/typed-array/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/linna/typed-array/?branch=master)
1717
[![Code Coverage](https://scrutinizer-ci.com/g/linna/typed-array/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/linna/typed-array/?branch=master)
1818
[![StyleCI](https://styleci.io/repos/93407083/shield?branch=master&style=flat)](https://styleci.io/repos/93407083)

src/Linna/TypedArrayObject/ClassArrayObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ClassArrayObject extends ArrayObject
3737
public function __construct(string $class, array $input = [], int $flags = 0, string $iterator_class = "ArrayIterator")
3838
{
3939
$this->type = $class;
40-
40+
4141
if (!\class_exists($class)) {
4242
throw new InvalidArgumentException("Type <{$this->type}> provided isn't a class.");
4343
}

tests/ArrayArrayObjectTest.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ public function testSetValueWithValidArgument(): void
4343
{
4444
$arrayArray = new ArrayArrayObject();
4545
$arrayArray[] = [1,2,3];
46-
46+
4747
$this->assertSame(1, $this->count($arrayArray));
4848
$this->assertSame([1,2,3], $arrayArray[0]);
4949
}
50-
50+
5151
/**
5252
* Test append value with valid argument.
5353
*/
5454
public function testAppendValueWithValidArgument(): void
5555
{
5656
$arrayArray = new ArrayArrayObject();
5757
$arrayArray->append([1,2,3]);
58-
58+
5959
$this->assertSame(1, $this->count($arrayArray));
6060
$this->assertSame([1,2,3], $arrayArray[0]);
6161
}
62-
62+
6363
/**
6464
* Provide invalid typed arrays.
6565
*
@@ -70,7 +70,9 @@ public function invalidArrayProvider(): array
7070
return [
7171
//[[[1], [2]]], //array
7272
[[true, false]], //bool
73-
[[function () {}, function () {}]], //callable
73+
[[function () {
74+
}, function () {
75+
}]], //callable
7476
[[1.1, 2.2]], //float
7577
[[1, 2]], //int
7678
[[(object) ['name' => 'foo'], (object) ['name' => 'bar']]], //object
@@ -80,13 +82,13 @@ public function invalidArrayProvider(): array
8082

8183
/**
8284
* Test new instance with invalid argument.
83-
*
85+
*
8486
* @dataProvider invalidArrayProvider
8587
*/
8688
public function testNewInstanceWithInvalidArgument(array $array): void
8789
{
8890
$this->expectException(InvalidArgumentException::class);
89-
91+
9092
$arrayArray = new ArrayArrayObject($array);
9193
}
9294

@@ -100,7 +102,8 @@ public function invalidValueProvider(): array
100102
return [
101103
//[[1]], //array
102104
[true], //bool
103-
[function () {}], //callable
105+
[function () {
106+
}], //callable
104107
[1.1], //float
105108
[1], //int
106109
[(object) ['name' => 'foo']], //object
@@ -110,26 +113,26 @@ public function invalidValueProvider(): array
110113

111114
/**
112115
* Test set value with invalid argument.
113-
*
116+
*
114117
* @dataProvider invalidValueProvider
115118
*/
116119
public function testSetValueWithInvalidArgument($value): void
117120
{
118121
$this->expectException(InvalidArgumentException::class);
119-
122+
120123
$arrayArray = new ArrayArrayObject();
121124
$arrayArray[] = $value;
122125
}
123126

124127
/**
125128
* Test append value with invalid argument.
126-
*
129+
*
127130
* @dataProvider invalidValueProvider
128131
*/
129132
public function testAppendValueWithInvalidArgument($value): void
130133
{
131134
$this->expectException(InvalidArgumentException::class);
132-
135+
133136
$arrayArray = new ArrayArrayObject();
134137
$arrayArray->append($value);
135138
}

tests/BoolArrayObjectTest.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ public function testSetValueWithValidArgument(): void
4343
{
4444
$boolArray = new BoolArrayObject();
4545
$boolArray[] = false;
46-
46+
4747
$this->assertSame(1, $this->count($boolArray));
4848
$this->assertSame(false, $boolArray[0]);
4949
}
50-
50+
5151
/**
5252
* Test append value with valid argument.
5353
*/
5454
public function testAppendValueWithValidArgument(): void
5555
{
5656
$boolArray = new BoolArrayObject();
5757
$boolArray->append(false);
58-
58+
5959
$this->assertSame(1, $this->count($boolArray));
6060
$this->assertSame(false, $boolArray[0]);
6161
}
62-
62+
6363
/**
6464
* Provide invalid typed arrays.
6565
*
@@ -70,7 +70,9 @@ public function invalidArrayProvider(): array
7070
return [
7171
[[[1], [2]]], //array
7272
//[[true, false]], //bool
73-
[[function () {}, function () {}]], //callable
73+
[[function () {
74+
}, function () {
75+
}]], //callable
7476
[[1.1, 2.2]], //float
7577
[[1, 2]], //int
7678
[[(object) ['name' => 'foo'], (object) ['name' => 'bar']]], //object
@@ -80,13 +82,13 @@ public function invalidArrayProvider(): array
8082

8183
/**
8284
* Test new instance with invalid argument.
83-
*
85+
*
8486
* @dataProvider invalidArrayProvider
8587
*/
8688
public function testNewInstanceWithInvalidArgument(array $array): void
8789
{
8890
$this->expectException(InvalidArgumentException::class);
89-
91+
9092
$boolArray = new BoolArrayObject($array);
9193
}
9294

@@ -100,7 +102,8 @@ public function invalidValueProvider(): array
100102
return [
101103
[[1]], //array
102104
//[true], //bool
103-
[function () {}], //callable
105+
[function () {
106+
}], //callable
104107
[1.1], //float
105108
[1], //int
106109
[(object) ['name' => 'foo']], //object
@@ -110,26 +113,26 @@ public function invalidValueProvider(): array
110113

111114
/**
112115
* Test set value with invalid argument.
113-
*
116+
*
114117
* @dataProvider invalidValueProvider
115118
*/
116119
public function testSetValueWithInvalidArgument($value): void
117120
{
118121
$this->expectException(InvalidArgumentException::class);
119-
122+
120123
$boolArray = new BoolArrayObject();
121124
$boolArray[] = $value;
122125
}
123126

124127
/**
125128
* Test append value with invalid argument.
126-
*
129+
*
127130
* @dataProvider invalidValueProvider
128131
*/
129132
public function testAppendValueWithInvalidArgument($value): void
130133
{
131134
$this->expectException(InvalidArgumentException::class);
132-
135+
133136
$boolArray = new BoolArrayObject();
134137
$boolArray->append($value);
135138
}

tests/CallableArrayObjectTest.php

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public function testNewInstance(): void
3333
*/
3434
public function testNewInstanceWithValidArgument(): void
3535
{
36-
$this->assertInstanceOf(CallableArrayObject::class, (new CallableArrayObject([function($e){return $e+1;}])));
36+
$this->assertInstanceOf(CallableArrayObject::class, (new CallableArrayObject([function ($e) {
37+
return $e+1;
38+
}])));
3739
}
3840

3941
/**
@@ -42,24 +44,28 @@ public function testNewInstanceWithValidArgument(): void
4244
public function testSetValueWithValidArgument(): void
4345
{
4446
$callableArray = new CallableArrayObject();
45-
$callableArray[] = function($e){return $e+1;};
46-
47+
$callableArray[] = function ($e) {
48+
return $e+1;
49+
};
50+
4751
$this->assertSame(1, $this->count($callableArray));
48-
$this->assertSame(true, is_callable($callableArray[0]));
52+
$this->assertSame(true, \is_callable($callableArray[0]));
4953
}
50-
54+
5155
/**
5256
* Test append value with valid argument.
5357
*/
5458
public function testAppendValueWithValidArgument(): void
5559
{
5660
$callableArray = new CallableArrayObject();
57-
$callableArray->append(function($e){return $e+1;});
58-
61+
$callableArray->append(function ($e) {
62+
return $e+1;
63+
});
64+
5965
$this->assertSame(1, $this->count($callableArray));
60-
$this->assertSame(true, is_callable($callableArray[0]));
66+
$this->assertSame(true, \is_callable($callableArray[0]));
6167
}
62-
68+
6369
/**
6470
* Provide invalid typed arrays.
6571
*
@@ -80,13 +86,13 @@ public function invalidArrayProvider(): array
8086

8187
/**
8288
* Test new instance with invalid argument.
83-
*
89+
*
8490
* @dataProvider invalidArrayProvider
8591
*/
8692
public function testNewInstanceWithInvalidArgument(array $array): void
8793
{
8894
$this->expectException(InvalidArgumentException::class);
89-
95+
9096
$callableArray = new CallableArrayObject($array);
9197
}
9298

@@ -110,26 +116,26 @@ public function invalidValueProvider(): array
110116

111117
/**
112118
* Test set value with invalid argument.
113-
*
119+
*
114120
* @dataProvider invalidValueProvider
115121
*/
116122
public function testSetValueWithInvalidArgument($value): void
117123
{
118124
$this->expectException(InvalidArgumentException::class);
119-
125+
120126
$callableArray = new CallableArrayObject();
121127
$callableArray[] = $value;
122128
}
123129

124130
/**
125131
* Test append value with invalid argument.
126-
*
132+
*
127133
* @dataProvider invalidValueProvider
128134
*/
129135
public function testAppendValueWithInvalidArgument($value): void
130136
{
131137
$this->expectException(InvalidArgumentException::class);
132-
138+
133139
$callableArray = new CallableArrayObject();
134140
$callableArray->append($value);
135141
}

0 commit comments

Comments
 (0)