diff --git a/core/lib/Drupal/Component/Archiver/ArchiveTar.php b/core/lib/Drupal/Component/Archiver/ArchiveTar.php index f6ef5061d79dd587eddb11be355d94eb80672d14..4a8d828eb8400a397cabd4f6273e3edd3f78f353 100644 --- a/core/lib/Drupal/Component/Archiver/ArchiveTar.php +++ b/core/lib/Drupal/Component/Archiver/ArchiveTar.php @@ -42,6 +42,8 @@ namespace Drupal\Component\Archiver; +use Exception; + //require_once 'PEAR.php'; // // diff --git a/core/lib/Drupal/Component/Archiver/ArchiverException.php b/core/lib/Drupal/Component/Archiver/ArchiverException.php new file mode 100644 index 0000000000000000000000000000000000000000..12af470491defaffff2cc57e83ac624b9dd7a14d --- /dev/null +++ b/core/lib/Drupal/Component/Archiver/ArchiverException.php @@ -0,0 +1,16 @@ +<?php + +/** + * @file + * Definition of Drupal\Component\Archiver\ArchiverException. + */ + +namespace Drupal\Component\Archiver; + +use Exception; + +/** + * Defines an exception class for Drupal\Component\Archiver\ArchiverInterface. + */ +class ArchiverException extends Exception { +} diff --git a/core/lib/Drupal/Component/Archiver/ArchiverInterface.php b/core/lib/Drupal/Component/Archiver/ArchiverInterface.php index 12752e4db604142c3e7ec2593666f9da0c831899..3b2dc28386a6e8bee93ff1f48f0cc981839840f4 100644 --- a/core/lib/Drupal/Component/Archiver/ArchiverInterface.php +++ b/core/lib/Drupal/Component/Archiver/ArchiverInterface.php @@ -19,6 +19,8 @@ interface ArchiverInterface { * The full system path of the archive to manipulate. Only local files * are supported. If the file does not yet exist, it will be created if * appropriate. + * + * @throws Drupal\Component\Archiver\ArchiverException */ public function __construct($file_path); diff --git a/core/lib/Drupal/Component/Archiver/Zip.php b/core/lib/Drupal/Component/Archiver/Zip.php index c6f5a4c47621068c4323e84f8292b06faf72f55e..47bfb678b90dce14b24228a5d6f9f573c231b496 100644 --- a/core/lib/Drupal/Component/Archiver/Zip.php +++ b/core/lib/Drupal/Component/Archiver/Zip.php @@ -32,8 +32,7 @@ class Zip implements ArchiverInterface { public function __construct($file_path) { $this->zip = new ZipArchive(); if ($this->zip->open($file_path) !== TRUE) { - // @todo: This should be an interface-specific exception some day. - throw new Exception(t('Cannot open %file_path', array('%file_path' => $file_path))); + throw new ArchiverException(t('Cannot open %file_path', array('%file_path' => $file_path))); } } diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php index ae2db873a03c1f45ead75678a2f387534839556e..6dc40a218ab6164d668a4cd33ae557ced11234fa 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php @@ -10,6 +10,8 @@ use Drupal\Core\Database\Database; use Drupal\Core\Database\Install\Tasks as InstallTasks; +use Exception; + /** * PostgreSQL specific install functions */ diff --git a/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php index ece3c7c251931d458802fbd340da2275fb1ce837..5d34a62b263327de0fdca5b654b1f4e30939a82f 100644 --- a/core/lib/Drupal/Core/Database/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Install/Tasks.php @@ -10,6 +10,7 @@ use Drupal\Core\Database\Database; use PDO; +use Exception; /** * Database installer structure. diff --git a/core/lib/Drupal/Core/Database/Query/Insert.php b/core/lib/Drupal/Core/Database/Query/Insert.php index e19de45cfa75319eca5abdc471bb9c3ef781da2d..b3c4c0e40a7a2f2d3f9dc61f4b2ec039e9db1c3d 100644 --- a/core/lib/Drupal/Core/Database/Query/Insert.php +++ b/core/lib/Drupal/Core/Database/Query/Insert.php @@ -9,6 +9,8 @@ use Drupal\Core\Database\Database; +use Exception; + /** * General class for an abstracted INSERT query. */ diff --git a/core/lib/Drupal/Core/Updater/UpdaterException.php b/core/lib/Drupal/Core/Updater/UpdaterException.php index fc9cb9db69013dc4f26de22cff09cb5ca87a9966..aee43a660d66c8ab9cbd8e3a887ef6f7b995028b 100644 --- a/core/lib/Drupal/Core/Updater/UpdaterException.php +++ b/core/lib/Drupal/Core/Updater/UpdaterException.php @@ -7,6 +7,8 @@ namespace Drupal\Core\Updater; +use Exception; + /** * Defines a Exception class for the Drupal\Core\Updater\Updater class * hierarchy.