Skip to content

Composer: Migrate project to Composer and PSR-4 autoloader #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
20 changes: 20 additions & 0 deletions .github/workflows/dependency_review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v1
39 changes: 39 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PHP Composer

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

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

# - name: Run test suite
# run: composer run-script test
33 changes: 33 additions & 0 deletions .github/workflows/run-psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Psalm

on:
push:
paths:
- '**.php'
- 'psalm.xml'

jobs:
psalm:
name: psalm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: libxml, mbstring, zip, pdo, intl, iconv
coverage: none

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}

- name: Run composer install
run: composer install -n --prefer-dist

- name: Run psalm
run: ./vendor/bin/psalm --output-format=github
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/nbproject
/nbproject/private/
/view/analytics.html
/doc/
/doc/
/vendor/
/.idea/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM programistyk/php-runtimes:7.2-nginx
FROM programistyk/php-runtimes:7.4-nginx
ADD . /app
ADD config.nginx /etc/nginx/sites-enabled/default
ADD fuelio.ini /usr/local/etc/php/conf.d/fuelio.ini
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# FuelioImport
Data converter for importingo into great Fuelio app. Currently very limited (but working) GUI is available for PHP 5 built-int webserver.
Data converter for importingo into great Fuelio app. Currently very limited (but working) GUI is available for PHP built-int webserver.

FuelioImport is developed from the need to move personal fillups history from Motostat and aCar, but it is designed to offer ease of extension for new formats.

Expand Down Expand Up @@ -29,6 +29,6 @@ After importing into Fuelio, remember to verify or set your cars fuel type! Fuel
Drivvo backups are locale-dependant, so in order to support all of them, we need to be given more examples. Currently spanish, english and polish backups should be working fine. Others might missinterpret "refuelling to full" flag.

## Requirements
FuelioImport converter is built for current PHP version (PHP7), but any stable PHP version should do the job.
FuelioImport converter is built for PHP version 7.4.

* For aCar backup we need SimpleXMLElement and Zip support
2 changes: 1 addition & 1 deletion apigen.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source:
- lib
- src

destination: doc
templateTheme: bootstrap
46 changes: 46 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "programistyk/fuelio",
"description": "Fuelio Imports Converter",
"type": "project",
"homepage": "https://fuelio.programistyk.pl",
"require": {
"php": "^7.4",
"ext-zip": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-json": "*"
},
"require-dev": {
"vimeo/psalm": "^4.23",
"phpstan/phpstan": "^1.7"
},
"license": "MIT",
"autoload": {
"psr-4": {
"FuelioImporter\\": "src/"
}
},
"authors": [
{
"name": "Kamil Kamiński",
"email": "kamil@programistyk.pl",
"homepage": "https://programistyk.pl",
"role": "Developer"
},
{
"name": "Adrian Kajda",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/Programistyk/FuelioImport/issues",
"source": "https://github.com/Programistyk/FuelioImport"
},
"minimum-stability": "stable",
"config": {
"platform": {
"php": "7.4"
},
"sort-packages": true
}
}
Loading