| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Imagify\Context; |
| 3 | 3 | |
| 4 | -defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); | |
| 4 | +use Imagify\Traits\InstanceGetterTrait; | |
| 5 | 5 | |
| 6 | 6 | /** |
| 7 | 7 | * Fallback class for contexts. |
| 8 | 8 | * |
| @@ -8,16 +8,15 @@ | ||
| 8 | 8 | * |
| 9 | 9 | * @since 1.9 |
| 10 | 10 | * @author Grégory Viguier |
| 11 | 11 | */ |
| 12 | -class Noop implements ContextInterface { | |
| 13 | - use \Imagify\Traits\InstanceGetterTrait; | |
| 12 | +final class Noop implements ContextInterface { | |
| 13 | + use InstanceGetterTrait; | |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Get the context "short name". |
| 17 | 17 | * |
| 18 | 18 | * @since 1.9 |
| 19 | - * @access public | |
| 20 | 19 | * @author Grégory Viguier |
| 21 | 20 | * |
| 22 | 21 | * @return string |
| 23 | 22 | */ |
| @@ -28,9 +27,8 @@ | ||
| 28 | 27 | /** |
| 29 | 28 | * Tell if the context is network-wide. |
| 30 | 29 | * |
| 31 | 30 | * @since 1.9 |
| 32 | - * @access public | |
| 33 | 31 | * @author Grégory Viguier |
| 34 | 32 | * |
| 35 | 33 | * @return bool |
| 36 | 34 | */ |
| @@ -41,9 +39,8 @@ | ||
| 41 | 39 | /** |
| 42 | 40 | * Get the type of files this context allows. |
| 43 | 41 | * |
| 44 | 42 | * @since 1.9 |
| 45 | - * @access protected | |
| 46 | 43 | * @see imagify_get_mime_types() |
| 47 | 44 | * @author Grégory Viguier |
| 48 | 45 | * |
| 49 | 46 | * @return string Possible values are: |
| @@ -58,9 +55,8 @@ | ||
| 58 | 55 | /** |
| 59 | 56 | * Get the thumbnail sizes for this context, except the full size. |
| 60 | 57 | * |
| 61 | 58 | * @since 1.9 |
| 62 | - * @access public | |
| 63 | 59 | * @author Grégory Viguier |
| 64 | 60 | * |
| 65 | 61 | * @return array { |
| 66 | 62 | * Data for the currently registered thumbnail sizes. |
| @@ -80,9 +76,8 @@ | ||
| 80 | 76 | * Get images max width for this context. This is used when resizing. |
| 81 | 77 | * 0 means to not resize. |
| 82 | 78 | * |
| 83 | 79 | * @since 1.9.8 |
| 84 | - * @access public | |
| 85 | 80 | * @author Grégory Viguier |
| 86 | 81 | * |
| 87 | 82 | * @return int |
| 88 | 83 | */ |
| @@ -90,31 +85,29 @@ | ||
| 90 | 85 | return 0; |
| 91 | 86 | } |
| 92 | 87 | |
| 93 | 88 | /** |
| 94 | - * Tell if the optimization process is allowed to backup in this context. | |
| 89 | + * Tell if the optimization process is allowed resize in this context. | |
| 95 | 90 | * |
| 96 | 91 | * @since 1.9 |
| 97 | - * @access public | |
| 98 | 92 | * @author Grégory Viguier |
| 99 | 93 | * |
| 100 | 94 | * @return bool |
| 101 | 95 | */ |
| 102 | - public function can_backup() { | |
| 96 | + public function can_resize() { | |
| 103 | 97 | return false; |
| 104 | 98 | } |
| 105 | 99 | |
| 106 | 100 | /** |
| 107 | - * Tell if the optimization process is allowed to keep exif in this context. | |
| 101 | + * Tell if the optimization process is allowed to backup in this context. | |
| 108 | 102 | * |
| 109 | 103 | * @since 1.9 |
| 110 | - * @access public | |
| 111 | 104 | * @author Grégory Viguier |
| 112 | 105 | * |
| 113 | 106 | * @return bool |
| 114 | 107 | */ |
| 115 | - public function can_keep_exif() { | |
| 116 | - return true; | |
| 108 | + public function can_backup() { | |
| 109 | + return false; | |
| 117 | 110 | } |
| 118 | 111 | |
| 119 | 112 | /** |
| 120 | 113 | * Tell if the current user is allowed to operate Imagify in this context. |
| @@ -119,9 +112,8 @@ | ||
| 119 | 112 | /** |
| 120 | 113 | * Tell if the current user is allowed to operate Imagify in this context. |
| 121 | 114 | * |
| 122 | 115 | * @since 1.9 |
| 123 | - * @access public | |
| 124 | 116 | * @author Grégory Viguier |
| 125 | 117 | * |
| 126 | 118 | * @param string $describer Capacity describer. See $this->get_capacity() for possible values. Can also be a "real" user capacity. |
| 127 | 119 | * @param int $media_id A media ID. |
| @@ -134,9 +126,8 @@ | ||
| 134 | 126 | /** |
| 135 | 127 | * Tell if a user is allowed to operate Imagify in this context. |
| 136 | 128 | * |
| 137 | 129 | * @since 1.9 |
| 138 | - * @access public | |
| 139 | 130 | * @author Grégory Viguier |
| 140 | 131 | * |
| 141 | 132 | * @param int $user_id A user ID. |
| 142 | 133 | * @param string $describer Capacity describer. See $this->get_capacity() for possible values. Can also be a "real" user capacity. |
| @@ -150,9 +141,8 @@ | ||
| 150 | 141 | /** |
| 151 | 142 | * Get user capacity to operate Imagify in this context. |
| 152 | 143 | * |
| 153 | 144 | * @since 1.9 |
| 154 | - * @access public | |
| 155 | 145 | * @author Grégory Viguier |
| 156 | 146 | * |
| 157 | 147 | * @param string $describer Capacity describer. Possible values are like 'manage', 'bulk-optimize', 'manual-optimize', 'auto-optimize'. |
| 158 | 148 | * @return string |