Skip to content

Commit ada293f

Browse files
combine this bit of code
1 parent 6893030 commit ada293f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/JSON/Schema/Modern.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ sub add_schema {
154154
croak 'cannot add a schema with a uri with a fragment' if defined $uri->fragment;
155155
croak 'insufficient arguments' if not @_;
156156

157-
Carp::carp('use of deprecated form of add_schema with document')
158-
if $_[0]->$_isa('JSON::Schema::Modern::Document');
159-
160-
return $self->add_document($uri, $_[0]) if $_[0]->$_isa('JSON::Schema::Modern::Document');
157+
if ($_[0]->$_isa('JSON::Schema::Modern::Document')) {
158+
Carp::carp('use of deprecated form of add_schema with document');
159+
return $self->add_document($uri, $_[0]);
160+
}
161161

162162
# document BUILD will trigger $self->traverse($schema)
163163
# Note we do not pass the uri to the document constructor, so resources in that document may still

0 commit comments

Comments
 (0)