Mark classes as final and enable strict types

This commit is contained in:
Oliver Davies 2020-05-09 02:17:12 +01:00
parent 7a9bf80a89
commit 730b724ac4
2 changed files with 7 additions and 3 deletions

View file

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace Drupal\custom\Plugin\migrate\destination; namespace Drupal\custom\Plugin\migrate\destination;
use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\Datetime\DrupalDateTime;
@ -18,7 +20,7 @@ use Illuminate\Support\Collection;
* id="opd_talk" * id="opd_talk"
* ) * )
*/ */
class OpdTalk extends EntityContentBase { final class OpdTalk extends EntityContentBase {
protected static function getEntityTypeId($plugin_id) { protected static function getEntityTypeId($plugin_id) {
return 'node'; return 'node';

View file

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace Drupal\custom\Plugin\migrate\process; namespace Drupal\custom\Plugin\migrate\process;
use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\MigrateExecutableInterface;
@ -14,9 +16,9 @@ use Illuminate\Support\Str;
* id = "opd_redirect" * id = "opd_redirect"
* ) * )
*/ */
class OpdRedirect extends ProcessPluginBase { final class OpdRedirect extends ProcessPluginBase {
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { public function transform($value, MigrateExecutableInterface $migrateExecutable, Row $row, $destinationProperty) {
if (Str::startsWith($value, '/')) { if (Str::startsWith($value, '/')) {
return "internal:{$value}"; return "internal:{$value}";
} }