Skip to content

Commit 5803eef

Browse files
committed
Fix typo in method name and interface.
This is a clear mistake that was replicated into multiple places as the code worked before.
1 parent 0ac7ed9 commit 5803eef

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/ORM/Behavior/TranslateBehavior.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public function afterSave(Event $event, EntityInterface $entity)
335335
*
336336
* {@inheritDoc}
337337
*/
338-
public function buildMarhshalMap($marshaller, $map, $options)
338+
public function buildMarshalMap($marshaller, $map, $options)
339339
{
340340
if (isset($options['translations']) && !$options['translations']) {
341341
return [];

src/ORM/Marshaller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected function _buildPropertyMap($data, $options)
122122
foreach ($behaviors->loaded() as $name) {
123123
$behavior = $behaviors->get($name);
124124
if ($behavior instanceof PropertyMarshalInterface) {
125-
$map += $behavior->buildMarhshalMap($this, $map, $options);
125+
$map += $behavior->buildMarshalMap($this, $map, $options);
126126
}
127127
}
128128

src/ORM/PropertyMarshalInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ interface PropertyMarshalInterface
3030
* @param array $options The options array used in the marshalling call.
3131
* @return array A map of `[property => callable]` of additional properties to marshal.
3232
*/
33-
public function buildMarhshalMap($marshaller, $map, $options);
33+
public function buildMarshalMap($marshaller, $map, $options);
3434
}

tests/TestCase/ORM/Behavior/TranslateBehaviorTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ public function testBuildMarshalMapTranslationsOff()
11981198

11991199
$marshaller = $table->marshaller();
12001200
$translate = $table->behaviors()->get('Translate');
1201-
$result = $translate->buildMarhshalMap($marshaller, [], ['translations' => false]);
1201+
$result = $translate->buildMarshalMap($marshaller, [], ['translations' => false]);
12021202
$this->assertSame([], $result);
12031203
}
12041204

@@ -1214,11 +1214,11 @@ public function testBuildMarshalMapTranslationsOn()
12141214
$marshaller = $table->marshaller();
12151215
$translate = $table->behaviors()->get('Translate');
12161216

1217-
$result = $translate->buildMarhshalMap($marshaller, [], ['translations' => true]);
1217+
$result = $translate->buildMarshalMap($marshaller, [], ['translations' => true]);
12181218
$this->assertArrayHasKey('_translations', $result);
12191219
$this->assertInstanceOf('Closure', $result['_translations']);
12201220

1221-
$result = $translate->buildMarhshalMap($marshaller, [], []);
1221+
$result = $translate->buildMarshalMap($marshaller, [], []);
12221222
$this->assertArrayHasKey('_translations', $result);
12231223
$this->assertInstanceOf('Closure', $result['_translations']);
12241224
}
@@ -1234,7 +1234,7 @@ public function testBuildMarshalMapNonArrayData()
12341234
$table->addBehavior('Translate', ['fields' => ['title', 'body']]);
12351235
$translate = $table->behaviors()->get('Translate');
12361236

1237-
$map = $translate->buildMarhshalMap($table->marshaller(), [], []);
1237+
$map = $translate->buildMarshalMap($table->marshaller(), [], []);
12381238
$entity = $table->newEntity();
12391239
$result = $map['_translations']('garbage', $entity);
12401240
$this->assertNull($result, 'Non-array should not error out.');
@@ -1253,7 +1253,7 @@ public function testBuildMarshalMapBuildEntities()
12531253
$table->addBehavior('Translate', ['fields' => ['title', 'body']]);
12541254
$translate = $table->behaviors()->get('Translate');
12551255

1256-
$map = $translate->buildMarhshalMap($table->marshaller(), [], []);
1256+
$map = $translate->buildMarshalMap($table->marshaller(), [], []);
12571257
$entity = $table->newEntity();
12581258
$data = [
12591259
'en' => [
@@ -1291,7 +1291,7 @@ public function testBuildMarshalMapBuildEntitiesValidationErrors()
12911291
$translate = $table->behaviors()->get('Translate');
12921292

12931293
$entity = $table->newEntity();
1294-
$map = $translate->buildMarhshalMap($table->marshaller(), [], []);
1294+
$map = $translate->buildMarshalMap($table->marshaller(), [], []);
12951295
$data = [
12961296
'en' => [
12971297
'title' => 'English Title',
@@ -1335,7 +1335,7 @@ public function testBuildMarshalMapUpdateExistingEntities()
13351335
'es' => $es,
13361336
'en' => $en,
13371337
]);
1338-
$map = $translate->buildMarhshalMap($table->marshaller(), [], []);
1338+
$map = $translate->buildMarshalMap($table->marshaller(), [], []);
13391339
$data = [
13401340
'en' => [
13411341
'title' => 'English Title',
@@ -1380,7 +1380,7 @@ public function testBuildMarshalMapUpdateEntitiesValidationErrors()
13801380
'es' => $es,
13811381
'en' => $en,
13821382
]);
1383-
$map = $translate->buildMarhshalMap($table->marshaller(), [], []);
1383+
$map = $translate->buildMarshalMap($table->marshaller(), [], []);
13841384
$data = [
13851385
'en' => [
13861386
'title' => 'English Title',

0 commit comments

Comments
 (0)