PHPackages                             ygto/job-collector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ygto/job-collector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ygto/job-collector
==================

job collector to write more clean code

v1.0.3(9y ago)45861[2 PRs](https://github.com/ygto/job-collector/pulls)PHP

Since Jan 7Pushed 4y ago2 watchersCompare

[ Source](https://github.com/ygto/job-collector)[ Packagist](https://packagist.org/packages/ygto/job-collector)[ RSS](/packages/ygto-job-collector/feed)WikiDiscussions master Synced today

READMEChangelog (4)DependenciesVersions (5)Used By (0)

**Job Collector**
=================

[](#job-collector)

```
don't mess around when handling too much process.

```

Installation
------------

[](#installation)

```
composer require ygto/job-collector

```

or

```
"require": {
    "ygto/job-collector": "^1.0"
}

```

JobCollector\\Job
-----------------

[](#jobcollectorjob)

**JobCollector\\Job** interface has 4 methods

- handle() first **handle** method run.
- rollback() if **handle** method ***throw exception*** then **rollback** method run.
- onSuccess() if **handle** method run successfully then **onSuccess** run and keep the method's return ;
- onError() if **handle** method ***throw exception*** then **onError** run and keep the method's return ;

JobCollector\\Collector
-----------------------

[](#jobcollectorcollector)

**JobCollector\\Collector** has 4 methods

- push(\\JobCollector\\Job $job) push job to collector
- handle() run pushed jobs if all jobs run successfully return ***true*** else return ***false***
- getSuccess() return ***onSuccess*** methods return
- getError() return ***onError*** methods return

Usage
-----

[](#usage)

//GetPayment.php

```
