Skip to content

Commit

Permalink
Improve error message for Period::intersect #33
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Apr 11, 2016
1 parent 5269872 commit 58cc8fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ script:
- composer test

after_script:
- if [ "$COLLECT_COVERAGE" == "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
- if [ "$COLLECT_COVERAGE" == "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; && php ocular.phar code-coverage:upload --format=php-clover build/clover.xml; fi
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-clover" target="build/clover.xml"/>
</logging>

</phpunit>
4 changes: 2 additions & 2 deletions src/Period.php
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,8 @@ public function split($interval)
*/
public function intersect(Period $period)
{
if ($this->abuts($period)) {
throw new LogicException('Both object should not abuts');
if (! $this->overlaps($period)) {
throw new LogicException('Both object should at least overlaps');
}

return new static(
Expand Down

0 comments on commit 58cc8fd

Please sign in to comment.