Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/project-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Unit tests & static analysis

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
check:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: [ "8.2", "8.3", "8.4" ]
container:
image: ghcr.io/shoppingflux/php:${{ matrix.php_version }}-unit
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
XDEBUG_MODE: off
credentials:
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}
steps:
- name: Composer install
uses: shoppingflux/github-actions/composer-install@main

- name: Run test script
run: composer test
26 changes: 26 additions & 0 deletions .github/workflows/project-sonar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Sonarcloud reporting

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
sonarcloud:
runs-on: ubuntu-latest
container:
image: ghcr.io/shoppingflux/php:8.2-unit
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
XDEBUG_MODE: coverage
credentials:
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}

steps:
- name: Sonarcloud scan
uses: shoppingflux/github-actions/sonarcloud@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
sonar-token: ${{ secrets.SONARCLOUD_TOKEN }}
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

33 changes: 33 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# shoppingfeed/hal

## Installation

```
composer require shoppingfeed/hal
```

## Contributing

To connect to a php 8.2 container correctly configured

- Create a container : `docker run --name hal-php -v $PWD:/var/www -d ghcr.io/shoppingflux/php:8.2-unit`
- Start container : `docker start hal-php`
- Connect to container : `docker exec -it hal-php bash`

Once connected to the container you can :

- Update composer dependencies : `composer update`
- Run test : `composer test`

## Enable debugger

```bash
export XDEBUG_TRIGGER=1
export XDEBUG_CONFIG="client_host=172.17.0.1"
export PHP_IDE_CONFIG=serverName=api.shopping-feed.lan
export XDEBUG_MODE=debug
```

## Documentation

Documentation is available at [docs/index.md](docs/index.md)
38 changes: 32 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,50 @@
}
],
"require": {
"php": ">=5.3.0",
"psr/link": "~1.0"
"php": ">=8.2"
},
"require-dev": {
"phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35"
"overtrue/phplint": "^9.4",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^11.0",
"rector/rector": "^2.2",
"roave/security-advisories": "dev-latest",
"laminas/laminas-servicemanager": "^4.5",
"shoppingfeed/coding-style-php": "^2.0",
"symfony/cache": "^7.3"
},
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"Nocarrier\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Nocarrier\\Tests\\": "tests/Hal"
"Nocarrier\\Test\\": "test/Hal"
}
},
"scripts": {
"phpunit": "vendor/bin/phpunit",
"phpcs": "vendor/bin/sfcs src test --progress -vvv",
"phpcsfix": "vendor/bin/sfcs src test --progress -vvv --autofix",
"phpstan": "vendor/bin/phpstan analyse",
"phplint": "vendor/bin/phplint src --cache=build/phplint.cache",
"rector": "vendor/bin/rector process --ansi",
"test": [
"@phplint",
"@phpunit",
"@phpstan",
"@phpcs"
],
"codefix": [
"@rector",
"@phpcsfix",
"@test"
]
},
"config": {
"bin-dir": "bin"
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading
Loading