Skip to content

Commit c634472

Browse files
committed
Merge branch 'release/2.1.0'
2 parents c7fadf4 + bb07839 commit c634472

File tree

12 files changed

+197
-70
lines changed

12 files changed

+197
-70
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
labels: bug
5+
---
6+
7+
**Describe the bug**
8+
A clear and concise description of what the bug is.
9+
10+
**To Reproduce**
11+
Steps to reproduce the behavior:
12+
1. When calling '...'
13+
2. At the JSON contains '....'
14+
3. Add I'm using the following middleware '....'
15+
4. See error
16+
17+
**Expected behavior**
18+
A clear and concise description of what you expected to happen.
19+
20+
**Stacktrace**
21+
If applicable, add the stack trace to help explain your problem.
22+
23+
**Environment (please complete the following information):**
24+
- PHP: [e.g. 7.4.1]
25+
26+
**Additional context**
27+
Add any other context about the problem here.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
labels: feature-request
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/other.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
name: Other
3+
about: Your issue doesn't fit the above
4+
---
5+
6+

.github/workflows/build.yaml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ develop, master ]
6+
pull_request:
7+
branches: [ develop, master ]
8+
9+
jobs:
10+
build:
11+
name: PHP ${{ matrix.name }}
12+
strategy:
13+
matrix:
14+
include:
15+
- php: 7.2
16+
allow_fail: false
17+
name: 'PHP 7.2 with latest deps'
18+
- php: 7.2
19+
allow_fail: false
20+
composer_update_flags: '--prefer-lowest --prefer-stable'
21+
name: 'PHP 7.2 with lowest stable deps'
22+
- php: 7.3
23+
allow_fail: false
24+
name: 'PHP 7.3 with latest deps'
25+
- php: 7.3
26+
allow_fail: false
27+
composer_update_flags: '--prefer-lowest --prefer-stable'
28+
name: 'PHP 7.3 with lowest stable deps'
29+
- php: 7.4
30+
allow_fail: false
31+
name: 'PHP 7.4 with latest deps'
32+
- php: 7.4
33+
allow_fail: false
34+
composer_update_flags: '--prefer-lowest --prefer-stable'
35+
name: 'PHP 7.4 with lowest stable deps'
36+
- php: 8.0
37+
allow_fail: false
38+
php_ini: 'xdebug.coverage_enable=On'
39+
name: 'PHP 8.0 with latest deps'
40+
- php: 8.0
41+
allow_fail: false
42+
composer_update_flags: '--prefer-lowest --prefer-stable'
43+
php_ini: 'xdebug.coverage_enable=On'
44+
name: 'PHP 8.0 with lowest stable deps'
45+
- php: 8.1
46+
allow_fail: true
47+
php_ini: 'xdebug.coverage_enable=On'
48+
name: 'PHP 8.1 with latest deps'
49+
- php: 8.1
50+
allow_fail: true
51+
composer_update_flags: '--prefer-lowest --prefer-stable'
52+
php_ini: 'xdebug.coverage_enable=On'
53+
name: 'PHP 8.1 with lowest stable deps'
54+
- php: 8.2
55+
allow_fail: true
56+
php_ini: 'xdebug.coverage_enable=On'
57+
name: 'PHP 8.2 with latest deps'
58+
- php: 8.2
59+
allow_fail: true
60+
composer_update_flags: '--prefer-lowest --prefer-stable'
61+
php_ini: 'xdebug.coverage_enable=On'
62+
name: 'PHP 8.2 with lowest stable deps'
63+
- php: 8.3
64+
allow_fail: true
65+
php_ini: 'xdebug.coverage_enable=On'
66+
name: 'PHP 8.3 with latest deps'
67+
- php: 8.3
68+
allow_fail: true
69+
composer_update_flags: '--prefer-lowest --prefer-stable'
70+
php_ini: 'xdebug.coverage_enable=On'
71+
name: 'PHP 8.3 with lowest stable deps'
72+
- php: 8.4
73+
allow_fail: true
74+
php_ini: 'xdebug.coverage_enable=On'
75+
name: 'PHP 8.4 with latest deps'
76+
- php: 8.4
77+
allow_fail: true
78+
composer_update_flags: '--prefer-lowest --prefer-stable'
79+
php_ini: 'xdebug.coverage_enable=On'
80+
name: 'PHP 8.4 with lowest stable deps'
81+
82+
runs-on: ubuntu-latest
83+
84+
steps:
85+
- uses: actions/checkout@v4
86+
87+
- name: Validate composer.json and composer.lock
88+
run: composer validate
89+
90+
- name: Setup PHP ${{ matrix.php }}
91+
uses: shivammathur/setup-php@v2
92+
with:
93+
php-version: ${{ matrix.php }}
94+
coverage: xdebug
95+
ini-values: ${{ matrix.php_ini }}
96+
97+
- name: Install dependencies
98+
run: composer install ${{ matrix.composer_flags }}
99+
continue-on-error: ${{ matrix.allow_fail }}
100+
101+
- name: Update dependencies
102+
if: matrix.composer_update_flags
103+
run: composer update ${{ matrix.composer_update_flags }} && composer update phpunit/phpunit guzzlehttp/guzzle --with-dependencies
104+
continue-on-error: ${{ matrix.allow_fail }}
105+
106+
- name: Create log folder
107+
run: mkdir -p build/logs;
108+
109+
- name: Run unit tests
110+
run: composer unit-tests
111+
continue-on-error: ${{ matrix.allow_fail }}
112+
113+
- name: Upload test coverage
114+
run: php vendor/bin/php-coveralls -vvv
115+
env:
116+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
COVERALLS_PARALLEL: true
118+
COVERALLS_FLAG_NAME: ${{ matrix.name }}
119+
continue-on-error: ${{ matrix.allow_fail }}
120+
121+
finish:
122+
needs: build
123+
runs-on: ubuntu-latest
124+
steps:
125+
- name: Coveralls Finished
126+
run: |
127+
curl --header "Content-Type: application/json" \
128+
--request POST \
129+
--data '{"repo_token":"${{ secrets.GITHUB_TOKEN }}","repo_name":"JsonMapper/LaravelPackage", "payload": {"build_num": "${{ github.sha }}", "status": "done"}}' \
130+
https://coveralls.io/webhook

.mergify.yml

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

.travis.yml

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

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9-
## [2.0.0]
9+
## [2.1.0] - 2025-02-19
10+
## Changed
11+
- Migrate from Travis CI to GitHub CI [PR#8](https://github.com/JsonMapper/EloquentMiddleware/pull/8)
12+
13+
## [2.0.0] - 2021-01-07
1014
## Changed
1115
- Update to version ^2.0 JsonMapper and LaravelPackage
1216
### Added

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
![Logo](https://jsonmapper.net/images/jsonmapper.png)
1+
<picture>
2+
<source media="(prefers-color-scheme: dark)" srcset="https://jsonmapper.net/images/jsonmapper-light.png">
3+
<img alt="JsonMapper logo" src="https://jsonmapper.net/images/jsonmapper.png">
4+
</picture>
25

36
---
47
**This is a Laravel package for using JsonMapper in you Laravel application.**

Version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0
1+
2.1.0

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
"json-mapper/laravel-package": "^2.0",
2828
"php": "^7.2 || ^8.0",
2929
"doctrine/dbal": "^2.3",
30-
"json-mapper/json-mapper": "^2.0"
30+
"json-mapper/json-mapper": "^2.13"
3131
},
3232
"require-dev": {
3333
"squizlabs/php_codesniffer": "^3.5",
3434
"phpstan/phpstan": "^0.12.19",
3535
"php-coveralls/php-coveralls": "^2.2",
36-
"orchestra/testbench": "^5.3",
36+
"orchestra/testbench": "^5.20",
3737
"phpunit/phpunit": "^8.5 || ^9.0"
3838
},
3939
"scripts": {

src/EloquentMiddleware.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use JsonMapper\Enums\Visibility;
1111
use JsonMapper\JsonMapperInterface;
1212
use JsonMapper\Middleware\AbstractMiddleware;
13+
use JsonMapper\ValueObjects\ArrayInformation;
1314
use JsonMapper\ValueObjects\PropertyMap;
1415
use JsonMapper\ValueObjects\PropertyType;
1516
use JsonMapper\Wrapper\ObjectWrapper;
@@ -132,7 +133,7 @@ protected function discoverPropertiesFromTable(Model $model, PropertyMap $proper
132133

133134
$property = PropertyBuilder::new()
134135
->setName($name)
135-
->addType($type, false)
136+
->addType($type, ArrayInformation::notAnArray())
136137
->setIsNullable(!$column->getNotnull())
137138
->setVisibility(Visibility::PUBLIC())
138139
->build();

tests/Unit/EloquentMiddlewareTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace JsonMapper\EloquentMiddleware\Tests\Integration;
5+
namespace JsonMapper\EloquentMiddleware\Tests\Unit;
66

77
use Doctrine\DBAL\Platforms\AbstractPlatform;
88
use Doctrine\DBAL\Schema\AbstractSchemaManager;
@@ -15,6 +15,7 @@
1515
use JsonMapper\Enums\Visibility;
1616
use JsonMapper\JsonMapperInterface;
1717
use JsonMapper\Tests\Helpers\AssertThatPropertyTrait;
18+
use JsonMapper\ValueObjects\ArrayInformation;
1819
use JsonMapper\ValueObjects\PropertyMap;
1920
use JsonMapper\Wrapper\ObjectWrapper;
2021
use Orchestra\Testbench\TestCase;
@@ -52,7 +53,7 @@ public function testColumnsFromTheDatabaseAreReturned(): void
5253
self::assertTrue($propertyMap->hasProperty('id'));
5354
$this->assertThatProperty($propertyMap->getProperty('id'))
5455
->hasName('id')
55-
->onlyHasType('integer', false)
56+
->onlyHasType('integer', ArrayInformation::notAnArray())
5657
->hasVisibility(Visibility::PUBLIC())
5758
->isNotNullable();
5859
}

0 commit comments

Comments
 (0)