Passed
Push — master ( 4595aa...20e07b )
by Romain
06:34
created

eventHookInterfaceNotFound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 2
dl 0
loc 8
rs 9.4285
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\Exception;
18
19
use CuyZ\Notiz\Core\Definition\Tree\EventGroup\Event\Connection\Hook;
20
21
class ClassNotFoundException extends NotizException
22
{
23
    const DEFINITION_SOURCE_CLASS_NOT_FOUND = 'The definition source class `%s` was not found.';
24
25
    const DEFINITION_PROCESSOR_CLASS_NOT_FOUND = 'The definition processor class `%s` was not found.';
26
27
    const EVENT_CLASS_NOT_FOUND = 'The event class `%s` was not found.';
28
29
    const TAG_SERVICE_PROPERTY_CLASS_NOT_FOUND = 'Trying to set an identifier (value: `%s`) for a property whose class was not found: `%s`.';
30
31
    const NOTIFICATION_CLASS_NOT_FOUND = 'The notification class `%s` was not found.';
32
33
    const NOTIFICATION_PROCESSOR_CLASS_NOT_FOUND = 'The processor class `%s` for the notification `%s` was not found.';
34
35
    const NOTIFICATION_SETTINGS_CLASS_NOT_FOUND = 'The notification settings class `%s` was not found.';
36
37
    const EVENT_HOOK_INTERFACE_NOT_FOUND = 'The interface `%s` was not found (used in the hook connection at the path `%s`).';
38
39
    const EVENT_CONFIGURATION_FLEX_FORM_PROVIDER_CLASS_NOT_FOUND = 'The FlexForm provider class name `%s` was not found.';
40
41
    const CHANNEL_SETTINGS_CLASS_NOT_FOUND = 'The channel settings class `%s` was not found.';
42
43
    /**
44
     * @param string $className
45
     * @return static
46
     */
47
    public static function definitionSourceClassNotFound($className)
48
    {
49
        return self::makeNewInstance(
50
            self::DEFINITION_SOURCE_CLASS_NOT_FOUND,
51
            1503849399,
52
            [$className]
53
        );
54
    }
55
56
    /**
57
     * @param string $className
58
     * @return static
59
     */
60
    public static function definitionProcessorClassNotFound($className)
61
    {
62
        return self::makeNewInstance(
63
            self::DEFINITION_PROCESSOR_CLASS_NOT_FOUND,
64
            1503849990,
65
            [$className]
66
        );
67
    }
68
69
    /**
70
     * @param string $className
71
     * @return static
72
     */
73
    public static function eventClassNotFound($className)
74
    {
75
        return self::makeNewInstance(
76
            self::EVENT_CLASS_NOT_FOUND,
77
            1503873178,
78
            [$className]
79
        );
80
    }
81
82
    /**
83
     * @param string $propertyType
84
     * @param string $identifier
85
     * @return static
86
     */
87
    public static function tagServicePropertyClassNotFound($propertyType, $identifier)
88
    {
89
        return self::makeNewInstance(
90
            self::TAG_SERVICE_PROPERTY_CLASS_NOT_FOUND,
91
            1504167128,
92
            [$identifier, $propertyType]
93
        );
94
    }
95
96
    /**
97
     * @param string $className
98
     * @return static
99
     */
100
    public static function notificationClassNotFound($className)
101
    {
102
        return self::makeNewInstance(
103
            self::NOTIFICATION_CLASS_NOT_FOUND,
104
            1505821147,
105
            [$className]
106
        );
107
    }
108
109
    /**
110
     * @param string $notificationClassName
111
     * @param string $processorClassName
112
     * @return static
113
     */
114
    public static function notificationProcessorClassNotFound($notificationClassName, $processorClassName)
115
    {
116
        return self::makeNewInstance(
117
            self::NOTIFICATION_PROCESSOR_CLASS_NOT_FOUND,
118
            1505829871,
119
            [$processorClassName, $notificationClassName]
120
        );
121
    }
122
123
    /**
124
     * @param string $className
125
     * @return static
126
     */
127
    public static function notificationSettingsClassNotFound($className)
128
    {
129
        return self::makeNewInstance(
130
            self::NOTIFICATION_SETTINGS_CLASS_NOT_FOUND,
131
            1506245086,
132
            [$className]
133
        );
134
    }
135
136
    /**
137
     * @param string $interface
138
     * @param Hook $hook
139
     * @return static
140
     */
141
    public static function eventHookInterfaceNotFound($interface, Hook $hook)
142
    {
143
        return self::makeNewInstance(
144
            self::EVENT_HOOK_INTERFACE_NOT_FOUND,
145
            1506800274,
146
            [
147
                $interface,
148
                $hook->getPath()
149
            ]
150
        );
151
    }
152
153
    /**
154
     * @param string $className
155
     * @return static
156
     */
157
    public static function eventConfigurationFlexFormProviderClassNotFound($className)
158
    {
159
        return self::makeNewInstance(
160
            self::EVENT_CONFIGURATION_FLEX_FORM_PROVIDER_CLASS_NOT_FOUND,
161
            1506952128,
162
            [$className]
163
        );
164
    }
165
166
    /**
167
     * @param string $className
168
     * @return static
169
     */
170
    public static function channelSettingsClassNotFound($className)
171
    {
172
        return self::makeNewInstance(
173
            self::CHANNEL_SETTINGS_CLASS_NOT_FOUND,
174
            1507409137,
175
            [$className]
176
        );
177
    }
178
}
179