@@ 74-93 (lines=20) @@ | ||
71 | * @param string $plugin_file |
|
72 | * @throws InvalidArgumentException |
|
73 | */ |
|
74 | private function setPluginFile($plugin_file) |
|
75 | { |
|
76 | if(empty($plugin_file) || ! is_string($plugin_file)){ |
|
77 | throw new InvalidArgumentException( |
|
78 | esc_html__( |
|
79 | 'You need to supply a path to the addon plugin file in order to generate a Domain class', |
|
80 | 'event_espresso' |
|
81 | ) |
|
82 | ); |
|
83 | } |
|
84 | if(! is_readable($plugin_file)){ |
|
85 | throw new InvalidArgumentException( |
|
86 | esc_html__( |
|
87 | 'You need to supply a valid path to the addon plugin file in order to generate a Domain class', |
|
88 | 'event_espresso' |
|
89 | ) |
|
90 | ); |
|
91 | } |
|
92 | $this->plugin_file = $plugin_file; |
|
93 | } |
|
94 | ||
95 | ||
96 | /** |
|
@@ 100-119 (lines=20) @@ | ||
97 | * @param string $version |
|
98 | * @throws InvalidArgumentException |
|
99 | */ |
|
100 | private function setVersion($version) |
|
101 | { |
|
102 | if (empty($version) || ! is_string($version)) { |
|
103 | throw new InvalidArgumentException( |
|
104 | esc_html__( |
|
105 | 'You need to supply a version string in order to generate a Domain class', |
|
106 | 'event_espresso' |
|
107 | ) |
|
108 | ); |
|
109 | } |
|
110 | if (strpos($version, '.') === false) { |
|
111 | throw new InvalidArgumentException( |
|
112 | esc_html__( |
|
113 | 'You need to supply a valid version string in order to generate a Domain class', |
|
114 | 'event_espresso' |
|
115 | ) |
|
116 | ); |
|
117 | } |
|
118 | $this->version = $version; |
|
119 | } |
|
120 | ||
121 | ||
122 | /** |