Skip to content

Commit

Permalink
Fix typo in method name and interface.
Browse files Browse the repository at this point in the history
This is a clear mistake that was replicated into multiple places as the
code worked before.
  • Loading branch information
markstory committed Aug 22, 2016
1 parent 0ac7ed9 commit 5803eef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/ORM/Behavior/TranslateBehavior.php
Expand Up @@ -335,7 +335,7 @@ public function afterSave(Event $event, EntityInterface $entity)
*
* {@inheritDoc}
*/
public function buildMarhshalMap($marshaller, $map, $options)
public function buildMarshalMap($marshaller, $map, $options)

This comment has been minimized.

Copy link
@dereuromark

dereuromark Aug 22, 2016

Member

Do we need to deprecate the old one and forward that for BC?

This comment has been minimized.

Copy link
@markstory

markstory Aug 22, 2016

Author Member

No, people who would have implemented this will probably understand.

{
if (isset($options['translations']) && !$options['translations']) {
return [];
Expand Down
2 changes: 1 addition & 1 deletion src/ORM/Marshaller.php
Expand Up @@ -122,7 +122,7 @@ protected function _buildPropertyMap($data, $options)
foreach ($behaviors->loaded() as $name) {
$behavior = $behaviors->get($name);
if ($behavior instanceof PropertyMarshalInterface) {
$map += $behavior->buildMarhshalMap($this, $map, $options);
$map += $behavior->buildMarshalMap($this, $map, $options);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ORM/PropertyMarshalInterface.php
Expand Up @@ -30,5 +30,5 @@ interface PropertyMarshalInterface
* @param array $options The options array used in the marshalling call.
* @return array A map of `[property => callable]` of additional properties to marshal.
*/
public function buildMarhshalMap($marshaller, $map, $options);
public function buildMarshalMap($marshaller, $map, $options);
}
16 changes: 8 additions & 8 deletions tests/TestCase/ORM/Behavior/TranslateBehaviorTest.php
Expand Up @@ -1198,7 +1198,7 @@ public function testBuildMarshalMapTranslationsOff()

$marshaller = $table->marshaller();
$translate = $table->behaviors()->get('Translate');
$result = $translate->buildMarhshalMap($marshaller, [], ['translations' => false]);
$result = $translate->buildMarshalMap($marshaller, [], ['translations' => false]);
$this->assertSame([], $result);
}

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

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

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

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

$map = $translate->buildMarhshalMap($table->marshaller(), [], []);
$map = $translate->buildMarshalMap($table->marshaller(), [], []);
$entity = $table->newEntity();
$data = [
'en' => [
Expand Down Expand Up @@ -1291,7 +1291,7 @@ public function testBuildMarshalMapBuildEntitiesValidationErrors()
$translate = $table->behaviors()->get('Translate');

$entity = $table->newEntity();
$map = $translate->buildMarhshalMap($table->marshaller(), [], []);
$map = $translate->buildMarshalMap($table->marshaller(), [], []);
$data = [
'en' => [
'title' => 'English Title',
Expand Down Expand Up @@ -1335,7 +1335,7 @@ public function testBuildMarshalMapUpdateExistingEntities()
'es' => $es,
'en' => $en,
]);
$map = $translate->buildMarhshalMap($table->marshaller(), [], []);
$map = $translate->buildMarshalMap($table->marshaller(), [], []);
$data = [
'en' => [
'title' => 'English Title',
Expand Down Expand Up @@ -1380,7 +1380,7 @@ public function testBuildMarshalMapUpdateEntitiesValidationErrors()
'es' => $es,
'en' => $en,
]);
$map = $translate->buildMarhshalMap($table->marshaller(), [], []);
$map = $translate->buildMarshalMap($table->marshaller(), [], []);
$data = [
'en' => [
'title' => 'English Title',
Expand Down

0 comments on commit 5803eef

Please sign in to comment.