Skip to content

Commit

Permalink
Remove unused code + Improve GitHub actions (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Dec 24, 2023
1 parent 7839246 commit bc3eb5e
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 23 deletions.
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -3,4 +3,3 @@
| Is bugfix? | ✔️/❌
| New feature? | ✔️/❌
| Breaks BC? | ✔️/❌
| Fixed issues | comma-separated list of tickets # fixed by the PR, if any
26 changes: 13 additions & 13 deletions .github/dependabot.yml
@@ -1,16 +1,16 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions.
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
# Too noisy. See https://github.community/t/increase-if-necessary-for-github-actions-in-dependabot/179581
open-pull-requests-limit: 0
# Maintain dependencies for GitHub Actions.
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
# Too noisy. See https://github.community/t/increase-if-necessary-for-github-actions-in-dependabot/179581
open-pull-requests-limit: 0

# Maintain dependencies for Composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
versioning-strategy: increase-if-necessary
# Maintain dependencies for Composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
versioning-strategy: increase-if-necessary
24 changes: 22 additions & 2 deletions .github/workflows/bc.yml
@@ -1,8 +1,28 @@
on:
- pull_request
- push
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'
push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
- 'psalm.xml'

name: backwards compatibility

jobs:
roave_bc_check:
uses: yiisoft/actions/.github/workflows/bc.yml@master
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Expand Up @@ -10,6 +10,7 @@ on:
- 'psalm.xml'

push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
Expand All @@ -28,4 +29,4 @@ jobs:
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
['8.0', '8.1']
['8.0', '8.1', '8.2', '8.3']
3 changes: 2 additions & 1 deletion .github/workflows/composer-require-checker.yml
Expand Up @@ -11,6 +11,7 @@ on:
- 'psalm.xml'

push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
Expand All @@ -30,4 +31,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.0', '8.1']
['8.0', '8.1', '8.2', '8.3']
1 change: 1 addition & 0 deletions .github/workflows/mutation.yml
Expand Up @@ -9,6 +9,7 @@ on:
- 'psalm.xml'

push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rector.yml
Expand Up @@ -20,4 +20,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.0']
['8.3']
3 changes: 2 additions & 1 deletion .github/workflows/static.yml
Expand Up @@ -10,6 +10,7 @@ on:
- 'phpunit.xml.dist'

push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
Expand All @@ -28,4 +29,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.0', '8.1']
['8.0', '8.1', '8.2', '8.3']
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -2,7 +2,7 @@

## 3.0.1 under development

- Bug #133: Don't add not substituted arguments to a query string (@rustamwin)
- Bug #133, #136: Don't add not substituted arguments to a query string (@rustamwin, @vjik)
- Bug #134: Don't add query string if it's empty (@rustamwin)

## 3.0.0 February 17, 2023
Expand Down
2 changes: 0 additions & 2 deletions src/UrlGenerator.php
Expand Up @@ -264,7 +264,6 @@ private function missingArguments(array $parts, array $substitutions): array
*/
private function generatePath(array $arguments, array $queryParameters, array $parts): string
{
$notSubstitutedArguments = $arguments;
$path = $this->getUriPrefix();

foreach ($parts as $part) {
Expand Down Expand Up @@ -292,7 +291,6 @@ private function generatePath(array $arguments, array $queryParameters, array $p
? rawurlencode($arguments[$part[0]])
: urlencode($arguments[$part[0]]);
}
unset($notSubstitutedArguments[$part[0]]);
}

$path = str_replace('//', '/', $path);

Check warning on line 296 in src/UrlGenerator.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "UnwrapStrReplace": --- Original +++ New @@ @@ $path .= $this->encodeRaw ? rawurlencode($arguments[$part[0]]) : urlencode($arguments[$part[0]]); } } - $path = str_replace('//', '/', $path); + $path = $path; $queryString = ''; if (!empty($queryParameters)) { $queryString = http_build_query($queryParameters);
Expand Down

0 comments on commit bc3eb5e

Please sign in to comment.