From 04dd14f3b51d4c76ce1587c005ce7a49c1f9a274 Mon Sep 17 00:00:00 2001 From: Nikolay Bachiyski Date: Sat, 26 Oct 2013 00:54:27 +0000 Subject: [PATCH] Extract: rename method `extract_entries` to `extract_from_code` The other extract methods are named `extract_from_`, this was te only one, which wasn't. Also, it was returning an instance of `Translations`, not an array of entries, which the name suggested. git-svn-id: https://develop.svn.wordpress.org/trunk@25920 602fd350-edb4-49c9-b593-d223f7449a82 --- tools/i18n/extract.php | 4 ++-- tools/i18n/t/ExtractTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/i18n/extract.php b/tools/i18n/extract.php index edd274fb46..f819f0a4fc 100644 --- a/tools/i18n/extract.php +++ b/tools/i18n/extract.php @@ -40,7 +40,7 @@ class StringExtractor { function extract_from_file( $file_name, $prefix ) { $code = file_get_contents( $file_name ); - return $this->extract_entries( $code, $prefix . $file_name ); + return $this->extract_from_code( $code, $prefix . $file_name ); } function does_file_name_match( $path, $excludes, $includes ) { @@ -126,7 +126,7 @@ class StringExtractor { return $entry; } - function extract_entries( $code, $file_name ) { + function extract_from_code( $code, $file_name ) { $translations = new Translations; $function_calls = $this->find_function_calls( array_keys( $this->rules ), $code ); foreach( $function_calls as $call ) { diff --git a/tools/i18n/t/ExtractTest.php b/tools/i18n/t/ExtractTest.php index c1deea35c0..32f62797e0 100644 --- a/tools/i18n/t/ExtractTest.php +++ b/tools/i18n/t/ExtractTest.php @@ -13,7 +13,7 @@ class ExtractTest extends PHPUnit_Framework_TestCase { function test_with_just_a_string() { $expected = new Translation_Entry( array( 'singular' => 'baba', 'references' => array('baba.php:1') ) ); - $result = $this->extractor->extract_entries('', 'baba.php' ); + $result = $this->extractor->extract_from_code('', 'baba.php' ); $this->assertEquals( $expected, $result->entries['baba'] ); }