-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
2,077 additions
and
570 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Gzhegow\Calendar; | ||
|
||
class CalendarFactory implements CalendarFactoryInterface | ||
{ | ||
public function newCalendar() : CalendarInterface | ||
{ | ||
return new Calendar(); | ||
} | ||
} |
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,8 @@ | ||
<?php | ||
|
||
namespace Gzhegow\Calendar; | ||
|
||
interface CalendarFactoryInterface | ||
{ | ||
public function newCalendar() : CalendarInterface; | ||
} |
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
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,81 @@ | ||
<?php | ||
|
||
namespace Gzhegow\Calendar\Exception; | ||
|
||
|
||
class Exception extends \Exception | ||
implements ExceptionInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $file; | ||
/** | ||
* @var int | ||
*/ | ||
public $line; | ||
|
||
/** | ||
* @var \Throwable | ||
*/ | ||
public $previous; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $message; | ||
/** | ||
* @var int | ||
*/ | ||
protected $code; | ||
|
||
|
||
public function __construct(...$errors) | ||
{ | ||
foreach ( \Gzhegow\Calendar\Lib::php_throwable_args(...$errors) as $k => $v ) { | ||
if (property_exists($this, $k)) { | ||
$this->{$k} = $v; | ||
} | ||
} | ||
|
||
parent::__construct($this->message, $this->code, $this->previous); | ||
} | ||
|
||
|
||
/** | ||
* @var \Throwable[] | ||
*/ | ||
protected $previousList = []; | ||
|
||
/** | ||
* @return \Throwable[] | ||
*/ | ||
public function getPreviousList() : array | ||
{ | ||
return $this->previousList; | ||
} | ||
|
||
/** | ||
* @return static | ||
*/ | ||
public function setPreviousList(array $previousList) | ||
{ | ||
$this->previousList = []; | ||
|
||
foreach ( $previousList as $previous ) { | ||
$this->addPrevious($previous); | ||
} | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return static | ||
*/ | ||
public function addPrevious(\Throwable $previous) // : static | ||
{ | ||
$this->previousList[] = $previous; | ||
|
||
return $this; | ||
} | ||
} |
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,8 @@ | ||
<?php | ||
|
||
namespace Gzhegow\Calendar\Exception; | ||
|
||
interface ExceptionInterface | ||
{ | ||
|
||
} |
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,81 @@ | ||
<?php | ||
|
||
namespace Gzhegow\Calendar\Exception; | ||
|
||
|
||
class LogicException extends \LogicException | ||
implements ExceptionInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $file; | ||
/** | ||
* @var int | ||
*/ | ||
public $line; | ||
|
||
/** | ||
* @var \Throwable | ||
*/ | ||
public $previous; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $message; | ||
/** | ||
* @var int | ||
*/ | ||
protected $code; | ||
|
||
|
||
public function __construct(...$errors) | ||
{ | ||
foreach ( \Gzhegow\Calendar\Lib::php_throwable_args(...$errors) as $k => $v ) { | ||
if (property_exists($this, $k)) { | ||
$this->{$k} = $v; | ||
} | ||
} | ||
|
||
parent::__construct($this->message, $this->code, $this->previous); | ||
} | ||
|
||
|
||
/** | ||
* @var \Throwable[] | ||
*/ | ||
protected $previousList = []; | ||
|
||
/** | ||
* @return \Throwable[] | ||
*/ | ||
public function getPreviousList() : array | ||
{ | ||
return $this->previousList; | ||
} | ||
|
||
/** | ||
* @return static | ||
*/ | ||
public function setPreviousList(array $previousList) | ||
{ | ||
$this->previousList = []; | ||
|
||
foreach ( $previousList as $previous ) { | ||
$this->addPrevious($previous); | ||
} | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return static | ||
*/ | ||
public function addPrevious(\Throwable $previous) // : static | ||
{ | ||
$this->previousList[] = $previous; | ||
|
||
return $this; | ||
} | ||
} |
Oops, something went wrong.