Skip to content

Commit

Permalink
MINOR: Updated inline phpdoc while investigating trac/4113
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell Michell authored and Stig Lindqvist committed May 18, 2012
1 parent f01ca80 commit 88a222f
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions i18n/i18nTextCollector.php
Expand Up @@ -152,9 +152,12 @@ public function run($restrictToModules = null) {
} }


/** /**
* Build the module's master string table * Builds a master string table from php and .ss template files for the module passed as the $module param
* @see {@link collectFromCode} and {@link collectFromTemplate}
* *
* @param string $module Module's name or 'themes' * @param string $module A module's name or just 'themes'
* @return array $entities An array of entities found in the files that comprise the module
* @todo Why the type juggling for $this->collectFromBlah()? They always return arrays.
*/ */
protected function processModule($module) { protected function processModule($module) {
$entities = array(); $entities = array();
Expand Down Expand Up @@ -194,6 +197,13 @@ protected function processModule($module) {
return $entities; return $entities;
} }


/**
* Extracts translatables from .php files.
*
* @param string $content The text content of a parsed template-file
* @param string $module Module's name or 'themes'
* @return array $entities An array of entities representing the extracted translation function calls in code
*/
public function collectFromCode($content, $module) { public function collectFromCode($content, $module) {
$entities = array(); $entities = array();


Expand Down Expand Up @@ -267,6 +277,16 @@ public function collectFromCode($content, $module) {
return $entities; return $entities;
} }


/**
* Extracts translatables from .ss templates (Self referencing)
*
* @param string $content The text content of a parsed template-file
* @param string $module Module's name or 'themes'
* @param string $fileName The name of a template file when method is used in self-referencing mode
* @return array $entities An array of entities representing the extracted template function calls
*
* @todo Why the type juggling for $this->collectFromTemplate()? It always returns an array.
*/
public function collectFromTemplate($content, $fileName, $module) { public function collectFromTemplate($content, $fileName, $module) {
$entities = array(); $entities = array();


Expand Down Expand Up @@ -330,9 +350,11 @@ function collectFromEntityProviders($filePath) {
} }


/** /**
* @param String $fullName * Normalizes enitities with namespaces.
* @param String $_namespace *
* @return String|FALSE * @param string $fullName
* @param string $_namespace
* @return string|boolean FALSE
*/ */
protected function normalizeEntity($fullName, $_namespace = null) { protected function normalizeEntity($fullName, $_namespace = null) {
// split fullname into entity parts // split fullname into entity parts
Expand Down Expand Up @@ -360,11 +382,12 @@ protected function normalizeEntity($fullName, $_namespace = null) {




/** /**
* Helper function that searches for potential files to be parsed * Helper function that searches for potential files (templates and code) to be parsed
* *
* @param string $folder base directory to scan (will scan recursively) * @param string $folder base directory to scan (will scan recursively)
* @param array $fileList Array where potential files will be added to * @param array $fileList Array to which potential files will be appended
* @param String $type Optional, "php" or "ss" * @param string $type Optional, "php" or "ss"
* @return array $fileList An array of files
*/ */
protected function getFilesRecursive($folder, &$fileList = null, $type = null) { protected function getFilesRecursive($folder, &$fileList = null, $type = null) {
if(!$fileList) $fileList = array(); if(!$fileList) $fileList = array();
Expand Down

0 comments on commit 88a222f

Please sign in to comment.