mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 13:02:40 +00:00
Little cleanup in exceptions.
- Removed duplicated or non-used exceptions. - Making the error messages more descriptive and stardard.
This commit is contained in:
parent
3ed712e745
commit
1cf67b1e55
22 changed files with 89 additions and 271 deletions
|
@ -73,7 +73,7 @@ class ComponentCollection extends ObjectCollection {
|
|||
* @param string $component Component name to load
|
||||
* @param array $settings Settings for the component.
|
||||
* @return Component A component object, Either the existing loaded component or a new one.
|
||||
* @throws MissingComponentFileException, MissingComponentClassException when the component could not be found
|
||||
* @throws MissingComponentException when the component could not be found
|
||||
*/
|
||||
public function load($component, $settings = array()) {
|
||||
if (is_array($settings) && isset($settings['className'])) {
|
||||
|
@ -90,8 +90,7 @@ class ComponentCollection extends ObjectCollection {
|
|||
$componentClass = $name . 'Component';
|
||||
App::uses($componentClass, $plugin . 'Controller/Component');
|
||||
if (!class_exists($componentClass)) {
|
||||
throw new MissingComponentClassException(array(
|
||||
'file' => Inflector::underscore($componentClass) . '.php',
|
||||
throw new MissingComponentException(array(
|
||||
'class' => $componentClass
|
||||
));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue