| 
									
										
										
										
											2016-01-13 07:16:29 +01:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2016-02-05 12:08:25 +01:00
										 |  |  | declare(strict_types = 1); | 
					
						
							| 
									
										
										
										
											2016-01-13 07:16:29 +01:00
										 |  |  | /** | 
					
						
							|  |  |  |  * RescanJournalAfterStore.php | 
					
						
							|  |  |  |  * Copyright (C) 2016 Sander Dorigo | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This software may be modified and distributed under the terms | 
					
						
							|  |  |  |  * of the MIT license.  See the LICENSE file for details. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace FireflyIII\Handlers\Events; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use FireflyIII\Events\TransactionJournalStored; | 
					
						
							| 
									
										
										
										
											2016-01-29 07:29:21 +01:00
										 |  |  | use FireflyIII\Support\Events\BillScanner; | 
					
						
							| 
									
										
										
										
											2016-01-13 07:16:29 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Class RescanJournal | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @codeCoverageIgnore | 
					
						
							|  |  |  |  * @package FireflyIII\Handlers\Events | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | class ScanForBillsAfterStore | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Scan a transaction journal for possible links to bills, right after storing. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param  TransactionJournalStored $event | 
					
						
							|  |  |  |      * | 
					
						
							| 
									
										
										
										
											2016-02-18 07:21:48 +01:00
										 |  |  |      * @return bool | 
					
						
							| 
									
										
										
										
											2016-01-13 07:16:29 +01:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-02-18 07:21:48 +01:00
										 |  |  |     public function handle(TransactionJournalStored $event): bool | 
					
						
							| 
									
										
										
										
											2016-01-13 07:16:29 +01:00
										 |  |  |     { | 
					
						
							|  |  |  |         $journal = $event->journal; | 
					
						
							| 
									
										
										
										
											2016-01-29 07:29:21 +01:00
										 |  |  |         BillScanner::scan($journal); | 
					
						
							| 
									
										
										
										
											2016-02-18 07:21:48 +01:00
										 |  |  |         return true; | 
					
						
							| 
									
										
										
										
											2016-01-13 07:16:29 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |