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: ...@@ -12,7 +12,8 @@ This module requires the the following PHP extension:
## Installation ## Installation
1. Install the module. 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 ## Maintainers
* Bart Vanhoutte (Bart Vanhoutte) - https://www.drupal.org/user/1133754 * Bart Vanhoutte (Bart Vanhoutte) - https://www.drupal.org/user/1133754
...@@ -38,7 +38,7 @@ class Webp extends ConfigurableImageAPIOptimizeProcessorBase { ...@@ -38,7 +38,7 @@ class Webp extends ConfigurableImageAPIOptimizeProcessorBase {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function buildConfigurationForm(array $form, FormStateInterface $form_state) { public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['quality'] = array( $form['quality'] = [
'#type' => 'number', '#type' => 'number',
'#title' => $this->t('Image quality'), '#title' => $this->t('Image quality'),
'#description' => $this->t('Specify the image quality.'), '#description' => $this->t('Specify the image quality.'),
...@@ -46,7 +46,7 @@ class Webp extends ConfigurableImageAPIOptimizeProcessorBase { ...@@ -46,7 +46,7 @@ class Webp extends ConfigurableImageAPIOptimizeProcessorBase {
'#required' => TRUE, '#required' => TRUE,
'#min' => 1, '#min' => 1,
'#max' => 100, '#max' => 100,
); ];
return $form; return $form;
} }
......
...@@ -49,7 +49,7 @@ class Webp { ...@@ -49,7 +49,7 @@ class Webp {
/** /**
* Creates a WebP copy of a source image URI. * Creates a WebP copy of a source image URI.
* *
* @param $uri * @param string $uri
* Image URI. * Image URI.
* @param int $quality * @param int $quality
* Image quality factor. * Image quality factor.
......
...@@ -4,4 +4,4 @@ description: Generates WebP copies of image style derivatives. ...@@ -4,4 +4,4 @@ description: Generates WebP copies of image style derivatives.
core: 8.x core: 8.x
package: Other package: Other
dependencies: dependencies:
- image - drupal:image
\ No newline at end of file
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
* Contains install and update functions for WebP. * Contains install and update functions for WebP.
*/ */
/** /**
* Implements hook_install(). * Implements hook_install().
*/ */
...@@ -25,7 +23,6 @@ function webp_install() { ...@@ -25,7 +23,6 @@ function webp_install() {
* Implements hook_uninstall(). * Implements hook_uninstall().
*/ */
function webp_uninstall() { function webp_uninstall() {
if (\Drupal::moduleHandler()->moduleExists('imageapi_optimize')) { if (\Drupal::moduleHandler()->moduleExists('imageapi_optimize')) {
// imageapi_optimize: delete the WebP processor from all pipelines. // imageapi_optimize: delete the WebP processor from all pipelines.
$storage = \Drupal::entityTypeManager()->getStorage('imageapi_optimize_pipeline'); $storage = \Drupal::entityTypeManager()->getStorage('imageapi_optimize_pipeline');
...@@ -49,5 +46,4 @@ function webp_uninstall() { ...@@ -49,5 +46,4 @@ function webp_uninstall() {
$webp = \Drupal::service('webp.webp'); $webp = \Drupal::service('webp.webp');
$webp->deleteImageStyleDerivatives(); $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