jeroen/file-fetcher-stopwatch

Provides a Symfony Stopwatch decorator for file fetchers

Maintainers

👁 Jeroen De Dauw

Package info

github.com/JeroenDeDauw/file-fetcher-stopwatch

pkg:composer/jeroen/file-fetcher-stopwatch

Fund package maintenance!

JeroenDeDauw

Statistics

Installs: 501

Dependents: 0

Suggesters: 2

Stars: 1

Open Issues: 0

1.0.3 2023-04-18 20:56 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

GPL-2.0-or-later 10337bea6655bcb3d661531216c8cae727f2e0cf

symfonyprofilingprofilefile fetcherstopwatchfile_get_contentsfilefetcher

This package is auto-updated.

Last update: 2026-05-19 04:18:26 UTC


README

👁 Build Status
👁 Code Coverage
👁 Scrutinizer Code Quality
👁 Latest Stable Version
👁 Download count

Provides a FileFetcher decorator that profiles file fetching using Symfony Stopwatch.

Usage

The FileFetcher decorators is constructed via FileFetcher\Stopwatch\Factory.

$fileFetcher = (new Factory())->newStopwatchFetcher($innerFetcher, $stopwatch);

Once you constructed a FileFetcher, fetching a file is easy:

$fileContent = $fileFetcher->fetchFile($fileLocation);

To test your code you can use all the test doubles provided by FileFetcher itself.

Installation

To use the FileFetcher Stopwatch library in your project, simply add a dependency on jeroen/file-fetcher-stopwatch to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on FileFetcher Stopwatch 1.x:

{
 "require": {
 "jeroen/file-fetcher-stopwatch": "~1.0"
 }
}

Development

Start by installing the project dependencies by executing

composer update

You can run the tests by executing

make test

You can run the style checks by executing

make cs

To run all CI checks, execute

make ci

You can also invoke PHPUnit directly to pass it arguments, as follows

vendor/bin/phpunit --filter SomeClassNameOrFilter

Release notes

1.0.3 (2023-04-18)

  • Installation together with Symfony Stopwatch 6.x is now allowed
  • Updated minimum PHP version to 8.1

1.0.2 (2019-12-23)

  • Installation together with Symfony Stopwatch 5.x is now allowed

1.0.1 (2019-01-17)

  • Fixed compatibility issue with FileFetcher 6.x

1.0.0 (2019-01-17)

  • Initial release with Factory->newStopwatchFetcher()