Commit 70bf2a34 authored by Bart Vanhoutte's avatar Bart Vanhoutte
Browse files

Code conventions.

parent f2356132
......@@ -12,7 +12,8 @@ This module requires the the following PHP extension:
## Installation
1. Install the module.
2. Copy the contents of the .htaccess file in the module root to your site-wide .htaccess.
2. Copy the contents of the .htaccess file in the module root to your
site-wide .htaccess.
## Maintainers
* Bart Vanhoutte (Bart Vanhoutte) - https://www.drupal.org/user/1133754
......@@ -38,7 +38,7 @@ class Webp extends ConfigurableImageAPIOptimizeProcessorBase {
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['quality'] = array(
$form['quality'] = [
'#type' => 'number',
'#title' => $this->t('Image quality'),
'#description' => $this->t('Specify the image quality.'),
......@@ -46,7 +46,7 @@ class Webp extends ConfigurableImageAPIOptimizeProcessorBase {
'#required' => TRUE,
'#min' => 1,
'#max' => 100,
);
];
return $form;
}
......
......@@ -49,7 +49,7 @@ class Webp {
/**
* Creates a WebP copy of a source image URI.
*
* @param $uri
* @param string $uri
* Image URI.
* @param int $quality
* Image quality factor.
......
......@@ -4,4 +4,4 @@ description: Generates WebP copies of image style derivatives.
core: 8.x
package: Other
dependencies:
- image
\ No newline at end of file
- drupal:image
......@@ -5,8 +5,6 @@
* Contains install and update functions for WebP.
*/
/**
* Implements hook_install().
*/
......@@ -25,7 +23,6 @@ function webp_install() {
* Implements hook_uninstall().
*/
function webp_uninstall() {
if (\Drupal::moduleHandler()->moduleExists('imageapi_optimize')) {
// imageapi_optimize: delete the WebP processor from all pipelines.
$storage = \Drupal::entityTypeManager()->getStorage('imageapi_optimize_pipeline');
......@@ -49,5 +46,4 @@ function webp_uninstall() {
$webp = \Drupal::service('webp.webp');
$webp->deleteImageStyleDerivatives();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment