Commit 58481b72 authored by alexpott's avatar alexpott

Issue #2454441 by rteijeiro, hussainweb, 17thColossus, nullkernel: Rename...

Issue #2454441 by rteijeiro, hussainweb, 17thColossus, nullkernel: Rename Typed Data classes to support PHP 7
parent 11f55499
......@@ -21,19 +21,19 @@ ignore:
# Basic scalar data types from typed data.
boolean:
label: 'Boolean'
class: '\Drupal\Core\TypedData\Plugin\DataType\Boolean'
class: '\Drupal\Core\TypedData\Plugin\DataType\BooleanData'
email:
label: 'Email'
class: '\Drupal\Core\TypedData\Plugin\DataType\Email'
integer:
label: 'Integer'
class: '\Drupal\Core\TypedData\Plugin\DataType\Integer'
class: '\Drupal\Core\TypedData\Plugin\DataType\IntegerData'
float:
label: 'Float'
class: '\Drupal\Core\TypedData\Plugin\DataType\Float'
class: '\Drupal\Core\TypedData\Plugin\DataType\FloatData'
string:
label: 'String'
class: '\Drupal\Core\TypedData\Plugin\DataType\String'
class: '\Drupal\Core\TypedData\Plugin\DataType\StringData'
uri:
label: 'Uri'
class: '\Drupal\Core\TypedData\Plugin\DataType\Uri'
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\TypedData\Plugin\DataType\Binary.
* Contains \Drupal\Core\TypedData\Plugin\DataType\BinaryData.
*/
namespace Drupal\Core\TypedData\Plugin\DataType;
......@@ -23,7 +23,7 @@
* label = @Translation("Binary")
* )
*/
class Binary extends PrimitiveBase implements BinaryInterface {
class BinaryData extends PrimitiveBase implements BinaryInterface {
/**
* The file resource URI.
......@@ -63,7 +63,7 @@ public function setValue($value, $notify = TRUE) {
}
elseif (is_string($value)) {
// Note: For performance reasons we store the given URI and access the
// resource upon request. See Binary::getValue()
// resource upon request. See BinaryData::getValue()
$this->uri = $value;
$this->handle = NULL;
}
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\TypedData\Plugin\DataType\Boolean.
* Contains \Drupal\Core\TypedData\Plugin\DataType\BooleanData.
*/
namespace Drupal\Core\TypedData\Plugin\DataType;
......@@ -21,7 +21,7 @@
* label = @Translation("Boolean")
* )
*/
class Boolean extends PrimitiveBase implements BooleanInterface {
class BooleanData extends PrimitiveBase implements BooleanInterface {
/**
* {@inheritdoc}
......
......@@ -20,7 +20,7 @@
* label = @Translation("Date")
* )
*/
class DateTimeIso8601 extends String implements DateTimeInterface {
class DateTimeIso8601 extends StringData implements DateTimeInterface {
/**
* {@inheritdoc}
......
......@@ -19,7 +19,7 @@
* label = @Translation("Duration")
* )
*/
class DurationIso8601 extends String implements DurationInterface {
class DurationIso8601 extends StringData implements DurationInterface {
/**
* {@inheritdoc}
......
......@@ -20,6 +20,6 @@
* constraints = {"Email" = {}}
* )
*/
class Email extends String implements StringInterface {
class Email extends StringData implements StringInterface {
}
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\TypedData\Plugin\DataType\Float.
* Contains \Drupal\Core\TypedData\Plugin\DataType\FloatData.
*/
namespace Drupal\Core\TypedData\Plugin\DataType;
......@@ -21,7 +21,7 @@
* label = @Translation("Float")
* )
*/
class Float extends PrimitiveBase implements FloatInterface {
class FloatData extends PrimitiveBase implements FloatInterface {
/**
* {@inheritdoc}
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\TypedData\Plugin\DataType\Integer.
* Contains \Drupal\Core\TypedData\Plugin\DataType\IntegerData.
*/
namespace Drupal\Core\TypedData\Plugin\DataType;
......@@ -21,7 +21,7 @@
* label = @Translation("Integer")
* )
*/
class Integer extends PrimitiveBase implements IntegerInterface {
class IntegerData extends PrimitiveBase implements IntegerInterface {
/**
* {@inheritdoc}
......
......@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\Core\TypedData\Plugin\DataType\String.
* Contains \Drupal\Core\TypedData\Plugin\DataType\StringData.
*/
namespace Drupal\Core\TypedData\Plugin\DataType;
......@@ -21,7 +21,7 @@
* label = @Translation("String")
* )
*/
class String extends PrimitiveBase implements StringInterface {
class StringData extends PrimitiveBase implements StringInterface {
/**
* {@inheritdoc}
......
......@@ -25,7 +25,7 @@
*
* @see \Drupal\Core\TypedData\Type\DurationIso8601
*/
class TimeSpan extends Integer implements DurationInterface {
class TimeSpan extends IntegerData implements DurationInterface {
/**
* {@inheritdoc}
......
......@@ -18,7 +18,7 @@
* label = @Translation("String")
* )
*/
class Timestamp extends Integer implements DateTimeInterface {
class Timestamp extends IntegerData implements DateTimeInterface {
/**
* The data value as a UNIX timestamp.
......
......@@ -21,6 +21,6 @@
* label = @Translation("URI")
* )
*/
class Uri extends String implements UriInterface {
class Uri extends StringData implements UriInterface {
}
......@@ -132,14 +132,14 @@ public function createInstance($data_type, array $configuration = array()) {
*
* @see \Drupal::typedDataManager()
* @see \Drupal\Core\TypedData\TypedDataManager::getPropertyInstance()
* @see \Drupal\Core\TypedData\Plugin\DataType\Integer
* @see \Drupal\Core\TypedData\Plugin\DataType\Float
* @see \Drupal\Core\TypedData\Plugin\DataType\String
* @see \Drupal\Core\TypedData\Plugin\DataType\Boolean
* @see \Drupal\Core\TypedData\Plugin\DataType\Duration
* @see \Drupal\Core\TypedData\Plugin\DataType\BinaryData
* @see \Drupal\Core\TypedData\Plugin\DataType\BooleanData
* @see \Drupal\Core\TypedData\Plugin\DataType\Date
* @see \Drupal\Core\TypedData\Plugin\DataType\Duration
* @see \Drupal\Core\TypedData\Plugin\DataType\FloatData
* @see \Drupal\Core\TypedData\Plugin\DataType\IntegerData
* @see \Drupal\Core\TypedData\Plugin\DataType\StringData
* @see \Drupal\Core\TypedData\Plugin\DataType\Uri
* @see \Drupal\Core\TypedData\Plugin\DataType\Binary
*/
public function create(DataDefinitionInterface $definition, $value = NULL, $name = NULL, $parent = NULL) {
$typed_data = $this->createInstance($definition->getDataType(), array(
......
......@@ -248,7 +248,7 @@ function testSchemaMappingWithParents() {
$expected = array(
'type' => 'config_schema_test.someschema.with_parents.key_1',
'label' => 'Test item nested one level',
'class' => '\Drupal\Core\TypedData\Plugin\DataType\String',
'class' => '\Drupal\Core\TypedData\Plugin\DataType\StringData',
'definition_class' => '\Drupal\Core\TypedData\DataDefinition',
);
$this->assertEqual($definition, $expected);
......@@ -259,7 +259,7 @@ function testSchemaMappingWithParents() {
$expected = array(
'type' => 'config_schema_test.someschema.with_parents.key_2',
'label' => 'Test item nested two levels',
'class' => '\Drupal\Core\TypedData\Plugin\DataType\String',
'class' => '\Drupal\Core\TypedData\Plugin\DataType\StringData',
'definition_class' => '\Drupal\Core\TypedData\DataDefinition',
);
$this->assertEqual($definition, $expected);
......@@ -270,7 +270,7 @@ function testSchemaMappingWithParents() {
$expected = array(
'type' => 'config_schema_test.someschema.with_parents.key_3',
'label' => 'Test item nested three levels',
'class' => '\Drupal\Core\TypedData\Plugin\DataType\String',
'class' => '\Drupal\Core\TypedData\Plugin\DataType\StringData',
'definition_class' => '\Drupal\Core\TypedData\DataDefinition',
);
$this->assertEqual($definition, $expected);
......
......@@ -9,7 +9,7 @@
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\TypedData\OptionsProviderInterface;
use Drupal\Core\TypedData\Plugin\DataType\String;
use Drupal\Core\TypedData\Plugin\DataType\StringData;
/**
* The filter format data type.
......@@ -19,7 +19,7 @@
* label = @Translation("Filter format")
* )
*/
class FilterFormat extends String implements OptionsProviderInterface {
class FilterFormat extends StringData implements OptionsProviderInterface {
/**
* {@inheritdoc}
......
Markdown is supported
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