Commit 0ef247a1 authored by Ra Mänd's avatar Ra Mänd
Browse files

Coding standard fixes.

parent bc0c8eb3
......@@ -652,8 +652,7 @@ class FieldCollectionItemEntity extends Entity {
*/
public function __sleep() {
$vars = get_object_vars($this);
unset($vars['entityInfo'], $vars['idKey'], $vars['nameKey'], $vars['statusKey']);
unset($vars['fieldInfo']);
unset($vars['entityInfo'], $vars['idKey'], $vars['nameKey'], $vars['statusKey'], $vars['fieldInfo']);
// Also do not serialize the host entity, but only if it has already an id.
if ($this->hostEntity && ($this->hostEntityId || $this->hostEntityRevisionId)) {
unset($vars['hostEntity']);
......
......@@ -41,7 +41,7 @@ class MigrateDestinationFieldCollection extends MigrateDestinationEntity {
*/
protected $hostEntityType;
static public function getKeySchema() {
public static function getKeySchema() {
return array(
'item_id' => array(
'type' => 'int',
......@@ -191,8 +191,7 @@ class MigrateDestinationFieldCollection extends MigrateDestinationEntity {
* Implements migrate hook_migrate_api().
*/
function field_collection_migrate_api() {
$api = array(
return array(
'api' => 2,
);
return $api;
}
This diff is collapsed.
......@@ -37,7 +37,7 @@ class FieldCollectionBasicTestCase extends DrupalWebTestCase {
'bundle' => 'article',
'label' => $this->randomName() . '_label',
'description' => $this->randomName() . '_description',
'weight' => mt_rand(0, 127),
'weight' => random_int(0, 127),
'settings' => array(),
'widget' => array(
'type' => 'hidden',
......@@ -459,7 +459,7 @@ class FieldCollectionRulesIntegrationTestCase extends DrupalWebTestCase {
'bundle' => 'article',
'label' => $this->randomName() . '_label',
'description' => $this->randomName() . '_description',
'weight' => mt_rand(0, 127),
'weight' => random_int(0, 127),
'settings' => array(),
'widget' => array(
'type' => 'hidden',
......@@ -574,7 +574,7 @@ class FieldCollectionContentTranslationTestCase extends DrupalWebTestCase {
'bundle' => 'article',
'label' => $this->randomName() . '_label',
'description' => $this->randomName() . '_description',
'weight' => mt_rand(0, 127),
'weight' => random_int(0, 127),
'settings' => array(),
'widget' => array(
'type' => 'field_collection_embed',
......@@ -789,7 +789,7 @@ class FieldCollectionEntityTranslationTestCase extends DrupalWebTestCase {
'bundle' => 'page',
'label' => $this->randomName() . '_label',
'description' => $this->randomName() . '_description',
'weight' => mt_rand(0, 127),
'weight' => random_int(0, 127),
'settings' => array(),
'widget' => array(
'type' => 'field_collection_embed',
......
......@@ -75,7 +75,7 @@ function field_collection_tokens($type, $tokens, array $data = array(), array $o
// Provide a complete set of tokens for type == 'host', and a supplementary
// token 'host' for type == 'field_collection_item'.
if (($type == 'field_collection_item' or $type == 'host') and !empty($data['field_collection_item'])) {
if (($type === 'field_collection_item' || $type === 'host') && !empty($data['field_collection_item'])) {
$collection = $data['field_collection_item'];
// When saving revisions, only $collection->original has valid state about
// its host entity.
......@@ -83,7 +83,7 @@ function field_collection_tokens($type, $tokens, array $data = array(), array $o
$collection = $collection->original;
}
if ($type == 'field_collection_item') {
if ($type === 'field_collection_item') {
if (!empty($tokens['host'])) {
$replacements[$tokens['host']] = $collection->hostEntityId();
}
......
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