Skip to content

Commit f405a10

Browse files
Merge pull request #8 from makeabledk/feat/laravel-9
Merge feat/laravel-9
2 parents 229221e + cea2a7f commit f405a10

File tree

10 files changed

+57
-61
lines changed

10 files changed

+57
-61
lines changed

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Run tests
2+
3+
on:
4+
push:
5+
schedule:
6+
- cron: '0 0 * * *'
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php: [8.0, 8.1]
16+
laravel: [8.*, 9.*]
17+
dependency-version: [prefer-stable]
18+
19+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v1
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
30+
coverage: none
31+
32+
- name: Install dependencies
33+
run: |
34+
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
35+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
36+
37+
- name: Execute tests
38+
run: vendor/bin/phpunit

.travis.yml

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

composer.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
},
99
"require": {
1010
"php": ">=7.2",
11-
"illuminate/support": "^6.0|^7.0|^8.0",
11+
"illuminate/support": "^6.0|^7.0|^8.0|^9.0",
1212
"nesbot/carbon": "1.*|2.*"
1313
},
1414
"require-dev": {
15-
"phpunit/phpunit": "^8.5",
16-
"friendsofphp/php-cs-fixer": "^2.3"
15+
"phpunit/phpunit": "^8.5|^9.5"
1716
},
1817
"config": {
1918
"optimize-autoloader": true,
@@ -27,7 +26,6 @@
2726
}
2827
},
2928
"scripts": {
30-
"test": "./vendor/bin/phpunit",
31-
"style": "./vendor/bin/php-cs-fixer fix ./src --rules=@PSR2,@Symfony,ordered_class_elements,ordered_imports --verbose"
29+
"test": "./vendor/bin/phpunit"
3230
}
3331
}

readme.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
2-
31
# Laravel Value Objects
42

53
[![Latest Version on Packagist](https://img.shields.io/packagist/v/makeabledk/php-value-objects.svg?style=flat-square)](https://packagist.org/packages/makeabledk/php-value-objects)
6-
[![Build Status](https://img.shields.io/travis/makeabledk/php-value-objects/master.svg?style=flat-square)](https://travis-ci.org/makeabledk/php-value-objects)
4+
[![Build Status](https://img.shields.io/github/workflow/status/makeabledk/php-value-objects/Run%20tests?label=Tests)](https://github.com/makeabledk/php-value-objects/actions)
75
[![StyleCI](https://styleci.io/repos/95552761/shield?branch=master)](https://styleci.io/repos/95552761)
86

97
This package provides a set of handy value objects:

src/Duration/Duration.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,9 @@ public function toFormat()
9696
}
9797

9898
/**
99-
* @param float $hours
100-
* @param int $minutes
101-
* @param int $seconds
102-
*
99+
* @param float $hours
100+
* @param int $minutes
101+
* @param int $seconds
103102
* @return static
104103
*/
105104
public static function create($hours, $minutes = 0, $seconds = 0)
@@ -108,8 +107,7 @@ public static function create($hours, $minutes = 0, $seconds = 0)
108107
}
109108

110109
/**
111-
* @param array $exported
112-
*
110+
* @param array $exported
113111
* @return Duration
114112
*/
115113
public static function fromArray($exported)

src/Duration/DurationFormatter.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class DurationFormatter
1919
/**
2020
* DurationFormatter constructor.
2121
*
22-
* @param Duration $duration
22+
* @param Duration $duration
2323
*/
2424
public function __construct(Duration $duration)
2525
{
@@ -33,7 +33,6 @@ public function __construct(Duration $duration)
3333

3434
/**
3535
* @param $format
36-
*
3736
* @return mixed
3837
*/
3938
public function get($format)
@@ -66,9 +65,8 @@ public function get($format)
6665
}
6766

6867
/**
69-
* @param Collection $units
68+
* @param Collection $units
7069
* @param $format
71-
*
7270
* @return mixed
7371
*/
7472
protected function applyFormat(Collection $units, $format)
@@ -83,8 +81,7 @@ protected function applyFormat(Collection $units, $format)
8381
}
8482

8583
/**
86-
* @param Collection $units
87-
*
84+
* @param Collection $units
8885
* @return Collection
8986
*/
9087
protected function normalizeUnitValues(Collection $units)

src/Duration/DurationOperations.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
trait DurationOperations
66
{
77
/**
8-
* @param Duration $duration
9-
*
8+
* @param Duration $duration
109
* @return static
1110
*/
1211
public function add(Duration $duration)
@@ -15,8 +14,7 @@ public function add(Duration $duration)
1514
}
1615

1716
/**
18-
* @param Duration $duration
19-
*
17+
* @param Duration $duration
2018
* @return static
2119
*/
2220
public function subtract(Duration $duration)
@@ -28,8 +26,7 @@ public function subtract(Duration $duration)
2826
* Retrieve the sum of an array.
2927
*
3028
* @param $items
31-
* @param null $callback
32-
*
29+
* @param null $callback
3330
* @return Duration
3431
*
3532
* @throws \Exception

src/Period/Period.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ public function __construct($start = null, $end = null)
3636
}
3737

3838
/**
39-
* @param array $exported
40-
*
39+
* @param array $exported
4140
* @return Period
4241
*
4342
* @throws \Exception
@@ -89,8 +88,7 @@ public function getEnd()
8988
// _________________________________________________________________________________________________________________
9089

9190
/**
92-
* @param Carbon $time
93-
*
91+
* @param Carbon $time
9492
* @return Period
9593
*/
9694
public function earliest(Carbon $time)
@@ -102,8 +100,7 @@ public function earliest(Carbon $time)
102100
}
103101

104102
/**
105-
* @param Carbon $time
106-
*
103+
* @param Carbon $time
107104
* @return Period
108105
*/
109106
public function latest(Carbon $time)
@@ -118,7 +115,6 @@ public function latest(Carbon $time)
118115

119116
/**
120117
* @param $time
121-
*
122118
* @return Carbon|null
123119
*/
124120
protected function normalizeInput($time)
@@ -135,7 +131,6 @@ protected function normalizeInput($time)
135131

136132
/**
137133
* @param $time
138-
*
139134
* @return Carbon|null
140135
*/
141136
protected function normalizeOutput($time)
@@ -144,8 +139,8 @@ protected function normalizeOutput($time)
144139
}
145140

146141
/**
147-
* @param Carbon $start
148-
* @param Carbon $end
142+
* @param Carbon $start
143+
* @param Carbon $end
149144
*
150145
* @throws \Exception
151146
*/

src/Shared/RetrievesValues.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ trait RetrievesValues
88
* Returns a closure function to retrieve a value from an $item parameter.
99
*
1010
* @param $callback
11-
*
1211
* @return \Closure
1312
*/
1413
private static function valueRetriever($callback)

src/Whitelist/Whitelist.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public function get()
4545

4646
/**
4747
* @param $value
48-
*
4948
* @return bool
5049
*/
5150
public static function isValid($value)

0 commit comments

Comments
 (0)