1 | <?php |
||
13 | class CreatePasteService |
||
14 | { |
||
15 | /** |
||
16 | * @var PasteRepository |
||
17 | */ |
||
18 | private $pasteRepository; |
||
19 | |||
20 | /** |
||
21 | * @var PasteCrypter |
||
22 | */ |
||
23 | private $pasteCrypter; |
||
24 | |||
25 | /** |
||
26 | * CreatePasteService constructor. |
||
27 | * |
||
28 | * @param PasteRepository $pasteRepository |
||
29 | * @param PasteCrypter $pasteCrypter |
||
30 | */ |
||
31 | 4 | public function __construct(PasteRepository $pasteRepository, PasteCrypter $pasteCrypter) |
|
36 | |||
37 | /** |
||
38 | * Creates Paste and File entities populating it with unique id and then |
||
39 | * saves it to repository. |
||
40 | * |
||
41 | * @param array $data |
||
42 | * |
||
43 | * @return CreatePastePayload |
||
44 | */ |
||
45 | 4 | public function handle(array $data): CreatePastePayload |
|
75 | } |
||
76 |