Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Apr 18, 2021
1 parent 4322d6d commit dc89d84
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 7 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/coveralls.yml
@@ -0,0 +1,49 @@
name: coveralls

on:
push:
pull_request:

jobs:
tests:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os:
- "ubuntu-latest"
php:
- "7.3"
dependencies:
- "locked"
experimental:
- false

name: PHP${{ matrix.php }} on ${{ matrix.os }} (${{ matrix.dependencies }})

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, sqlite3, pdo_sqlite, bcmath, fileinfo
coverage: xdebug

- name: Install dependencies
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist"

- name: Execute tests
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml

- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v
2 changes: 1 addition & 1 deletion CHANGELOG-6.x.md
Expand Up @@ -4,7 +4,7 @@ This changelog references the relevant changes (bug and security fixes) done to

## 6.0.0

Released: 2020-08-29
Released: 2021-04-18

### Added

Expand Down
21 changes: 15 additions & 6 deletions src/AvatarServiceProvider.php
Expand Up @@ -16,12 +16,7 @@ class AvatarServiceProvider extends ServiceProvider implements DeferrableProvide
public function register()
{
$this->app->singleton('orchestra.avatar', function (Container $app) {
$manager = new AvatarManager($app);
$namespace = $this->hasPackageRepository() ? 'orchestra/avatar::' : 'orchestra.avatar';

$manager->setConfiguration($app->make('config')->get($namespace));

return $manager;
return new AvatarManager($app);
});
}

Expand All @@ -39,6 +34,20 @@ public function boot()
if (! $this->hasPackageRepository()) {
$this->bootUsingLaravel($path);
}

$this->bootEvents();
}

/**
* Register memory events during booting.
*/
protected function bootEvents(): void
{
$this->callAfterResolving('orchestra.avatar', function ($manager, $app) {
$namespace = $this->hasPackageRepository() ? 'orchestra/avatar::' : 'orchestra.avatar';

$manager->setConfiguration($app->make('config')->get($namespace));
});
}

/**
Expand Down

0 comments on commit dc89d84

Please sign in to comment.