File tree Expand file tree Collapse file tree 3 files changed +10
-21
lines changed
Expand file tree Collapse file tree 3 files changed +10
-21
lines changed Original file line number Diff line number Diff line change @@ -10,24 +10,13 @@ class Event
1010
1111 public string $ platform = EventConstant::DEFAULT_PLATFORM ;
1212
13- private string $ platformFile = '' ;
14-
15- /**
16- * @return string
17- */
18- public function getPlatformFile (): string
19- {
20- return $ this ->platformFile ;
21- }
22-
23- /**
24- * @param string $platformFile
25- *
26- * @return void
27- */
28- public function setPlatformFile (string $ platformFile ): void
29- {
30- $ this ->platformFile = $ platformFile ;
13+ public string $ platformFile = '' {
14+ get {
15+ return $ this ->platformFile ;
16+ }
17+ set {
18+ $ this ->platformFile = $ value ;
19+ }
3120 }
3221
3322 /**
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public function setPlatFormForEvent(?string $platform = EventConstant::DEFAULT_P
1414 {
1515 /** @var array $platformFileDefaults<platform, platformFile> */
1616 $ platformFileDefaults = config ('telegram-git-notifier.data_file.platform ' );
17- $ this ->event -> setPlatformFile ( $ platformFile ?? $ platformFileDefaults [$ platform ]) ;
17+ $ this ->event = $ platformFile ?? $ platformFileDefaults [$ platform ];
1818 $ this ->event ->setEventConfig ($ platform );
1919 }
2020
@@ -38,7 +38,7 @@ public function validatePlatformFile(): void
3838 if (empty ($ this ->event ->getEventConfig ())) {
3939 throw ConfigFileException::platformFile (
4040 $ this ->event ->platform ,
41- $ this ->event -> getPlatformFile ()
41+ $ this ->event
4242 );
4343 }
4444 }
Original file line number Diff line number Diff line change 2323it ('platform can be set for event with platform file ' , function () {
2424 $ this ->bot ->setPlatFormForEvent ('gitlab ' , 'storage/json/tgn/gitlab-events.json ' );
2525 expect ($ this ->bot ->event ->platform )->toBe ('gitlab ' )
26- ->and ($ this ->bot -> event -> getPlatformFile () )
26+ ->and ($ this ->bot )
2727 ->toBe ('storage/json/tgn/gitlab-events.json ' );
2828});
2929
You can’t perform that action at this time.
0 commit comments