Passed
Pull Request — master (#130)
by Nathan
03:00
created

Url::documentationCreateCustomEvent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * Copyright (C) 2018
5
 * Nathan Boiron <[email protected]>
6
 * Romain Canon <[email protected]>
7
 *
8
 * This file is part of the TYPO3 NotiZ project.
9
 * It is free software; you can redistribute it and/or modify it
10
 * under the terms of the GNU General Public License, either
11
 * version 3 of the License, or any later version.
12
 *
13
 * For the full copyright and license information, see:
14
 * http://www.gnu.org/licenses/gpl-3.0.html
15
 */
16
17
namespace CuyZ\Notiz\Core\Support;
18
19
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
20
21
class Url
22
{
23
    const DOCUMENTATION_ROOT = 'https://github.com/CuyZ/NotiZ/blob/%s/Documentation/Markdown/README.md#-notiz--documentation';
24
    const DOCUMENTATION_CREATE_CUSTOM_EVENT = 'https://github.com/CuyZ/NotiZ/blob/%s/Documentation/Markdown/Events/Create-a-custom-event.md#create-a-custom-event';
25
    const DOCUMENTATION_ADD_TYPOSCRIPT_DEFINITION = 'https://github.com/CuyZ/NotiZ/blob/%s/Documentation/Markdown/Developers/Add-TypoScript-definition.md#add-typoscript-definition';
26
27
    const REPOSITORY = 'https://github.com/CuyZ/NotiZ';
28
    const NEW_ISSUE = 'https://github.com/CuyZ/NotiZ/issues/new';
29
30
    const SLACK_CHANNEL = 'https://typo3.slack.com/messages/ext-notiz';
31
32
    /**
33
     * @return string
34
     */
35
    public static function documentation()
36
    {
37
        return self::build(self::DOCUMENTATION_ROOT);
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public static function documentationCreateCustomEvent()
44
    {
45
        return self::build(self::DOCUMENTATION_CREATE_CUSTOM_EVENT);
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public static function documentationTypoScriptDefinition()
52
    {
53
        return self::build(self::DOCUMENTATION_ADD_TYPOSCRIPT_DEFINITION);
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public static function repository()
60
    {
61
        return self::REPOSITORY;
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public static function newIssue()
68
    {
69
        return self::NEW_ISSUE;
70
    }
71
72
    /**
73
     * @return string
74
     */
75
    public static function slackChannel()
76
    {
77
        return self::SLACK_CHANNEL;
78
    }
79
80
    /**
81
     * @param string $url
82
     * @return string
83
     */
84
    private static function build($url)
85
    {
86
        return vsprintf(
87
            $url,
88
            [ExtensionManagementUtility::getExtensionVersion(NotizConstants::EXTENSION_KEY)]
89
        );
90
    }
91
}
92