-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add method property in Event - Update Unit test to test new properties
- Loading branch information
1 parent
b65e802
commit ba81b43
Showing
6 changed files
with
159 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the eluceo/iCal package. | ||
* | ||
* (c) 2021 Markus Poerschke <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Eluceo\iCal\Domain\Enum; | ||
|
||
final class MethodType | ||
{ | ||
private static ?self $publish = null; | ||
private static ?self $cancel = null; | ||
|
||
private string $method; | ||
|
||
public function __construct(string $method) | ||
{ | ||
assert(!empty($method), 'Method cannot be empty'); | ||
|
||
$this->method = $method; | ||
} | ||
|
||
public static function PUBLISH(): self | ||
{ | ||
return self::$publish = self::$publish ?? new MethodType('PUBLISH'); | ||
} | ||
|
||
public static function CANCELLED(): self | ||
{ | ||
return self::$cancel = self::$cancel ?? new MethodType('CANCEL'); | ||
} | ||
|
||
public function __toString() | ||
{ | ||
return $this->method; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the eluceo/iCal package. | ||
* | ||
* (c) 2021 Markus Poerschke <[email protected]> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
namespace Eluceo\iCal\Domain\Enum; | ||
|
||
final class StatusType | ||
{ | ||
private static ?self $confirmed = null; | ||
private static ?self $cancelled = null; | ||
private static ?self $tentative = null; | ||
|
||
private string $status; | ||
|
||
public function __construct(string $status) | ||
{ | ||
assert(!empty($status), 'Status cannot be empty'); | ||
|
||
$this->status = $status; | ||
} | ||
|
||
public static function CONFIRMED(): self | ||
{ | ||
return self::$confirmed = self::$confirmed ?? new StatusType('CONFIRMED'); | ||
} | ||
|
||
public static function CANCELLED(): self | ||
{ | ||
return self::$cancelled = self::$cancelled ?? new StatusType('CANCELLED'); | ||
} | ||
|
||
public static function TENTATIVE(): self | ||
{ | ||
return self::$tentative = self::$tentative ?? new StatusType('TENTATIVE'); | ||
} | ||
|
||
public function __toString() | ||
{ | ||
return $this->status; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters