Skip to content

Commit

Permalink
Merge tag '1.3.3'
Browse files Browse the repository at this point in the history
Bugfix release

Enhancements:
Reworked the builds to phpcq 2 and switched to github
actions.

Fixed:
- #3: UrlBuilder creates errorneous URLs when there is no
      path but query parameter.
  • Loading branch information
discordier committed Feb 7, 2022
2 parents 2d73064 + 753ac00 commit fe0ac04
Show file tree
Hide file tree
Showing 18 changed files with 384 additions and 148 deletions.
18 changes: 18 additions & 0 deletions .composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"symbol-whitelist" : [
"null", "true", "false",
"static", "self", "parent",
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object",
"REQUEST_TOKEN",
"Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface"
],
"php-core-extensions" : [
"Core",
"date",
"pcre",
"Reflection",
"SPL",
"standard"
],
"scan-files" : []
}
75 changes: 75 additions & 0 deletions .github/workflows/diagnostics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: contao-community-alliance/url-builder

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: 7.4
output: '-o github-action -o default'
phpcq_install: 'install'
- php: 8.0
output: '-o default'
phpcq_install: 'update'

steps:
- name: PHP ${{ matrix.php }} Pull source
uses: actions/checkout@v2
with:
fetch-depth: 0

# see https://github.com/shivammathur/setup-php
- name: PHP ${{ matrix.php }} Setup PHP.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: PHP ${{ matrix.php }} Cache composer cache directory
uses: actions/cache@v1
env:
cache-name: composer-cache-dir
with:
path: ~/.cache/composer
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}

- name: PHP ${{ matrix.php }} Cache vendor directory
uses: actions/cache@v1
env:
cache-name: composer-vendor
with:
path: vendor
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-
- name: PHP ${{ matrix.php }} Cache phpcq directory
uses: actions/cache@v1
env:
cache-name: phpcq
with:
path: .phpcq
key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-
- name: PHP ${{ matrix.php }} Install composer dependencies
run: composer install --prefer-dist --no-interaction --no-suggest

- name: PHP ${{ matrix.php }} Install phpcq toolchain
run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v

- name: PHP ${{ matrix.php }} Run tests
run: ./vendor/bin/phpcq run -v ${{ matrix.output }}

- name: PHP ${{ matrix.php }} Upload build directory to artifact
uses: actions/upload-artifact@v2
if: ${{ success() }} || ${{ failure() }}
with:
name: phpcq-builds-php-${{ matrix.php }}
path: .phpcq/build/
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ vendor/
composer.lock

# build
build/
build.properties
.phpcq/*
.phpunit.result.cache
1 change: 1 addition & 0 deletions .phpcq.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"plugins":{"phpunit":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpunit-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0"},"tool":{"phpunit":"^6.0 || ^7.0 || ^8.0 || ^9.0"}},"checksum":{"type":"sha-512","value":"c73f15658e3ba62665f09492ec91c3a6a715760bfaa88473a987538439fff442540148e086e46a6aa18ce55a3ea2fbf76caaa581384cb84a38859fcc609ae7e4"},"tools":{"phpunit":{"version":"9.5.13","url":"https://phar.phpunit.de/phpunit-9.5.13.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-xml":"*","ext-xmlwriter":"*"}},"checksum":{"type":"sha-256","value":"16742686383afac8a7a1e3f905862d77169746b0342f66ab80b0148582e5472a"},"signature":"https://phar.phpunit.de/phpunit-9.5.13.phar.asc"}}},"psalm":{"api-version":"1.0.0","version":"1.0.1.0","type":"php-file","url":"https://phpcq.github.io/repository/psalm-1.0.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"psalm":"^3.0 || ^4.0"}},"checksum":{"type":"sha-512","value":"fb591fbea784d65ea1b63ba597616c2dd6346958a61a9129aacf612e0deaa14c0de33d9a37cf81b5ed717f09cc3f1280149a0d46576fc838241070176710675f"},"tools":{"psalm":{"version":"4.20.0","url":"https://github.com/vimeo/psalm/releases/download/4.20.0/psalm.phar","requirements":{"php":{"php":"^7.1|^8","ext-SimpleXML":"*","ext-ctype":"*","ext-dom":"*","ext-json":"*","ext-libxml":"*","ext-mbstring":"*","ext-tokenizer":"*"}},"checksum":null,"signature":"https://github.com/vimeo/psalm/releases/download/4.20.0/psalm.phar.asc"}}},"composer-require-checker":{"api-version":"1.0.0","version":"1.0.1.0","type":"php-file","url":"https://phpcq.github.io/repository/composer-require-checker-1.0.1.0.php","signature":null,"requirements":{"php":{"php":"^7.4 || ^8.0"},"tool":{"composer-require-checker":"^3.8"}},"checksum":{"type":"sha-512","value":"5b0fd8cd5e0f5761c53b9d5375b6f6ba50f148468896248f823cc2a48361adfd872556066764b1b544ff51ffd5de60d6f9a75050db00b257d807976ac761bc3a"},"tools":{"composer-require-checker":{"version":"3.8.0","url":"https://github.com/maglnet/ComposerRequireChecker/releases/download/3.8.0/composer-require-checker.phar","requirements":{"php":{"php":"^7.4 || ^8.0","ext-json":"*","ext-phar":"*"}},"checksum":null,"signature":"https://github.com/maglnet/ComposerRequireChecker/releases/download/3.8.0/composer-require-checker.phar.asc"}}},"phpmd":{"api-version":"1.0.0","version":"1.0.1.0","type":"php-file","url":"https://phpcq.github.io/repository/phpmd-1.0.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpmd":"^2.6.1"}},"checksum":{"type":"sha-512","value":"88e267b9c36b2edc85e924717606b626e005ac8d97b1f65f5331e2a3b3894dec2cf124f6187541bf759d026477b6d94daacc5d5c81bb09714a68ffabe5698dc5"},"tools":{"phpmd":{"version":"2.11.1","url":"https://github.com/phpmd/phpmd/releases/download/2.11.1/phpmd.phar","requirements":{"php":{"php":">=5.3.9","ext-xml":"*"}},"checksum":null,"signature":null}}},"phpcpd":{"api-version":"1.0.0","version":"1.1.1.0","type":"php-file","url":"https://phpcq.github.io/repository/phpcpd-1.1.1.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcpd":"^6.0"}},"checksum":{"type":"sha-512","value":"1189ce0bf3fade4cb4241f1d96f915ef8fc7651f4450dc79fdf464ee3d6be3009316f0d423ce2d4af9d76ad50807b7fdf4d77bfa6d9ee2c91d6eda32ea214433"},"tools":{"phpcpd":{"version":"6.0.3","url":"https://phar.phpunit.de/phpcpd-6.0.3.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*"}},"checksum":{"type":"sha-256","value":"2cbaea7cfda1bb4299d863eb075e977c3f49055dd16d88529fae5150d48a84cb"},"signature":"https://phar.phpunit.de/phpcpd-6.0.3.phar.asc"}}},"phploc":{"api-version":"1.0.0","version":"1.0.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phploc-1.0.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*","ext-json":"*"},"tool":{"phploc":"^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0"}},"checksum":{"type":"sha-512","value":"f67b02d494796adf553cb3dd13ec06c1cb8e53c799954061749424251379541637538199afb3afa3c7a01cabd1cb6f1c53eb621f015dff9644c6c7cbf10c56d1"},"tools":{"phploc":{"version":"7.0.2","url":"https://phar.phpunit.de/phploc-7.0.2.phar","requirements":{"php":{"php":">=7.3","ext-dom":"*","ext-json":"*"}},"checksum":{"type":"sha-256","value":"3d59778ec86faf25fd00e3a329b2f9ad4a3c751ca91601ea7dab70f887b0bf46"},"signature":"https://phar.phpunit.de/phploc-7.0.2.phar.asc"}}},"phpcs":{"api-version":"1.0.0","version":"1.1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/phpcs-1.1.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-dom":"*"},"tool":{"phpcs":"^3.0 || ^2.0","phpcbf":"^3.0 || ^2.0"}},"checksum":{"type":"sha-512","value":"2737022369da1318cc4e0ea194e8a81019f7b079080d869aab878b7486052fdbe68fee3f28131f35573226def1aabd4bd005e038ee7b767c137b1107c1492a83"},"tools":{"phpcs":{"version":"3.6.2","url":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcs.phar","requirements":{"php":{"php":">=5.4.0","ext-tokenizer":"*","ext-xmlwriter":"*","ext-simplexml":"*"}},"checksum":null,"signature":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcs.phar.asc"},"phpcbf":{"version":"3.6.2","url":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcbf.phar","requirements":{"php":{"php":">=5.4.0","ext-tokenizer":"*","ext-xmlwriter":"*","ext-simplexml":"*"}},"checksum":null,"signature":"https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.6.2/phpcbf.phar.asc"}}},"composer-normalize":{"api-version":"1.0.0","version":"1.1.0.0","type":"php-file","url":"https://phpcq.github.io/repository/composer-normalize-1.1.0.0.php","signature":null,"requirements":{"php":{"php":"^7.3 || ^8.0","ext-json":"*"},"tool":{"composer-normalize":"^2.1"}},"checksum":{"type":"sha-512","value":"d59d3557cb20630734878a9115df5dd32d5aff815e5b15be36f6fb5d6e9d83dd36efd84215ab6529edcc924f600946f739a0d9e67723deff95c88346ab502498"},"tools":{"composer-normalize":{"version":"2.23.1","url":"https://github.com/ergebnis/composer-normalize/releases/download/2.23.1/composer-normalize.phar","requirements":{"php":{"php":"^7.4 || ^8.0"}},"checksum":null,"signature":"https://github.com/ergebnis/composer-normalize/releases/download/2.23.1/composer-normalize.phar.asc"}}}},"tools":[]}
117 changes: 117 additions & 0 deletions .phpcq.yaml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
phpcq:
repositories:
- https://phpcq.github.io/repository/repository.json
directories:
- src
- tests
artifact: .phpcq/build

plugins:
phpunit:
version: ^1.0
signed: false
psalm:
version: ^1.0.1
signed: false
composer-require-checker:
version: ^1.0.1
signed: false
phpmd:
version: ^1.0.1
signed: false
requirements:
phpmd:
signed: false
phpcpd:
version: ^1.1.1
signed: false
requirements:
phpcpd:
version: ^6.0
phploc:
version: ^1.0
signed: false
phpcs:
version: ^1.1
signed: false
composer-normalize:
version: ^1.0
signed: false
trusted-keys:
# sb@sebastian-bergmann.de
- 4AA394086372C20A
# psalm
- 12CE0F1D262429A5
# magl@magll.net
- D2CCAC42F6295E7D
# PHP_CodeSniffer
- 31C7E470E2138192
# Composer normalize
- C00543248C87FB13
# Composer require checker
- 033E5F8D801A2F8D
# phpmd
- 0F9684B8B16B7AB0

tasks:
fix:
- composer-normalize-fix
- phpcbf

verify:
- composer-require-checker
- composer-normalize

analyze:
- phploc
- phpcpd
- phpmd
- phpcs
- psalm
- phpunit

default:
- verify
- analyze

phpcpd:
plugin: phpcpd
config:
exclude:
- 'src/ApiClient/Shopware/Generated'

phpmd:
plugin: phpmd
config:
ruleset:
- codesize
- controversial
- naming
- unusedcode
excluded:
- 'src/ApiClient/Shopware/Generated'

composer-normalize-fix:
plugin: composer-normalize
config:
dry_run: false

composer-require-checker:
plugin: composer-require-checker
config:
config_file: '.composer-require-checker.json'

phpcs:
plugin: phpcs
config: &phpcs-config
standard: PSR12
excluded:
- 'src/ApiClient/Shopware/Generated'
custom_flags:
- '--extensions=php'

phpcbf:
plugin: phpcs
config:
<<: *phpcs-config
fix: true
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Url Builder
===========
[![Version](http://img.shields.io/packagist/v/contao-community-alliance/url-builder.svg?style=flat-square)](https://packagist.org/packages/contao-community-alliance/url-builder)
[![Stable Build Status](http://img.shields.io/travis/contao-community-alliance/url-builder/master.svg?style=flat-square&label=stable%20build)](https://travis-ci.org/contao-community-alliance/url-builder)
[![Develop Build Status](http://img.shields.io/travis/contao-community-alliance/url-builder/develop.svg?style=flat-square&label=dev%20build)](https://travis-ci.org/contao-community-alliance/url-builder)
[![License](http://img.shields.io/packagist/l/contao-community-alliance/url-builder.svg?style=flat-square)](https://github.com/contao-community-alliance/url-builder/blob/master/LICENSE)
[![Downloads](http://img.shields.io/packagist/dt/contao-community-alliance/url-builder.svg?style=flat-square)](https://packagist.org/packages/contao-community-alliance/url-builder)
[![Version](https://img.shields.io/packagist/v/contao-community-alliance/url-builder.svg?style=flat-square)](https://packagist.org/packages/contao-community-alliance/url-builder)
[![Code Quality Diagnostics](https://github.com/contao-community-alliance/url-builder/actions/workflows/diagnostics.yml/badge.svg)](https://github.com/contao-community-alliance/url-builder/actions/workflows/diagnostics.yml)
[![License](https://img.shields.io/packagist/l/contao-community-alliance/url-builder.svg?style=flat-square)](https://github.com/contao-community-alliance/url-builder/blob/master/LICENSE)
[![Downloads](https://img.shields.io/packagist/dt/contao-community-alliance/url-builder.svg?style=flat-square)](https://packagist.org/packages/contao-community-alliance/url-builder)

General purpose URL builder and manipulator.
9 changes: 0 additions & 9 deletions build.default.properties

This file was deleted.

11 changes: 0 additions & 11 deletions build.xml

This file was deleted.

99 changes: 55 additions & 44 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,59 @@
{
"name": "contao-community-alliance/url-builder",
"description": "General purpose URL builder and manipulator.",
"license": "LGPL-3.0-or-later",
"authors": [
{
"name": "Christian Schiffler",
"email": "c.schiffler@cyberspectrum.de",
"homepage": "http://www.cyberspectrum.de",
"role": "Developer"
},
{
"name": "Stefan Heimes",
"email": "stefan_heimes@hotmail.com",
"role": "Developer"
}
],
"support": {
"email": "info@contao-community-alliance.de",
"issues": "https://github.com/contao-community-alliance/url-builder/issues",
"irc": "irc://irc.freenode.org/contao.cca",
"source": "https://github.com/contao-community-alliance/url-builder"
"name": "contao-community-alliance/url-builder",
"description": "General purpose URL builder and manipulator.",
"license": "LGPL-3.0-or-later",
"authors": [
{
"name": "Christian Schiffler",
"email": "c.schiffler@cyberspectrum.de",
"homepage": "https://www.cyberspectrum.de",
"role": "Developer"
},
"require": {
"php": "^5.6 || ^7.0"
},
"require-dev": {
"phpcq/all-tasks": "^1.2",
"contao/core-bundle": "^4.4",
"php-http/guzzle6-adapter": "^1.1"
},
"autoload": {
"psr-4": {
"ContaoCommunityAlliance\\UrlBuilder\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"ContaoCommunityAlliance\\UrlBuilder\\Test\\": "tests/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev",
"dev-develop": "1.4.x-dev"
}
{
"name": "Stefan Heimes",
"email": "stefan_heimes@hotmail.com",
"role": "Developer"
}
],
"support": {
"email": "info@contao-community-alliance.de",
"issues": "https://github.com/contao-community-alliance/url-builder/issues",
"irc": "irc://irc.freenode.org/contao.cca",
"source": "https://github.com/contao-community-alliance/url-builder"
},
"require": {
"php": "^5.6 || ^7.0 || ^8.0"
},
"require-dev": {
"contao/core-bundle": "^4.4",
"php-http/guzzle6-adapter": "^1.1",
"phpcq/runner-bootstrap": "^1.0@dev",
"symfony/security-csrf": "^4.4 || ^5.2"
},
"conflict": {
"contao/core-bundle": "<4.4 || >=5.0",
"symfony/security-csrf": "<4.4 || >=6.0"
},
"autoload": {
"psr-4": {
"ContaoCommunityAlliance\\UrlBuilder\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"ContaoCommunityAlliance\\UrlBuilder\\Test\\": "tests/"
}
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"contao-components/installer": false
}
},
"extra": {
"branch-alias": {
"dev-develop": "1.4.x-dev",
"dev-master": "1.3.x-dev"
}
}
}
Loading

0 comments on commit fe0ac04

Please sign in to comment.