Skip to content

Commit a6b73e1

Browse files
authored
Merge pull request #19 from PolishSymfonyCommunity/setup-github-actions
Setup Github Actions
2 parents 2eeb920 + 4f13e03 commit a6b73e1

File tree

3 files changed

+58
-26
lines changed

3 files changed

+58
-26
lines changed

.github/workflows/build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build
2+
3+
on:
4+
push: ~
5+
pull_request: ~
6+
workflow_dispatch: ~
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
php: ["8.0", "8.1"]
15+
symfony: ["^5.4", "^6.0"]
16+
17+
steps:
18+
19+
-
20+
uses: actions/checkout@v3
21+
22+
-
23+
name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: "${{ matrix.php }}"
27+
28+
-
29+
name: Restrict Symfony version
30+
if: matrix.symfony != ''
31+
run: |
32+
composer global config --no-plugins allow-plugins.symfony/flex true
33+
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
34+
composer config extra.symfony.require "${{ matrix.symfony }}"
35+
36+
-
37+
name: Validate composer.json and composer.lock
38+
run: composer validate --strict
39+
40+
-
41+
name: Cache Composer packages
42+
id: composer-cache
43+
uses: actions/cache@v3
44+
with:
45+
path: vendor
46+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
47+
restore-keys: |
48+
${{ runner.os }}-php-
49+
50+
-
51+
name: Install dependencies
52+
run: composer update --prefer-dist --no-progress
53+
54+
-
55+
name: Run PHPUnit
56+
run: vendor/bin/phpunit --colors=always

.travis.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/DependencyInjection/MockerContainer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function unmock($id)
4747
*
4848
* @return object
4949
*/
50-
public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
50+
public function get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE): ?object
5151
{
5252
if (array_key_exists($id, self::$mockedServices)) {
5353
return self::$mockedServices[$id];
@@ -61,7 +61,7 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
6161
*
6262
* @return boolean
6363
*/
64-
public function has($id)
64+
public function has(string $id): bool
6565
{
6666
if (array_key_exists($id, self::$mockedServices)) {
6767
return true;

0 commit comments

Comments
 (0)