Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeroendedauw/file-fetcher-stopwatch
Provides a Symfony Stopwatch decorator for file fetchers
https://github.com/jeroendedauw/file-fetcher-stopwatch
Last synced: 8 days ago
JSON representation
Provides a Symfony Stopwatch decorator for file fetchers
- Host: GitHub
- URL: https://github.com/jeroendedauw/file-fetcher-stopwatch
- Owner: JeroenDeDauw
- License: bsd-3-clause
- Created: 2019-01-17T11:23:35.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-18T20:57:07.000Z (over 1 year ago)
- Last Synced: 2024-10-17T16:53:03.895Z (29 days ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# FileFetcher Stopwatch
[![Build Status](https://travis-ci.org/JeroenDeDauw/file-fetcher-stopwatch.svg?branch=master)](https://travis-ci.org/JeroenDeDauw/file-fetcher-stopwatch)
[![Code Coverage](https://scrutinizer-ci.com/g/JeroenDeDauw/file-fetcher-stopwatch/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/JeroenDeDauw/file-fetcher-stopwatch/?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/JeroenDeDauw/file-fetcher-stopwatch/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/JeroenDeDauw/file-fetcher-stopwatch/?branch=master)
[![Latest Stable Version](https://poser.pugx.org/jeroen/file-fetcher-stopwatch/version.png)](https://packagist.org/packages/jeroen/file-fetcher-stopwatch)
[![Download count](https://poser.pugx.org/jeroen/file-fetcher-stopwatch/d/total.png)](https://packagist.org/packages/jeroen/file-fetcher-stopwatch)Provides a [FileFetcher](https://github.com/JeroenDeDauw/FileFetcher) [decorator](https://en.wikipedia.org/wiki/Decorator_pattern)
that profiles file fetching using [Symfony Stopwatch](https://symfony.com/doc/current/components/stopwatch.html).## Usage
The FileFetcher decorators is constructed via [`FileFetcher\Stopwatch\Factory`](src/Factory.php).
```php
$fileFetcher = (new Factory())->newStopwatchFetcher($innerFetcher, $stopwatch);
```Once you constructed a FileFetcher, fetching a file is easy:
```php
$fileContent = $fileFetcher->fetchFile($fileLocation);
```To test your code you can use all the test doubles provided by [FileFetcher](https://github.com/JeroenDeDauw/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:```json
{
"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 executingmake cs
To run all CI checks, executemake ci
You can also invoke PHPUnit directly to pass it arguments, as followsvendor/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()`