Skip to content

Commit

Permalink
Merge: Make CI job work again. Fix minor PHPStan Level 2 Finding
Browse files Browse the repository at this point in the history
  • Loading branch information
ralflang authored Oct 27, 2023
2 parents 83d1080 + 0aa249d commit badc5b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- master
- main
- FRAMEWORK_6_0
pull_request:
branches:
- master
- main
- FRAMEWORK_6_0


Expand All @@ -25,10 +21,10 @@ jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: ['ubuntu-20.04']
php-versions: ['7.4', '8.0', 'latest']
phpunit-versions: ['latest', '9.5']
operating-system: ['ubuntu-22.04']
php-versions: ['7.4', '8.0', '8.1', '8.2', 'latest']
steps:
- name: Setup github ssh key
run: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa github.com > ~/.ssh/known_hosts
Expand All @@ -41,7 +37,7 @@ jobs:
extensions: bcmath, ctype, curl, dom, gd, gettext, iconv, imagick, json, ldap, mbstring, mysql, opcache, openssl, pcntl, pdo, posix, redis, soap, sockets, sqlite, tokenizer, xmlwriter
ini-values: post_max_size=512M, max_execution_time=360
coverage: xdebug
tools: php-cs-fixer, phpunit:${{ matrix.phpunit-versions }}, composer:v2, phpstan
tools: php-cs-fixer, phpunit, composer:v2, phpstan
- name: Setup Github Token as composer credential
run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
- name: Install horde/test dependency and other dependencies
Expand Down
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
}
],
"time": "2021-11-03",
"repositories": [
{
"type": "composer",
"url": "https://horde-satis.maintaina.com/"
}
],
"require": {
"php": "^7.4 || ^8",
"horde/support": "^3 || dev-FRAMEWORK_6_0",
Expand Down Expand Up @@ -58,5 +52,10 @@
"psr-4": {
"Horde\\Test\\Test\\": "test/"
}
},
"config": {
"allow-plugins": {
"horde/horde-installer-plugin": true
}
}
}
}
4 changes: 4 additions & 0 deletions src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

use Horde_Support_Backtrace;
use ReflectionClass;
use ReflectionNamedType;

/**
* Basic Horde test case helper.
Expand Down Expand Up @@ -127,7 +128,10 @@ public function getMockDependencies(string $class, array $overrides = [])
} else {
if (is_null($type)) {
throw new Exception("dependency $name has no type defined and is not in overrides array");
} elseif (!($type instanceof ReflectionNamedType)) {
throw new Exception("dependency $name is a union or intersection type");
}
// TODO: How would we handle a union or intersection dependency?
$typeName = $type->getName();
switch ($typeName) {
case 'int':
Expand Down

0 comments on commit badc5b6

Please sign in to comment.