Skip to content

Commit

Permalink
Merge pull request #19 from PolishSymfonyCommunity/setup-github-actions
Browse files Browse the repository at this point in the history
Setup Github Actions
  • Loading branch information
jakzal committed Oct 14, 2022
2 parents 2eeb920 + 4f13e03 commit a6b73e1
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 26 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build

on:
push: ~
pull_request: ~
workflow_dispatch: ~

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
php: ["8.0", "8.1"]
symfony: ["^5.4", "^6.0"]

steps:

-
uses: actions/checkout@v3

-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"

-
name: Restrict Symfony version
if: matrix.symfony != ''
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
composer config extra.symfony.require "${{ matrix.symfony }}"
-
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 update --prefer-dist --no-progress

-
name: Run PHPUnit
run: vendor/bin/phpunit --colors=always
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions src/DependencyInjection/MockerContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function unmock($id)
*
* @return object
*/
public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
public function get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE): ?object
{
if (array_key_exists($id, self::$mockedServices)) {
return self::$mockedServices[$id];
Expand All @@ -61,7 +61,7 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
*
* @return boolean
*/
public function has($id)
public function has(string $id): bool
{
if (array_key_exists($id, self::$mockedServices)) {
return true;
Expand Down

0 comments on commit a6b73e1

Please sign in to comment.