This repository has been archived by the owner on May 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
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
25 changed files
with
563 additions
and
404 deletions.
There are no files selected for viewing
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
49 changes: 49 additions & 0 deletions
49
...ollections/TypeCheck/Validator/Icecave/Collections/Detail/LinkedListIteratorTypeCheck.php
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,49 @@ | ||
<?php | ||
namespace Icecave\Collections\TypeCheck\Validator\Icecave\Collections\Detail; | ||
|
||
class LinkedListIteratorTypeCheck extends \Icecave\Collections\TypeCheck\AbstractValidator | ||
{ | ||
public function validateConstruct(array $arguments) | ||
{ | ||
$argumentCount = \count($arguments); | ||
if ($argumentCount > 2) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(2, $arguments[2]); | ||
} | ||
} | ||
|
||
public function current(array $arguments) | ||
{ | ||
if (\count($arguments) > 0) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]); | ||
} | ||
} | ||
|
||
public function key(array $arguments) | ||
{ | ||
if (\count($arguments) > 0) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]); | ||
} | ||
} | ||
|
||
public function next(array $arguments) | ||
{ | ||
if (\count($arguments) > 0) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]); | ||
} | ||
} | ||
|
||
public function rewind(array $arguments) | ||
{ | ||
if (\count($arguments) > 0) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]); | ||
} | ||
} | ||
|
||
public function valid(array $arguments) | ||
{ | ||
if (\count($arguments) > 0) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]); | ||
} | ||
} | ||
|
||
} |
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
58 changes: 58 additions & 0 deletions
58
.../Collections/TypeCheck/Validator/Icecave/Collections/Iterator/UnpackIteratorTypeCheck.php
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,58 @@ | ||
<?php | ||
namespace Icecave\Collections\TypeCheck\Validator\Icecave\Collections\Iterator; | ||
|
||
class UnpackIteratorTypeCheck extends \Icecave\Collections\TypeCheck\AbstractValidator | ||
{ | ||
public function validateConstruct(array $arguments) | ||
{ | ||
$argumentCount = \count($arguments); | ||
if ($argumentCount < 1) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\MissingArgumentException('iterator', 0, 'Iterator'); | ||
} elseif ($argumentCount > 1) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(1, $arguments[1]); | ||
} | ||
} | ||
|
||
public function getInnerIterator(array $arguments) | ||
{ | ||
if (\count($arguments) > 0) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]); | ||
} | ||
} | ||
|
||
public function current(array $arguments) | ||
{ | ||
if (\count($arguments) > 0) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]); | ||
} | ||
} | ||
|
||
public function key(array $arguments) | ||
{ | ||
if (\count($arguments) > 0) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]); | ||
} | ||
} | ||
|
||
public function next(array $arguments) | ||
{ | ||
if (\count($arguments) > 0) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]); | ||
} | ||
} | ||
|
||
public function rewind(array $arguments) | ||
{ | ||
if (\count($arguments) > 0) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]); | ||
} | ||
} | ||
|
||
public function valid(array $arguments) | ||
{ | ||
if (\count($arguments) > 0) { | ||
throw new \Icecave\Collections\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]); | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.