-
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
42 changed files
with
698 additions
and
77 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
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,16 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace C0ntax\ParsleyBundle\Contracts; | ||
|
||
/** | ||
* Interface ParsleyInterface | ||
* | ||
* This interface doesn't actually mandate anything. It's just to let us know that things is a parsley command | ||
* | ||
* @package C0ntax\ParsleyBundle\Contracts | ||
*/ | ||
interface ParsleyInterface | ||
{ | ||
|
||
} |
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,19 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace C0ntax\ParsleyBundle\Contracts; | ||
|
||
/** | ||
* Interface RemoveInterface | ||
* | ||
* @package C0ntax\ParsleyBundle\Contracts | ||
*/ | ||
interface RemoveInterface extends ParsleyInterface | ||
{ | ||
/** | ||
* Get the fully qualified classname that is to be removed from the view | ||
* | ||
* @return string | ||
*/ | ||
public function getClassName(): string; | ||
} |
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,57 @@ | ||
<?php | ||
|
||
namespace C0ntax\ParsleyBundle\Parsleys; | ||
|
||
use C0ntax\ParsleyBundle\Contracts\RemoveInterface; | ||
|
||
/** | ||
* Class AbstractRemove | ||
* | ||
* @package C0ntax\ParsleyBundle\Parsleys | ||
*/ | ||
abstract class AbstractRemove implements RemoveInterface | ||
{ | ||
/** @var string */ | ||
private $className; | ||
|
||
/** | ||
* AbstractRemove constructor. | ||
* | ||
* @param string $className | ||
* @param string $instanceOf | ||
* @throws \InvalidArgumentException | ||
*/ | ||
public function __construct(string $className, string $instanceOf) | ||
{ | ||
if (!class_exists($className)) { | ||
throw new \InvalidArgumentException('Class '.$className.' does not exist'); | ||
} | ||
|
||
$instancesOf = array_merge(class_implements($className), class_parents($className)); | ||
|
||
if (!in_array($instanceOf, $instancesOf, true)) { | ||
throw new \InvalidArgumentException('Class '.$className.' does not implement '.$instanceOf); | ||
} | ||
|
||
$this->setClassName($className); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getClassName(): string | ||
{ | ||
return $this->className; | ||
} | ||
|
||
/** | ||
* @param string $className | ||
* @return AbstractRemove | ||
*/ | ||
private function setClassName(string $className): AbstractRemove | ||
{ | ||
$this->className = $className; | ||
|
||
return $this; | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...e/Field/Constraint/AbstractComparison.php → ...e/Field/Constraint/AbstractComparison.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
6 changes: 3 additions & 3 deletions
6
...e/Field/Constraint/AbstractConstraint.php → ...e/Field/Constraint/AbstractConstraint.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
4 changes: 2 additions & 2 deletions
4
...ctive/Field/Constraint/AbstractLength.php → ...ctive/Field/Constraint/AbstractLength.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
4 changes: 2 additions & 2 deletions
4
src/Directive/Field/Constraint/Email.php → ...leys/Directive/Field/Constraint/Email.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
Oops, something went wrong.