Passed
Push — master ( 262b3f...86674d )
by Yannick
09:44
created

OnlyofficeAppRequests::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * (c) Copyright Ascensio System SIA 2025.
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
use Onlyoffice\DocsIntegrationSdk\Service\Request\RequestService;
18
19
class OnlyofficeAppRequests extends RequestService
20
{
21
    /**
22
     * File url to test convert service.
23
     *
24
     * @var string
25
     */
26
    private $convertFileUrl;
0 ignored issues
show
introduced by
The private property $convertFileUrl is not used, and could be removed.
Loading history...
27
    private $convertFilePath;
0 ignored issues
show
introduced by
The private property $convertFilePath is not used, and could be removed.
Loading history...
28
29
    public function __construct($settingsManager, $httpClient, $jwtManager)
30
    {
31
        parent::__construct($settingsManager, $httpClient, $jwtManager);
32
    }
33
34
    public function getFileUrlForConvert()
35
    {
36
        $data = [
37
            'type' => 'empty',
38
            'courseId' => api_get_course_int_id(),
39
            'userId' => api_get_user_id(),
40
            'sessionId' => api_get_session_id(),
41
        ];
42
        $hashUrl = $this->jwtManager->getHash($data);
43
44
        return api_get_path(WEB_PLUGIN_PATH).'onlyoffice/callback.php?hash='.$hashUrl;
45
    }
46
}
47