Skip to content

Commit

Permalink
Fix phpcs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhedstrom committed May 7, 2021
1 parent 2570a3b commit 6dbd96e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
10 changes: 5 additions & 5 deletions src/Drupal/Driver/Cores/Drupal6.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,39 +531,39 @@ public function entityDelete($entity_type, $entity) {
* {@inheritdoc}
*/
public function startCollectingMail() {
// @todo: create a D6 version of this function
// @todo create a D6 version of this function
throw new \Exception('Mail testing is not yet implemented for Drupal 6.');
}

/**
* {@inheritdoc}
*/
public function stopCollectingMail() {
// @todo: create a D6 version of this function
// @todo create a D6 version of this function
throw new \Exception('Mail testing is not yet implemented for Drupal 6.');
}

/**
* {@inheritdoc}
*/
public function getMail() {
// @todo: create a D6 version of this function
// @todo create a D6 version of this function
throw new \Exception('Mail testing is not yet implemented for Drupal 6.');
}

/**
* {@inheritdoc}
*/
public function clearMail() {
// @todo: create a D6 version of this function
// @todo create a D6 version of this function
throw new \Exception('Mail testing is not yet implemented for Drupal 6.');
}

/**
* {@inheritdoc}
*/
public function sendMail($body, $subject = '', $to = '', $langcode = '') {
// @todo: create a D6 version of this function
// @todo create a D6 version of this function
throw new \Exception('Mail testing is not yet implemented for Drupal 6.');
}

Expand Down
10 changes: 5 additions & 5 deletions src/Drupal/Driver/Cores/Drupal7.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,39 +533,39 @@ public function entityDelete($entity_type, $entity) {
* {@inheritdoc}
*/
public function startCollectingMail() {
// @todo: create a D7 version of this function
// @todo create a D7 version of this function
throw new \Exception('Mail testing is not yet implemented for Drupal 7.');
}

/**
* {@inheritdoc}
*/
public function stopCollectingMail() {
// @todo: create a D7 version of this function
// @todo create a D7 version of this function
throw new \Exception('Mail testing is not yet implemented for Drupal 7.');
}

/**
* {@inheritdoc}
*/
public function getMail() {
// @todo: create a D7 version of this function
// @todo create a D7 version of this function
throw new \Exception('Mail testing is not yet implemented for Drupal 7.');
}

/**
* {@inheritdoc}
*/
public function clearMail() {
// @todo: create a D7 version of this function
// @todo create a D7 version of this function
throw new \Exception('Mail testing is not yet implemented for Drupal 7.');
}

/**
* {@inheritdoc}
*/
public function sendMail($body, $subject = '', $to = '', $langcode = '') {
// @todo: create a D7 version of this function
// @todo create a D7 version of this function
throw new \Exception('Mail testing is not yet implemented for Drupal 7.');
}

Expand Down
16 changes: 12 additions & 4 deletions src/Drupal/Driver/DrushDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ public function createEntity($entity_type, \StdClass $entity) {
'entity_type' => $entity_type,
'entity' => $entity,
];
$result = $this->drush('behat', ['create-entity', escapeshellarg(json_encode($options))], []);
$result = $this->drush('behat',
['create-entity', escapeshellarg(json_encode($options))], []);
return $this->decodeJsonObject($result);
}

Expand All @@ -287,7 +288,8 @@ public function entityDelete($entity_type, \StdClass $entity) {
'entity_type' => $entity_type,
'entity' => $entity,
];
$this->drush('behat', ['delete-entity', escapeshellarg(json_encode($options))], []);
$this->drush('behat',
['delete-entity', escapeshellarg(json_encode($options))], []);
}

/**
Expand All @@ -301,7 +303,9 @@ public function createNode($node) {
$node->uid = $uid;
}
}
$result = $this->drush('behat', ['create-node', escapeshellarg(json_encode($node))], []);
$result = $this->drush('behat',
['create-node', escapeshellarg(json_encode($node))],
[]);
return $this->decodeJsonObject($result);
}

Expand All @@ -316,7 +320,11 @@ public function nodeDelete($node) {
* {@inheritdoc}
*/
public function createTerm(\stdClass $term) {
$result = $this->drush('behat', ['create-term', escapeshellarg(json_encode($term))], []);
$result = $this->drush('behat',
[
'create-term',
escapeshellarg(json_encode($term)),
], []);
return $this->decodeJsonObject($result);
}

Expand Down
8 changes: 3 additions & 5 deletions src/Drupal/Driver/Fields/Drupal8/DatetimeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Drupal\Driver\Fields\Drupal8;

use DateTime;
use DateTimeZone;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface;

/**
Expand All @@ -15,8 +13,8 @@ class DatetimeHandler extends AbstractHandler {
* {@inheritdoc}
*/
public function expand($values) {
$siteTimezone = new DateTimeZone(\Drupal::config('system.date')->get('timezone.default'));
$storageTimezone = new DateTimeZone(DateTimeItemInterface::STORAGE_TIMEZONE);
$siteTimezone = new \DateTimeZone(\Drupal::config('system.date')->get('timezone.default'));
$storageTimezone = new \DateTimeZone(DateTimeItemInterface::STORAGE_TIMEZONE);
foreach ($values as $key => $value) {
if (strpos($value, "relative:") !== FALSE) {
$relative = trim(str_replace('relative:', '', $value));
Expand All @@ -28,7 +26,7 @@ public function expand($values) {
// uses UTC for internal storage. If no timezone is specified in a date
// field value by the step author, assume the default timezone of
// the Drupal install, and therefore transform it into UTC for storage.
$date = new DateTime($value, $siteTimezone);
$date = new \DateTime($value, $siteTimezone);
$date->setTimezone($storageTimezone);
$values[$key] = $date->format('Y-m-d\TH:i:s');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Drupal/Driver/Fields/Drupal8/ImageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function expand($values) {
throw new \Exception("Error reading file");
}

/* @var \Drupal\file\FileInterface $file */
/** @var \Drupal\file\FileInterface $file */
$file = file_save_data(
$data,
'public://' . uniqid() . '.jpg');
Expand Down

0 comments on commit 6dbd96e

Please sign in to comment.