forked from standardebooks/web
-
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.
Normalize URLs when submitting artwork to database
- Loading branch information
Showing
10 changed files
with
179 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<? | ||
namespace Exceptions; | ||
|
||
class InvalidArtworkPageUrlException extends AppException{ | ||
class InvalidArtworkPageUrlException extends InvalidUrlException{ | ||
protected $message = 'Invalid link to page with artwork.'; | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<? | ||
namespace Exceptions; | ||
|
||
class InvalidCopyrightPageUrlException extends AppException{ | ||
class InvalidCopyrightPageUrlException extends InvalidUrlException{ | ||
protected $message = 'Invalid link to page with copyright details.'; | ||
} |
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,6 @@ | ||
<? | ||
namespace Exceptions; | ||
|
||
class InvalidGoogleBooksUrlException extends InvalidUrlException{ | ||
protected $message = 'Invalid Google Books URL. Google Books URLs begin with “https://www.google.com/books/edition/_/” and must be in single-page view. An example of a valid Google Books URL is “https://www.google.com/books/edition/_/mZpAAAAAYAAJ?gbpv=1&pg=PA70-IA2”.'; | ||
} |
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,6 @@ | ||
<? | ||
namespace Exceptions; | ||
|
||
class InvalidHathiTrustUrlException extends InvalidUrlException{ | ||
protected $message = 'Invalid HathiTrust URL. HathiTrust URLs begin with “https://babel.hathitrust.org/cgi/pt”. An example of a valid HathiTrust URL is “https://babel.hathitrust.org/cgi/pt?id=hvd.32044034383265&seq=13”.'; | ||
} |
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,6 @@ | ||
<? | ||
namespace Exceptions; | ||
|
||
class InvalidInternetArchiveUrlException extends InvalidUrlException{ | ||
protected $message = 'Invalid Internet Archive URL. Internet Archive URLs begin with “https://archive.org/details/” and must be in single-page view. An example of a valid Internet Archive URL is “https://archive.org/details/royalacademypict1902roya/page/n9/mode/1up”.'; | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<? | ||
namespace Exceptions; | ||
|
||
class InvalidMuseumUrlException extends AppException{ | ||
class InvalidMuseumUrlException extends InvalidUrlException{ | ||
protected $message = 'Invalid link to an approved museum page.'; | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<? | ||
namespace Exceptions; | ||
|
||
class InvalidPublicationYearPageUrlException extends AppException{ | ||
class InvalidPublicationYearPageUrlException extends InvalidUrlException{ | ||
protected $message = 'Invalid link to page with year of publication.'; | ||
} |
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,12 @@ | ||
<? | ||
namespace Exceptions; | ||
|
||
class InvalidUrlException extends AppException{ | ||
protected $message = 'Invalid URL.'; | ||
|
||
public function __construct(?string $url = null){ | ||
if($url !== null){ | ||
parent::__construct('Invalid URL: “' . $url . '”.'); | ||
} | ||
} | ||
} |