Skip to content

Commit 645f4a7

Browse files
committed
More configuration -> data
1 parent b9d0db4 commit 645f4a7

File tree

6 files changed

+35
-35
lines changed

6 files changed

+35
-35
lines changed

src/Dflydev/DotAccessData/Data.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is a part of dflydev/dot-access-configuration.
4+
* This file is a part of dflydev/dot-access-data.
55
*
66
* (c) Dragonfly Development Inc.
77
*
@@ -14,7 +14,7 @@
1414
class Data implements DataInterface
1515
{
1616
/**
17-
* Internal representation of configuration data
17+
* Internal representation of data data
1818
*
1919
* @var array
2020
*/
@@ -95,9 +95,9 @@ public function import(array $data, $clobber = true)
9595
/**
9696
* {@inheritdoc}
9797
*/
98-
public function importData(DataInterface $configuration, $clobber = true)
98+
public function importData(DataInterface $data, $clobber = true)
9999
{
100-
$this->import($configuration->export(), $clobber);
100+
$this->import($data->export(), $clobber);
101101
}
102102

103103
/**

src/Dflydev/DotAccessData/DataInterface.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is a part of dflydev/dot-access-configuration.
4+
* This file is a part of dflydev/dot-access-data.
55
*
66
* (c) Dragonfly Development Inc.
77
*
@@ -45,31 +45,31 @@ public function remove($key);
4545
public function get($key);
4646

4747
/**
48-
* Get a configuration instance for a key
48+
* Get a data instance for a key
4949
*
5050
* @param string $key
5151
* @return DataInterface
5252
*/
5353
public function getData($key);
5454

5555
/**
56-
* Import data into existing configuration
56+
* Import data into existing data
5757
*
5858
* @param array $data
5959
* @param bool $clobber
6060
*/
6161
public function import(array $data, $clobber = true);
6262

6363
/**
64-
* Import data from an external configuration into existing configuration
64+
* Import data from an external data into existing data
6565
*
66-
* @param DataInterface $configuration
66+
* @param DataInterface $data
6767
* @param bool $clobber
6868
*/
69-
public function importData(DataInterface $configuration, $clobber = true);
69+
public function importData(DataInterface $data, $clobber = true);
7070

7171
/**
72-
* Export configuration as raw data
72+
* Export data as raw data
7373
*
7474
* @return array
7575
*/

src/Dflydev/DotAccessData/Util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is a part of dflydev/dot-access-configuration.
4+
* This file is a part of dflydev/dot-access-data.
55
*
66
* (c) Dragonfly Development Inc.
77
*

tests/Dflydev/Tests/DotAccessData/DataTest.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is a part of dflydev/dot-access-configuration.
4+
* This file is a part of dflydev/dot-access-data.
55
*
66
* (c) Dragonfly Development Inc.
77
*
@@ -33,14 +33,14 @@ protected function getSampleData()
3333
);
3434
}
3535

36-
protected function runSampleDataTests(DataInterface $configuration)
36+
protected function runSampleDataTests(DataInterface $data)
3737
{
38-
$this->assertEquals('A', $configuration->get('a'));
39-
$this->assertEquals('B', $configuration->get('b.b'));
40-
$this->assertEquals(array('C1', 'C2', 'C3'), $configuration->get('b.c'));
41-
$this->assertEquals('D3', $configuration->get('b.d.d3'));
42-
$this->assertEquals(array('c1', 'c2', 'c3'), $configuration->get('c'));
43-
$this->assertEquals(null, $configuration->get('foo'), 'Foo should not exist');
38+
$this->assertEquals('A', $data->get('a'));
39+
$this->assertEquals('B', $data->get('b.b'));
40+
$this->assertEquals(array('C1', 'C2', 'C3'), $data->get('b.c'));
41+
$this->assertEquals('D3', $data->get('b.d.d3'));
42+
$this->assertEquals(array('c1', 'c2', 'c3'), $data->get('c'));
43+
$this->assertEquals(null, $data->get('foo'), 'Foo should not exist');
4444
}
4545

4646
public function testAppend()
@@ -60,9 +60,9 @@ public function testRemote()
6060

6161
public function testGet()
6262
{
63-
$configuration = new Data($this->getSampleData());
63+
$data = new Data($this->getSampleData());
6464

65-
$this->runSampleDataTests($configuration);
65+
$this->runSampleDataTests($data);
6666
}
6767

6868
public function testGetData()
@@ -73,35 +73,35 @@ public function testGetData()
7373
),
7474
));
7575

76-
$configuration = $wrappedData->getData('wrapped.sampleData');
76+
$data = $wrappedData->getData('wrapped.sampleData');
7777

78-
$this->runSampleDataTests($configuration);
78+
$this->runSampleDataTests($data);
7979

8080
$this->setExpectedException('RuntimeException');
8181

82-
$configuration = $wrappedData->getData('wrapped.sampleData.a');
82+
$data = $wrappedData->getData('wrapped.sampleData.a');
8383
}
8484

8585
public function testImport()
8686
{
87-
$configuration = new Data();
88-
$configuration->import($this->getSampleData());
87+
$data = new Data();
88+
$data->import($this->getSampleData());
8989

90-
$this->runSampleDataTests($configuration);
90+
$this->runSampleDataTests($data);
9191
}
9292

9393
public function testImportData()
9494
{
95-
$configuration = new Data();
96-
$configuration->importData(new Data($this->getSampleData()));
95+
$data = new Data();
96+
$data->importData(new Data($this->getSampleData()));
9797

98-
$this->runSampleDataTests($configuration);
98+
$this->runSampleDataTests($data);
9999
}
100100

101101
public function testExport()
102102
{
103-
$configuration = new Data($this->getSampleData());
103+
$data = new Data($this->getSampleData());
104104

105-
$this->assertEquals($this->getSampleData(), $configuration->export());
105+
$this->assertEquals($this->getSampleData(), $data->export());
106106
}
107107
}

tests/Dflydev/Tests/DotAccessData/UtilTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is a part of dflydev/dot-access-configuration.
4+
* This file is a part of dflydev/dot-access-data.
55
*
66
* (c) Dragonfly Development Inc.
77
*

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is a part of dflydev/dot-access-configuration.
4+
* This file is a part of dflydev/dot-access-data.
55
*
66
* (c) Dragonfly Development Inc.
77
*

0 commit comments

Comments
 (0)