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