Skip to content

Commit 34790ba

Browse files
author
e1himself
committed
Rewrite sfDoctrinePlugin create_function code to lambda functions
Thanks to @j0k3r
1 parent f2ebd7d commit 34790ba

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineDeleteModelFilesTask.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function execute($arguments = array(), $options = array())
7676
{
7777
if (!$options['no-confirmation'] && !$this->askConfirmation(array_merge(
7878
array('The following '.$modelName.' files will be deleted:', ''),
79-
array_map(create_function('$v', 'return \' - \'.sfDebug::shortenFilePath($v);'), $files),
79+
array_map(function($v) { return ' - '.sfDebug::shortenFilePath($v); }, $files),
8080
array('', 'Continue? (y/N)')
8181
), 'QUESTION_LARGE', false))
8282
{
@@ -100,10 +100,10 @@ protected function execute($arguments = array(), $options = array())
100100

101101
/**
102102
* Converts an array of values to a regular expression pattern fragment.
103-
*
103+
*
104104
* @param array $values An array of values for the pattern
105105
* @param string $delimiter The regular expression delimiter
106-
*
106+
*
107107
* @return string A regular expression fragment
108108
*/
109109
protected function valuesToRegex($values, $delimiter = '/')

lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineDropDbTask.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected function execute($arguments = array(), $options = array())
7373
&&
7474
!$this->askConfirmation(array_merge(
7575
array(sprintf('This command will remove all data in the following "%s" connection(s):', $environment), ''),
76-
array_map(create_function('$v', 'return \' - \'.$v;'), array_keys($databases)),
76+
array_map(function($v) { return ' - '.$v; }, array_keys($databases)),
7777
array('', 'Are you sure you want to proceed? (y/N)')
7878
), 'QUESTION_LARGE', false)
7979
)

lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineMigrateTask.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ protected function execute($arguments = array(), $options = array())
137137
{
138138
$this->logBlock(array_merge(
139139
array('The following errors occurred:', ''),
140-
array_map(create_function('$e', 'return \' - \'.$e->getMessage();'), $migration->getErrors())
140+
array_map(function($e) { return ' - '.$e->getMessage(); }, $migration->getErrors())
141141
), 'ERROR_LARGE');
142142
}
143143

0 commit comments

Comments
 (0)