8000 renamed load to parse, that's more specific. · Basster/symfony@43b2c2f · GitHub
[go: up one dir, main page]

Skip to content

Commit 43b2c2f

Browse files
committed
renamed load to parse, that's more specific.
1 parent 450348a commit 43b2c2f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Symfony/Component/Config/Tests/Util/XmlUtilsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ public function testLoadFile()
6262
$this->assertSame(array(), libxml_get_errors());
6363
}
6464

65-
public function testLoad()
65+
public function testParse()
6666
{
6767
$fixtures = __DIR__.'/../Fixtures/Util/';
6868

6969
$mock = $this->getMockBuilder(__NAMESPACE__.'\Validator')->getMock();
7070
$mock->expects($this->once())->method('validate')->will($this->onConsecutiveCalls(false, true));
7171

7272
try {
73-
XmlUtils::load(file_get_contents($fixtures.'valid.xml'), array($mock, 'validate'));
73+
XmlUtils::parse(file_get_contents($fixtures.'valid.xml'), array($mock, 'validate'));
7474
$this->fail();
7575
} catch (\InvalidArgumentException $e) {
7676
$this->assertContains('The XML is not valid', $e->getMessage());

src/Symfony/Component/Config/Util/XmlUtils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private function __construct()
4141
*
4242
* @throws \InvalidArgumentException When loading of XML file returns error
4343
*/
44-
public static function load($content, $schemaOrCallable = null)
44+
public static function parse($content, $schemaOrCallable = null)
4545
{
4646
$internalErrors = libxml_use_internal_errors(true);
4747
$disableEntities = libxml_disable_entity_loader(true);
@@ -119,7 +119,7 @@ public static function loadFile($file, $schemaOrCallable = null)
119119
}
120120

121121
try {
122-
return static::load($content, $schemaOrCallable);
122+
return static::parse($content, $schemaOrCallable);
123123
} catch (\InvalidArgumentException $ex) {
124124
throw new \InvalidArgumentException(
125125
str_replace(self::XML_IS_NOT_VALID_MESSAGE, sprintf('The XML file "%s" is not valid.', $file), $ex->getMessage()),

0 commit comments

Comments
 (0)
0