Skip to content

Commit

Permalink
Split SpecificationInterface in two
Browse files Browse the repository at this point in the history
  • Loading branch information
rikbruil committed Mar 8, 2015
1 parent 98af9cc commit 6779d45
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 25 deletions.
11 changes: 4 additions & 7 deletions src/CompositeSpecification.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,26 @@
/**
* @package Rb\Specification
*/
abstract class CompositeSpecification implements SpecificationInterface
abstract class CompositeSpecification implements CompositeSpecificationInterface
{
/**
* @param SpecificationInterface $specification
* @return AndX
* {@inheritDoc}
*/
public function andX(SpecificationInterface $specification)
{
return new AndX($this, $specification);
}

/**
* @param SpecificationInterface $specification
* @return OrX
* {@inheritDoc}
*/
public function orX(SpecificationInterface $specification)
{
return new OrX($this, $specification);
}

/**
* @param SpecificationInterface $specification
* @return Not
* {@inheritDoc}
*/
public function not(SpecificationInterface $specification)
{
Expand Down
27 changes: 27 additions & 0 deletions src/CompositeSpecificationInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Rb\Specification;

/**
* @package Rb\Specification
*/
interface CompositeSpecificationInterface extends SpecificationInterface
{
/**
* @param SpecificationInterface $specification
* @return AndX
*/
public function andX(SpecificationInterface $specification);

/**
* @param SpecificationInterface $specification
* @return OrX
*/
public function orX(SpecificationInterface $specification);

/**
* @param SpecificationInterface $specification
* @return Not
*/
public function not(SpecificationInterface $specification);
}
18 changes: 0 additions & 18 deletions src/SpecificationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@
*/
interface SpecificationInterface
{
/**
* @param SpecificationInterface $specification
* @return AndX
*/
public function andX(SpecificationInterface $specification);

/**
* @param SpecificationInterface $specification
* @return OrX
*/
public function orX(SpecificationInterface $specification);

/**
* @param SpecificationInterface $specification
* @return Not
*/
public function not(SpecificationInterface $specification);

/**
* Returns a boolean indicating whether or not this specification can support the given class
* @param mixed $value
Expand Down

0 comments on commit 6779d45

Please sign in to comment.