• File: class-file-size-exception.php
  • Full Path: /home/matthif/www/wp-content/plugins/wordpress-seo/admin/exceptions/class-file-size-exception.php
  • Date Modified: 02/24/2024 11:29 PM
  • File size: 1.06 KB
  • MIME-type: text/x-php
  • Charset: utf-8
<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Admin\Exceptions
 */

/**
 * Represents named methods for exceptions.
 */
class WPSEO_File_Size_Exception extends Exception {

    
/**
     * Gets the exception for an externally hosted file.
     *
     * @param string $file_url The file url.
     *
     * @return WPSEO_File_Size_Exception Instance of the exception.
     */
    
public static function externally_hosted$file_url ) {
        
$message sprintf(
            
/* translators: %1$s expands to the requested url */
            
__'Cannot get the size of %1$s because it is hosted externally.''wordpress-seo' ),
            
$file_url
        
);

        return new 
self$message );
    }

    
/**
     * Gets the exception for when a unknown error occurs.
     *
     * @param string $file_url The file url.
     *
     * @return WPSEO_File_Size_Exception Instance of the exception.
     */
    
public static function unknown_error$file_url ) {
        
$message sprintf(
            
/* translators: %1$s expands to the requested url */
            
__'Cannot get the size of %1$s because of unknown reasons.''wordpress-seo' ),
            
$file_url
        
);

        return new 
self$message );
    }
}