Skip to content

Commit

Permalink
3.x json serialize (#707)
Browse files Browse the repository at this point in the history
* fix deprecation on jsonSerialize

* upgrade repo checks

Co-authored-by: Massimiliano Arione <[email protected]>
  • Loading branch information
frederikbosch and garak committed Sep 5, 2022
1 parent a44e2f2 commit acb3924
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Install
uses: docker://composer
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Set up PHP
uses: shivammathur/setup-php@1.7.0
uses: shivammathur/setup-php@v2
with:
php-version: '5.6'
extensions: bcmath, gmp, intl, dom, mbstring
Expand All @@ -22,7 +22,7 @@ jobs:
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Set up locales
run: ./hack/setup-locales.sh
Expand All @@ -43,7 +43,7 @@ jobs:

steps:
- name: Set up PHP
uses: shivammathur/setup-php@1.6.2
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: bcmath, gmp, intl, dom, mbstring
Expand All @@ -52,7 +52,7 @@ jobs:
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Set up locales
run: ./hack/setup-locales.sh
Expand All @@ -74,7 +74,7 @@ jobs:
architecture: 'x64'

- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Install dependencies
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,28 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga:2.16.3.1
uses: docker://oskarstark/php-cs-fixer-ga:2.19.0
with:
args: --dry-run --diff-format udiff
args: src --dry-run --diff-format udiff

psalm:
name: Psalm
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Install
uses: docker://composer
with:
args: install --ignore-platform-reqs --no-ansi --no-suggest

- name: Psalm
uses: docker://vimeo/psalm-github-actions
uses: docker://vimeo/psalm-github-actions:3.14.2
with:
entrypoint: ./.github/workflows/psalm.entrypoint
args: --threads=8 --diff --diff-methods
args: --threads=8 --diff
28 changes: 16 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "moneyphp/money",
"description": "PHP implementation of Fowler's Money pattern",
"license": "MIT",
"keywords": [
"money",
"vo",
"value object"
],
"homepage": "http://moneyphp.org",
"license": "MIT",
"authors": [
{
"name": "Mathias Verraes",
Expand All @@ -23,6 +22,7 @@
"email": "[email protected]"
}
],
"homepage": "http://moneyphp.org",
"require": {
"php": ">=5.6",
"ext-json": "*"
Expand Down Expand Up @@ -52,14 +52,8 @@
"florianv/swap": "Exchange rates library for PHP",
"psr/cache-implementation": "Used for Currency caching"
},
"config": {
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Money\\": "src/"
Expand All @@ -71,8 +65,18 @@
"spec\\Money\\": "spec/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true
},
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"scripts": {
"clean": "rm -rf build/ vendor/",
"test": [
Expand Down
5 changes: 3 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinxcontrib.phpdomain',
'sphinxcontrib.spelling'
]

Expand Down Expand Up @@ -155,8 +156,8 @@
html_static_path = ['_static']

def setup(app):
app.add_stylesheet('custom.css')
app.add_stylesheet('highlight.css')
app.add_css_file('custom.css')
app.add_css_file('highlight.css')

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
7 changes: 4 additions & 3 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
git+https://github.com/fabpot/sphinx-php.git
sphinx~=1.3.0
sphinx-rtd-theme==0.1.6
sphinxcontrib-spelling==4.2.0
sphinx~=4.3.1
sphinx-rtd-theme==1.0.0
git+https://github.com/markstory/sphinxcontrib-phpdomain.git
sphinxcontrib-spelling==7.2.1
pyenchant
1 change: 1 addition & 0 deletions doc/spelling_word_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Formatter
unprobable
Instantiation
instantiation
Exchanger

Foemmel
Hieatt
Expand Down
1 change: 1 addition & 0 deletions src/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function __toString()
*
* @return string
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->code;
Expand Down
1 change: 1 addition & 0 deletions src/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ public function isNegative()
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [
Expand Down

0 comments on commit acb3924

Please sign in to comment.