Skip to content

Commit

Permalink
Merge pull request #606 from Berdir/php81
Browse files Browse the repository at this point in the history
Php81
  • Loading branch information
jhedstrom authored Apr 26, 2022
2 parents cf37e2d + 0b1c5f3 commit c5c0382
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ language: php
php:
- 7.3
- 7.4
- 8.0
- 8.1

env:
global:
- PATH=$PATH:/home/travis/.config/composer/vendor/bin
- TRAVIS_NODE_VERSION="4.0.0"
matrix:
- DRUPAL_VERSION=7
- DRUPAL_VERSION=8
- DRUPAL_VERSION=9

# Enable Travis containers.
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"require": {
"behat/behat": "~3.2",
"behat/mink": "~1.5",
"behat/mink-extension": "~2.0",
"friends-of-behat/mink-extension": "^2",
"behat/mink-goutte-driver": "~1.0",
"behat/mink-selenium2-driver": "~1.1",
"drupal/drupal-driver": "^2.1.0",
Expand All @@ -38,7 +38,7 @@
"drupal/core-recommended": "^9.1",
"drush/drush": "^10.5",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpspec/phpspec": "^4.0 || ^6.0"
"phpspec/phpspec": "^4.0 || ^6.0 || ^7.0"
},
"scripts": {
"test": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
$element[$key] = [
'#type' => 'textfield',
'#title' => $title,
'#default_value' => isset($items[$delta]->$key) ? $items[$delta]->$key : '',
'#default_value' => $items[$delta]->$key ?? '',
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
$element[$key] = [
'#type' => 'textfield',
'#title' => $title,
'#default_value' => isset($items[$delta]->$key) ? $items[$delta]->$key : '',
'#default_value' => $items[$delta]->$key ?? '',
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Drupal/DrupalDriverManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function registerDriver($name, DriverInterface $driver)
*/
public function getDriver($name = null)
{
$name = strtolower($name) ?: $this->defaultDriverName;
$name = null === $name ? $this->defaultDriverName : strtolower($name);

if (null === $name) {
throw new \InvalidArgumentException('Specify a Drupal driver to get.');
Expand Down
2 changes: 1 addition & 1 deletion src/Drupal/DrupalExtension/Context/RawDrupalContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ public function parseEntityFields($entity_type, \stdClass $entity)
// Split up multiple values in multi-value fields.
$values = [];
foreach (str_getcsv($field_value) as $key => $value) {
$value = trim($value);
$value = trim((string) $value);
$columns = $value;
// Split up field columns if the ' - ' separator is present.
if (strstr($value, ' - ') !== false) {
Expand Down

0 comments on commit c5c0382

Please sign in to comment.