Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Removed some line duplication issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsomoza committed Jul 13, 2015
1 parent 616abd6 commit 769628d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/Version/Collection/LinkedVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ class LinkedVersions extends SortableVersions
*/
public function isAcceptable($version)
{
parent::isAcceptable($version);
/** @var Version $version */
if (!$version->hasMigration()) {
if (parent::isAcceptable($version) && !$version->hasMigration()) {
throw new MigrationMissingException(sprintf(
'Version "%s" must be associated with a Migration in order to be accepted into this collection.',
$version->getId()
Expand Down
3 changes: 1 addition & 2 deletions lib/Version/Collection/MigratedVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ class MigratedVersions extends SortableVersions
*/
public function isAcceptable($version)
{
parent::isAcceptable($version);
/** @var Version $version */
if (!$version->isMigrated()) {
if (parent::isAcceptable($version) && !$version->isMigrated()) {
throw new CollectionException(sprintf(
'Version "%s" must be migrated in order to be accepted into this collection.',
$version->getId()
Expand Down
3 changes: 1 addition & 2 deletions lib/Version/Collection/SortableVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ class SortableVersions extends IndexedVersions
*/
public function isAcceptable($version)
{
parent::isAcceptable($version);
/** @var Version $version */
if ($this->has($version->getId())) {
if (parent::isAcceptable($version) && $this->has($version->getId())) {
throw new CollectionException(
sprintf('Item with id "%s" already exists', $version->getId())
);
Expand Down

0 comments on commit 769628d

Please sign in to comment.