100+ results for 'php array_map'

Not the results you expected?

ProxyBuilderTest.php (https://gitlab.com/geeta7/drupal) PHP · 445 lines

1 <?php

2

3 /**

342 EOS;

343

344 $expected_methods_body = implode("\n", array_map(function ($value) {

345 if ($value === '') {

346 return $value;

Relation.php (https://gitlab.com/puntodos/ean-landings) PHP · 349 lines

1 <?php

2

3 namespace Illuminate\Database\Eloquent\Relations;

186 protected function getKeys(array $models, $key = null)

187 {

188 return array_unique(array_values(array_map(function ($value) use ($key) {

189 return $key ? $value->getAttribute($key) : $value->getKey();

190

313 }

314

315 $tables = array_map(function ($model) {

316 return (new $model)->getTable();

317 }, $models);

Relation.php (https://gitlab.com/gideonmarked/PLCPortal) PHP · 348 lines

1 <?php

2

3 namespace Illuminate\Database\Eloquent\Relations;

186 protected function getKeys(array $models, $key = null)

187 {

188 return array_unique(array_values(array_map(function ($value) use ($key) {

189 return $key ? $value->getAttribute($key) : $value->getKey();

190 }, $models)));

312 }

313

314 $tables = array_map(function ($model) {

315 return (new $model)->getTable();

316 }, $models);

ParameterBag.php (https://github.com/gimler/symfony.git) PHP · 289 lines

1 <?php

2

3 /*

84 $nonNestedAlternative = null;

85 if (!\count($alternatives) && false !== strpos($name, '.')) {

86 $namePartsLength = array_map('strlen', explode('.', $name));

87 $key = substr($name, 0, -1 * (1 + array_pop($namePartsLength)));

88 while (\count($namePartsLength)) {

ProxyBuilderTest.php (git://github.com/drupal/drupal.git) PHP · 445 lines

1 <?php

2

3 /**

9

10 use Drupal\Component\ProxyBuilder\ProxyBuilder;

11 use PHPUnit\Framework\TestCase;

12

13 /**

342 EOS;

343

344 $expected_methods_body = implode("\n", array_map(function ($value) {

345 if ($value === '') {

346 return $value;

class-cp-user-relationships.php (https://gitlab.com/dev73/clusterpress) PHP · 543 lines

1 <?php

2 /**

3 * ClusterPress User Relationships.

322

323 } else {

324 $in = array_map( 'esc_sql', $in );

325 $in = '"' . join( '","', $in ) . '"';

326 return "{$field_name} IN ({$in})";

Drawer.php (https://gitlab.com/wuhang2003/rainloop-webmail) PHP · 356 lines

1 <?php

2

3 /*

23

24 /**

25 * Drawer implementation using the Gmagick PHP extension

26 */

27 final class Drawer implements DrawerInterface

263 }

264

265 $points = array_map(function (PointInterface $p) {

266 return array('x' => $p->getX(), 'y' => $p->getY());

267 }, $coordinates);

303 $text->setfont($font->getFile());

304 /**

305 * @see http://www.php.net/manual/en/imagick.queryfontmetrics.php#101027

306 *

307 * ensure font resolution is the same as GD's hard-coded 96

Collection.php (https://gitlab.com/koodersmiikka/operaatio-terveys) PHP · 717 lines

1 <?php namespace Illuminate\Support;

2

3 use Closure;

91 public function each(Closure $callback)

92 {

93 array_map($callback, $this->items);

94

95 return $this;

271 public function map(Closure $callback)

272 {

273 return new static(array_map($callback, $this->items, array_keys($this->items)));

274 }

275

537 public function transform(Closure $callback)

538 {

539 $this->items = array_map($callback, $this->items);

540

541 return $this;

Matrix.php (https://gitlab.com/unofficial-mirrors/moodle) PHP · 374 lines

1 <?php

2

3 declare(strict_types=1);

4

5 namespace Phpml\Math;

6

7 use Phpml\Math\LinearAlgebra\LUDecomposition;

8 use Phpml\Exception\InvalidArgumentException;

9 use Phpml\Exception\MatrixException;

158 {

159 if ($this->rows == 1) {

160 $matrix = array_map(function ($el) {

161 return [$el];

162 }, $this->matrix[0]);

class-wc-order-item-shipping.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 319 lines

1 <?php

2 /**

3 * Order Line Item (shipping)

137 );

138 if ( isset( $raw_tax_data['total'] ) ) {

139 $tax_data['total'] = array_map( 'wc_format_decimal', $raw_tax_data['total'] );

140 } elseif ( ! empty( $raw_tax_data ) && is_array( $raw_tax_data ) ) {

141 // Older versions just used an array.

142 $tax_data['total'] = array_map( 'wc_format_decimal', $raw_tax_data );

143 }

144 $this->set_prop( 'taxes', $tax_data );

147 $this->set_total_tax( array_sum( $tax_data['total'] ) );

148 } else {

149 $this->set_total_tax( array_sum( array_map( 'wc_round_tax_total', $tax_data['total'] ) ) );

150 }

151 }

author.php (https://github.com/sbourget/moodle.git) PHP · 222 lines

1 <?php

2 // This file is part of Moodle - http://moodle.org/

3 //

32 use renderer_base;

33

34 require_once($CFG->dirroot . '/mod/forum/lib.php');

35

36 /**

163 ];

164 } else {

165 $groups = array_map(function($group) use ($urlfactory, $context, $output) {

166 $groupurl = null;

167 $imageurl = get_group_picture_url($group, $group->courseid, true);

Writer.php (https://gitlab.com/billyprice1/app-download.org) PHP · 317 lines

1 <?php

2

3 namespace DrSlump\Protobuf\Codec\Binary;

16 public function __construct()

17 {

18 $this->_fd = fopen('php://memory', 'wb');

19 }

20

86 }

87 } else if (function_exists('gmp_init')) {

88 $value = PHP_INT_SIZE < 8

89 ? gmp_and($value, '0x0ffffffffffffffff')

90 : sprintf('%u', $value);

91

92 $values = $this->varint_gmp($value);

93 } else if (PHP_INT_SIZE < 8) {

94 throw new \OutOfBoundsException(

95 "PHP versions compiled with 32bit integers can only support negative integer encoding with GMP extension ($value was given)"

mysql.php (https://bitbucket.org/Maron1/taqman.git) PHP · 421 lines

1 <?php namespace Laravel\Database\Schema\Grammars;

2

3 use Laravel\Fluent;

51 // front of each definition, then we'll concatenate the definitions

52 // using commas like normal and generate the SQL.

53 $columns = implode(', ', array_map(function($column)

54 {

55 return 'ADD '.$column;

234 public function drop_column(Table $table, Fluent $command)

235 {

236 $columns = array_map(array($this, 'wrap'), $command->columns);

237

238 // Once we the array of column names, we need to add "drop" to the front

239 // of each column, then we'll concatenate the columns using commas and

240 // generate the alter statement SQL.

241 $columns = implode(', ', array_map(function($column)

242 {

243 return 'DROP '.$column;

Parser.php (https://github.com/markn86/moodle.git) PHP · 317 lines

1 <?php

2

3 /*

4 * This file is part of Mustache.php.

5 *

6 * (c) 2010-2017 Justin Hileman

290 private function getNameAndFilters($name)

291 {

292 $filters = array_map('trim', explode('|', $name));

293 $name = array_shift($filters);

294

Dispatcher.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 409 lines

1 <?php

2

3 namespace Illuminate\Bus;

129

130 if ($constructor = $reflection->getConstructor()) {

131 $injected = array_map(function ($parameter) use ($command, $source, $extras) {

132 return $this->getParameterValueForCommand($command, $source, $parameter, $extras);

133 }, $constructor->getParameters());

DeleteComment.php (https://gitlab.com/Blueprint-Marketing/wordpress-unit-tests) PHP · 355 lines

1 <?php

2

3 /**

4 * Admin ajax functions to be tested

5 */

6 require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );

7

8 /**

29 $post_id = $this->factory->post->create();

30 $this->_comments = $this->factory->comment->create_post_comments( $post_id, 15 );

31 $this->_comments = array_map( 'get_comment', $this->_comments );

32 }

33

70 $_POST['_per_page'] = 100;

71 $_POST['_page'] = 1;

72 $_POST['_url'] = admin_url( 'edit-comments.php' );

73

74 // Make the request

MockWrapper.php (https://github.com/georgeredinger/openinviter.git) PHP · 453 lines

1 <?php

2 /**

3 * Holds the classes needed to amend PHPUnit's awkward memory-hogging behaviour,

11 * like other mock objects are all around?

12 *

13 * PHP version: 5.2

14 *

15 * @category File

28

29 /**

30 * This class is used to wrap a PHPUnit_Framework_MockObject_InvocationMocker

31 * instance to provide a way to inject wrapped instances of

32 * PHPUnit_Framework_MockObject_Matcher_Invocation to it.

46 */

47 class InvocationMockerWrapper

48 implements PHPUnit_Framework_MockObject_Stub_MatcherCollection

49 {

50

Migrator.php (https://bitbucket.org/helfreire/tccsite.git) PHP · 383 lines

1 <?php namespace Illuminate\Database\Migrations;

2

3 use Closure;

217 public function getMigrationFiles($path)

218 {

219 $files = $this->files->glob($path.'/*_*.php');

220

221 // Once we have the array of files in the directory we will just remove the

224 if ($files === false) return array();

225

226 $files = array_map(function($file)

227 {

228 return str_replace('.php', '', basename($file));

246 public function requireFiles($path, array $files)

247 {

248 foreach ($files as $file) $this->files->requireOnce($path.'/'.$file.'.php');

249 }

250

YamlFileLoader.php (https://github.com/proclamo/txinbometro.git) PHP · 325 lines

1 <?php

2

3 /*

257

258 if (!$this->container->hasExtension($namespace)) {

259 $extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getAlias(); }, $this->container->getExtensions()));

260 throw new \InvalidArgumentException(sprintf(

261 'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s',

280 {

281 if (is_array($value)) {

282 $value = array_map(array($this, 'resolveServices'), $value);

283 } else if (is_string($value) && 0 === strpos($value, '@')) {

284 if (0 === strpos($value, '@?')) {

DataFacade.php (https://github.com/danielvaleradp/--ngara.git) PHP · 228 lines

1 <?php

2 class DataFacade {

3 protected static function dolar($i) { return '$' . $i; }

61 $query =

62 'INSERT INTO "Fantasy"."' . $en . '" (' .

63 join(', ', array_map('self::quote', $fn)) .

64 ') VALUES (' .

65 join(', ', array_map('self::dolar', $fr)) .

81

82 $query =

83 'SELECT ' . join(', ', array_map('self::quote', $ef)) .

84 ' FROM "Fantasy"."' . $en . '"';

85

112 $pq = 'SELECT ' . $en;

113

114 $data = array_map(

115 function ($i) use (&$entity) { return $entity->get($i); },

116 $pk

Builder.php (https://gitlab.com/jjpa2018/dashboard) PHP · 433 lines

1 <?php

2

3 namespace Illuminate\Database\Schema;

147 {

148 return in_array(

149 strtolower($column), array_map('strtolower', $this->getColumnListing($table))

150 );

151 }

160 public function hasColumns($table, array $columns)

161 {

162 $tableColumns = array_map('strtolower', $this->getColumnListing($table));

163

164 foreach ($columns as $column) {

YamlFileLoader.php (https://bitbucket.org/cryofrost/portal.git) PHP · 339 lines

1 <?php

2

3 /*

269

270 if (!$this->container->hasExtension($namespace)) {

271 $extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getAlias(); }, $this->container->getExtensions()));

272 throw new \InvalidArgumentException(sprintf(

273 'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s',

293 {

294 if (is_array($value)) {

295 $value = array_map(array($this, 'resolveServices'), $value);

296 } elseif (is_string($value) && 0 === strpos($value, '@')) {

297 if (0 === strpos($value, '@?')) {

ProcessBuilder.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 287 lines

1 <?php

2

3 /*

268

269 $arguments = array_merge($this->prefix, $this->arguments);

270 $script = implode(' ', array_map(array(__NAMESPACE__.'\\ProcessUtils', 'escapeArgument'), $arguments));

271

272 if ($this->inheritEnv) {

admin_snippets_edit.php (https://github.com/Sweil/Frogsystem-2.git) PHP · 326 lines

1 <?php if (!defined('ACP_GO')) die('Unauthorized access!');

2

3 /////////////////////////////

46

47 // Security-Functions

48 $_POST['snippet_id'] = array_map ( 'intval', explode ( ',', $_POST['snippet_id'] ) );

49

50 // SQL-Delete-Query

72 {

73 // Security Function

74 $_POST['snippet_id'] = array_map ( 'intval', $_POST['snippet_id'] );

75

76 ///////////////////////////

foreign.inc.php (https://gitlab.com/Blueprint-Marketing/interoccupy.net) PHP · 78 lines

13 query_redirect("ALTER TABLE " . table($TABLE)

14 . ($_GET["name"] != "" ? "\nDROP " . ($jush == "sql" ? "FOREIGN KEY " : "CONSTRAINT ") . idf_escape($_GET["name"]) . "," : "")

15 . "\nADD FOREIGN KEY (" . implode(", ", array_map('idf_escape', $source)) . ") REFERENCES " . table($_POST["table"]) . " (" . implode(", ", array_map('idf_escape', $target)) . ")" //! reuse $_GET["name"] - check in older MySQL versions

16 . (ereg("^($on_actions)\$", $_POST["on_delete"]) ? " ON DELETE $_POST[on_delete]" : "")

17 . (ereg("^($on_actions)\$", $_POST["on_update"]) ? " ON UPDATE $_POST[on_update]" : "")

56 <noscript><p><input type="submit" name="change" value="<?php echo lang('Change'); ?>"></noscript>

57 <table cellspacing="0">

58 <thead><tr><th><?php echo lang('Source'); ?><th><?php echo lang('Target'); ?></thead>

59 <?php

70 <?php echo lang('ON DELETE'); ?>: <?php echo html_select("on_delete", array(-1 => "") + explode("|", $on_actions), $row["on_delete"]); ?>

71 <?php echo lang('ON UPDATE'); ?>: <?php echo html_select("on_update", array(-1 => "") + explode("|", $on_actions), $row["on_update"]); ?>

72 <p>

73 <input type="submit" value="<?php echo lang('Save'); ?>">

75 <?php } ?>

76 <?php if ($_GET["name"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>

77 <input type="hidden" name="token" value="<?php echo $token; ?>">

function.html_options.php (https://github.com/MyITCRM/myitcrm1.git) PHP · 121 lines

1 <?php

2 /**

3 * Smarty plugin

20 * Purpose: Prints the list of <option> tags generated from

21 * the passed parameters

22 * @link http://smarty.php.net/manual/en/language.function.html.options.php {html_image}

23 * (Smarty online manual)

24 * @param array

55

56 case 'selected':

57 $$_key = array_map('strval', array_values((array)$_val));

58 break;

59

HandlerFilterPermissionTest.php (https://gitlab.com/mohamed_hussein/prodt) PHP · 115 lines

1 <?php

2

3 namespace Drupal\Tests\user\Kernel\Views;

105 }

106 foreach (['system' => 'System', 'user' => 'User'] as $module => $title) {

107 $expected = array_map(function ($permission) {

108 return Html::escape(strip_tags($permission['title']));

109 }, $permission_by_module[$module]);

widget-layered_nav_filters.php (https://github.com/markjaquith/woocommerce.git) PHP · 109 lines

1 <?php

2 /**

3 * Layered Navigation Fitlers Widget

80 $taxonomy_filter = str_replace( 'pa_', '', $taxonomy );

81 $current_filter = ! empty( $_GET[ 'filter_' . $taxonomy_filter ] ) ? $_GET[ 'filter_' . $taxonomy_filter ] : '';

82 $new_filter = array_map( 'absint', explode( ',', $current_filter ) );

83 $new_filter = array_diff( $new_filter, array( $term_id ) );

84

Processes.php (https://github.com/livinglab/openlab.git) PHP · 278 lines

1 <?php

2

3 /**

88 $this->handler_actions = array_combine(

89 $handlers,

90 array_map( [ $this, 'get_handler_action' ], $handlers )

91 );

92 }

128 $all_queues_actions = array_combine(

129 $queues,

130 array_map( [ $this, 'get_queue_action' ], $queues )

131 );

132 }

repository.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 303 lines

1 <?php

2 namespace Elementor\Core\App\Modules\KitLibrary\Data;

3

100 ->only( static::TAXONOMIES_KEYS )

101 ->reduce( function ( Collection $carry, $taxonomies, $type ) {

102 return $carry->merge( array_map( function ( $taxonomy ) use ( $type ) {

103 return [

104 'text' => $taxonomy->name,

259 $manifest_content = ( new Collection( (array) $manifest->content ) )

260 ->reduce( function ( $carry, $content, $type ) {

261 $mapped_documents = array_map( function ( $document ) use ( $type ) {

262 // TODO: Fix it!

263 // Hack to override a bug when a document with type of 'wp-page' is declared as 'wp-post'.

LDA.php (https://github.com/markn86/moodle.git) PHP · 223 lines

1 <?php

2

3 declare(strict_types=1);

4

5 namespace Phpml\DimensionReduction;

6

7 use Phpml\Exception\InvalidArgumentException;

8 use Phpml\Exception\InvalidOperationException;

9 use Phpml\Math\Matrix;

161 return $el / $numElements;

162 };

163 $this->overallMean = array_map($map, $overallMean);

164 $this->counts = $counts;

165

class-workflow.php (https://github.com/humanmade/Workflows.git) PHP · 422 lines

1 <?php

2 /**

3 * Workflow class

196 'subject' => $subject,

197 'text' => $text,

198 'actions' => array_map( function ( $action ) {

199 return wp_parse_args( $action, [

200 'text' => null,

SimpleHeaderSet.php (https://github.com/exponentcms/exponent-cms.git) PHP · 399 lines

1 <?php

2

3 /*

270 public function defineOrdering(array $sequence)

271 {

272 $this->order = array_flip(array_map('strtolower', $sequence));

273 }

274

280 public function setAlwaysDisplayed(array $names)

281 {

282 $this->required = array_flip(array_map('strtolower', $names));

283 }

284

NavigationFavorites.php (https://github.com/woocommerce/woocommerce-admin.git) PHP · 327 lines

1 <?php

2 /**

3 * REST API Navigation Favorites controller

154

155 return rest_ensure_response(

156 array_map( 'stripslashes', $response )

157 );

158 }

Candidato.php (https://bitbucket.org/brunobispo/webgoal-vagas-api.git) PHP · 425 lines

1 <?php

2

3 /**

377 )));

378

379 $vagasIds = array_map(function($entity){ return $entity->getId(); }, $this->getVagasMapper()->findAll());

380

381 $inputFilter->add($factory->createInput(array(

social-media-icons.php (https://gitlab.com/Gashler/sg) PHP · 207 lines

129 <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'jetpack' ); ?></label>

130 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />

131 </p>

132 <p>

145 <label for="<?php echo esc_attr( $this->get_field_id( 'pinterest_username' ) ); ?>"><?php _e( 'Pinterest username:', 'jetpack' ); ?></label>

146 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'pinterest_username' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'pinterest_username' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['pinterest_username'] ); ?>" />

147 </p>

148 <p>

153 <label for="<?php echo esc_attr( $this->get_field_id( 'github_username' ) ); ?>"><?php _e( 'GitHub username:', 'jetpack' ); ?></label>

154 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'github_username' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'github_username' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['github_username'] ); ?>" />

155 </p>

156 <p>

161 <label for="<?php echo esc_attr( $this->get_field_id( 'vimeo_username' ) ); ?>"><?php _e( 'Vimeo username:', 'jetpack' ); ?></label>

162 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'vimeo_username' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'vimeo_username' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['vimeo_username'] ); ?>" />

163 </p>

164 <?php

parser_footnote.test.php (https://gitlab.com/michield/dokuwiki) PHP · 388 lines

1 <?php

2 require_once 'parser.inc.php';

24 array('document_end',array()),

25 );

26 $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);

27 }

28

36 array('document_end',array()),

37 );

38 $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);

39 }

40

55 array('document_end',array()),

56 );

57 $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);

58 }

59

Route.php (https://bitbucket.org/laborautonomo/laborautonomo-site.git) PHP · 594 lines

1 <?php

2

3 /*

228 public function setSchemes($schemes)

229 {

230 $this->schemes = array_map('strtolower', (array) $schemes);

231

232 // this is to keep BC and will be removed in a future version

265 public function setMethods($methods)

266 {

267 $this->methods = array_map('strtoupper', (array) $methods);

268

269 // this is to keep BC and will be removed in a future version

LogfileCommand.php (https://gitlab.com/fabiorf/chat) PHP · 205 lines

1 <?php

2 /**

3 * ua-parser

126

127 $fs = new Filesystem();

128 $fs->dumpFile($input->getArgument('output'), join(PHP_EOL, $undefinedClients));

129 }

130

171 $dirFinder = Finder::create()

172 ->in($input->getOption('log-dir'));

173 array_map(array($dirFinder, 'name'), $input->getOption('include'));

174 array_map(array($dirFinder, 'notName'), $input->getOption('exclude'));

select.php (https://github.com/drslice/regform.git) PHP · 392 lines

1 <?php defined('SYSPATH') or die('No direct script access.');

2 /**

3 * Database query builder for SELECT statements. See [Query Builder](/database/query/builder) for usage and examples.

7 * @author Kohana Team

8 * @copyright (c) 2008-2009 Kohana Team

9 * @license http://kohanaphp.com/license

10 */

11 class Kohana_Database_Query_Builder_Select extends Database_Query_Builder_Where {

311 {

312 // Select all columns

313 $query .= implode(', ', array_unique(array_map($quote_ident, $this->_select)));

314 }

315

317 {

318 // Set tables to select from

319 $query .= ' FROM '.implode(', ', array_unique(array_map($quote_table, $this->_from)));

320 }

321

slideshow.php (https://github.com/livinglab/openlab.git) PHP · 206 lines

1 <?php

2 /**

3 * Slideshow Block.

116 */

117 function slides( $ids = array(), $width = 400, $height = 300 ) {

118 return array_map(

119 function ( $id ) use ( $width, $height ) {

120 $caption = wp_get_attachment_caption( $id );

151 */

152 function bullets( $ids = array(), $block_ordinal = 0 ) {

153 $buttons = array_map(

154 function ( $index ) {

155 $aria_label = sprintf(

Builder.php (https://gitlab.com/ealexis.t/trends) PHP · 281 lines

1 <?php

2

3 namespace Illuminate\Database\Schema;

67 $column = strtolower($column);

68

69 return in_array($column, array_map('strtolower', $this->getColumnListing($table)));

70 }

71

79 public function hasColumns($table, array $columns)

80 {

81 $tableColumns = array_map('strtolower', $this->getColumnListing($table));

82

83 foreach ($columns as $column) {

Loader.php (https://github.com/patadejaguar/S.A.F.E.-Open-Source-Microfinance-Suite.git) PHP · 376 lines

1 <?php

2

3 namespace Dotenv;

212 {

213 if (strpos($name, '=') !== false) {

214 list($name, $value) = array_map('trim', explode('=', $name, 2));

215 }

216

331 }

332

333 // If PHP is running as an Apache module and an existing

334 // Apache environment variable exists, overwrite it

335 if (function_exists('apache_getenv') && function_exists('apache_setenv') && apache_getenv($name) !== false) {

array.idl.php (https://github.com/diegoIta/hiphop-php.git) PHP · 376 lines

1 <?php

2

3 include_once 'base.php';

78 'strict' => array(Boolean, 'false')), FunctionIsFoldable);

79

80 f('array_map', Variant,

81 array('callback' => Variant,

82 'arr1' => Variant),

ProcessBuilder.php (https://gitlab.com/techniconline/kmc) PHP · 285 lines

1 <?php

2

3 /*

266

267 $arguments = array_merge($this->prefix, $this->arguments);

268 $script = implode(' ', array_map(array(__NAMESPACE__ . '\\ProcessUtils', 'escapeArgument'), $arguments));

269

270 if ($this->inheritEnv) {

PostgresGrammar.php (https://bitbucket.org/helfreire/tccsite.git) PHP · 474 lines

1 <?php namespace Illuminate\Database\Schema\Grammars;

2

3 use Illuminate\Support\Fluent;

370 protected function typeEnum(Fluent $column)

371 {

372 $allowed = array_map(function($a) { return "'".$a."'"; }, $column->allowed);

373

374 return "varchar(255) check ({$column->name} in (".implode(', ', $allowed)."))";

Configuration.php (https://github.com/GunioRobot/phpca.git) PHP · 444 lines

1 <?php

2 /**

3 * Copyright (c) 2009 Stefan Priebsch <stefan@priebsch.de>

30 * POSSIBILITY OF SUCH DAMAGE.

31 *

32 * @package PHPca

33 * @author Stefan Priebsch <stefan@priebsch.de>

34 * @copyright Stefan Priebsch <stefan@priebsch.de>. All rights reserved.

36 */

37

38 namespace spriebsch\PHPca;

39

40 /**

41 * The PHPca configuration.

42 *

43 * @author Stefan Priebsch <stefan@priebsch.de>

Logs.php (https://gitlab.com/ebrjose/comcebu) PHP · 280 lines

155 foreach ( Log::get_log_types() as $slug => $name ) {

156 ?>

157 <option value="<?php echo esc_attr( $slug ); ?>" <?php selected( in_array( $slug, $log_types, true ) ); ?> >

158 <?php echo esc_html( $name ); ?>

161 </select>

162 </span>

163 <p class="desc"><?php esc_html_e( 'Select the types of events you want to log. Everything is logged by default.', 'wpforms-lite' ); ?></p>

164 </div>

165 </div>

190 <?php foreach ( $roles as $slug => $name ) { ?>

191 <option value="<?php echo esc_attr( $slug ); ?>" <?php selected( in_array( $slug, $logs_user_roles, true ) ); ?> >

192 <?php echo esc_html( $name ); ?>

229 foreach ( $users as $slug => $name ) {

230 ?>

231 <option value="<?php echo esc_attr( $slug ); ?>" <?php selected( in_array( $slug, $logs_users, true ) ); ?> >

232 <?php echo esc_html( $name ); ?>

CakeFixtureManager.php (https://github.com/simkimsia/cake2-practice-app.git) PHP · 253 lines

1 <?php

2 /**

3 * A factory class to manage the life cycle of test fixtures

5 * PHP 5

6 *

7 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)

8 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)

9 *

12 *

13 * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)

14 * @link http://cakephp.org CakePHP(tm) Project

15 * @package Cake.TestSuite.Fixture

16 * @since CakePHP(tm) v 2.0

17 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)

18 */

19 PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT');

class-wc-https.php (https://gitlab.com/haque.mdmanzurul/barongbarong) PHP · 103 lines

1 <?php

2

3 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

45 if ( is_ssl() ) {

46 if ( is_array( $content ) )

47 $content = array_map( 'WC_HTTPS::force_https_url', $content );

48 else

49 $content = str_replace( 'http:', 'https:', $content );

CollectionConstraint.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 112 lines

1 <?php

2

3 /*

37 $unique = $value;

38 if (is_array($value) && count($value)) {

39 $unique = array_map(function($e) { return var_export($e, true); }, $value);

40 }

41 if (count(array_unique($unique)) != count($value)) {

ImagineStyle.php (https://github.com/liip/LiipImagineBundle.git) PHP · 158 lines

1 <?php

2

3 /*

154 }

155

156 throw new InvalidArgumentException(sprintf('Invalid string format "%s" or replacements "%s".', $format, implode(', ', array_map(function ($replacement) { return var_export($replacement, true); }, $replacements))));

157 }

158 }

ResourceRegistrar.php (https://gitlab.com/MineYourMind/BoNeMEAL) PHP · 392 lines

1 <?php namespace Illuminate\Routing;

2

3 class ResourceRegistrar {

154 // resource segments, as well as the resource itself. Then we should get an

155 // entire string for the resource URI that contains all nested resources.

156 return implode('/', array_map(function($s)

157 {

158 return $s.'/{'.$this->getResourceWildcard($s).'}';

PoFileParser.php (https://github.com/LubosRemplik/cakephp.git) PHP · 184 lines

1 <?php

2 /**

3 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)

4 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

5 *

9 *

10 * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

11 * @link https://cakephp.org CakePHP(tm) Project

12 * @since 3.0.0

13 * @license https://opensource.org/licenses/mit-license.php MIT License

172 ksort($plurals);

173

174 $plurals = array_map('stripcslashes', $plurals);

175 $key = stripcslashes($item['ids']['plural']);

176

FileLockRegion.php (https://gitlab.com/aleksbenmaza/PPE_NEW) PHP · 265 lines

1 <?php

2

3 /*

179 public function getMultiple(CollectionCacheEntry $collection)

180 {

181 if (array_filter(array_map([$this, 'isLocked'], $collection->identifiers))) {

182 return null;

183 }

SimpleHeaderSet.php (https://bitbucket.org/cesarmedrano/cesarmedrano.git) PHP · 387 lines

1 <?php

2

3 /*

268 public function defineOrdering(array $sequence)

269 {

270 $this->_order = array_flip(array_map('strtolower', $sequence));

271 }

272

280 public function setAlwaysDisplayed(array $names)

281 {

282 $this->_required = array_flip(array_map('strtolower', $names));

283 }

284

Migrator.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 405 lines

1 <?php

2

3 namespace Illuminate\Database\Migrations;

237 public function getMigrationFiles($path)

238 {

239 $files = $this->files->glob($path.'/*_*.php');

240

241 // Once we have the array of files in the directory we will just remove the

246 }

247

248 $files = array_map(function ($file) {

249 return str_replace('.php', '', basename($file));

269 {

270 foreach ($files as $file) {

271 $this->files->requireOnce($path.'/'.$file.'.php');

272 }

273 }

function.html_checkboxes.php (https://github.com/kop1/newznab.git) PHP · 143 lines

1 <?php

2 /**

3 * Smarty plugin

10 * Smarty {html_checkboxes} function plugin

11 *

12 * File: function.html_checkboxes.php<br>

13 * Type: function<br>

14 * Name: html_checkboxes<br>

21 * {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}

22 * </pre>

23 * @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}

24 * (Smarty online manual)

25 * @author Christopher Kvarme <christopher.kvarme@flashjab.com>

41 function smarty_function_html_checkboxes($params, $template)

42 {

43 require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');

44

45 $name = 'checkbox';

wpSetObjectTerms.php (https://gitlab.com/morganestes/wordpress-develop) PHP · 423 lines

1 <?php

2

3 /**

120 foreach ( $term_id as $term => $id ) {

121 $actual = get_objects_in_term( $id, $this->taxonomy );

122 $this->assertEquals( $ids, array_map( 'intval', $actual ) );

123 }

124

153 foreach ( $term_id as $term => $id ) {

154 $actual = get_objects_in_term( $id, $this->taxonomy );

155 $this->assertEquals( $ids, array_map( 'intval', $actual ) );

156 }

157

FinderTest.php (https://github.com/Exercise/symfony.git) PHP · 333 lines

131 $finder = new Finder();

132 $this->assertSame($finder, $finder->ignoreVCS(false));

133 $this->assertIterator($this->toAbsolute(array('.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());

134

135 $finder = new Finder();

168 $finder = new Finder();

169 $this->assertSame($finder, $finder->sortByAccessedTime());

170 $this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'toto', 'test.py', 'foo')), $finder->in(self::$tmpDir)->getIterator());

171 }

172

223 $iterator = $finder->files()->name('*.php')->depth('< 1')->in(array(self::$tmpDir, __DIR__))->getIterator();

224

225 $this->assertIterator(array(self::$tmpDir.DIRECTORY_SEPARATOR.'test.php', __DIR__.DIRECTORY_SEPARATOR.'FinderTest.php', __DIR__.DIRECTORY_SEPARATOR.'bootstrap.php', __DIR__.DIRECTORY_SEPARATOR.'GlobTest.php'), $iterator);

226 }

227

user.class.php (https://bitbucket.org/anneivycat/ebcookhouse.git) PHP · 215 lines

1 <?php

2 /*************************************************************

3 *

4 * user.class.php

5 *

6 * Add Users

10 * www.prelovac.com

11 **************************************************************/

12 if(basename($_SERVER['SCRIPT_FILENAME']) == "user.class.php"):

13 exit;

14 endif;

78

79 if(!function_exists('username_exists') || !function_exists('email_exists'))

80 include_once(ABSPATH . WPINC . '/registration.php');

81

82 if(username_exists($args['user_login']))

Insert.php (https://github.com/bicho44/imglistados.git) PHP · 186 lines

1 <?php

2 /**

3 * Database query builder for INSERT statements. See [Query Builder](/database/query/builder) for usage and examples.

135

136 // Add the column names

137 $query .= ' ('.implode(', ', array_map([$db, 'quote_column'], $this->_columns)).') ';

138

139 if (is_array($this->_values))

select.php (https://github.com/ggunlugu/ornekler.git) PHP · 445 lines

1 <?php defined('SYSPATH') or die('No direct script access.');

2 /**

3 * Database query builder for SELECT statements. See [Query Builder](/database/query/builder) for usage and examples.

7 * @author Kohana Team

8 * @copyright (c) 2008-2009 Kohana Team

9 * @license http://kohanaphp.com/license

10 */

11 class Kohana_Database_Query_Builder_Select extends Database_Query_Builder_Where {

350 {

351 // Select all columns

352 $query .= implode(', ', array_unique(array_map($quote_column, $this->_select)));

353 }

354

356 {

357 // Set tables to select from

358 $query .= ' FROM '.implode(', ', array_unique(array_map($quote_table, $this->_from)));

359 }

360

Dispatcher.php (https://gitlab.com/kimting254/wbms) PHP · 486 lines

1 <?php namespace Illuminate\Events;

2

3 use Exception;

417 protected function cloneArgumentsForQueueing(array $arguments)

418 {

419 return array_map(function($a) { return is_object($a) ? clone $a : $a; }, $arguments);

420 }

421

TaggableBehavior.php (https://github.com/mmonguilod/sfPropel15TaggableBehaviorPlugin.git) PHP · 304 lines

10 protected $parameters = array(

11 'tagging_table' => '%TABLE%_tagging',

12 'tagging_table_phpname' => '%PHPNAME%Tagging',

13 'tag_table' => 'taggable_tag',

14 'tag_table_phpname' => 'Tag',

91 $this->taggingTable = $database->addTable(array(

92 'name' => $taggingTableName,

93 'phpName' => $this->replaceTokens($this->parameters['tagging_table_phpname']),

94 'package' => $table->getPackage(),

95 'schema' => $table->getSchema(),

297 return strtr($string, array(

298 '%TABLE%' => $table->getName(),

299 '%PHPNAME%' => $table->getPhpName(),

300 ));

301 }

DownloadableItemQueriesTest.php (https://github.com/wp-graphql/wp-graphql-woocommerce.git) PHP · 396 lines

1 <?php

2

3 class DownloadableItemQueriesTest extends \Codeception\TestCase\WPTestCase

195 array(

196 'downloadableItems' => array(

197 'nodes' => array_map(

198 function( $product_id ) {

199 return array( 'product' => array( 'productId' => $product_id ) );

232 array(

233 'downloadableItems' => array(

234 'nodes' => array_map(

235 function( $product_id ) {

236 return array( 'product' => array( 'productId' => $product_id ) );

269 array(

270 'downloadableItems' => array(

271 'nodes' => array_map(

272 function( $product_id ) {

273 return array( 'product' => array( 'productId' => $product_id ) );

fixture.class.php (https://github.com/iaindooley/Murphy.git) PHP · 226 lines

1 <?php

2 namespace Murphy;

3 use Exception,Closure,Args;

53 if(!$dbconfig_path = Args::get('dbconfig',Args::argv))

54 {

55 echo 'You need to include dbconfig in the command line arguments'.PHP_EOL;

56 exit(1);

57 }

59 if(!$dbconfig = include($dbconfig_path))

60 {

61 echo 'You need to include dbconfig in the command line arguments'.PHP_EOL;

62 exit(1);

63 }

183 $this->data[$cur_index]['tables'] = explode(',',trim(str_replace('@tables','',$b)));

184 else if(!isset($this->data[$cur_index]['header']))

185 $this->data[$cur_index]['header'] = array_map('trim',explode('|',$b));

186 else

187 $this->data[$cur_index]['rows'][] = array_map('trim',explode('|',$b));

ExpressionParser.php (https://bitbucket.org/hill2steve/mobileroom.git) PHP · 297 lines

1 <?php

2

3 /*

269

270 $this->error(sprintf('one of these tokens "%s"',

271 implode('", "', array_map(array('JMS\SecurityExtraBundle\Security\Authorization\Expression\Lexer', 'getLiteral'), $types))

272 ));

273 }

indexable-repository.php (https://gitlab.com/VTTE/sitios-vtte) PHP · 432 lines

1 <?php

2 /**

3 * Yoast extension of the Model class.

166 ->find_many();

167

168 return \array_map( [ $this, 'ensure_permalink' ], $indexables );

169 }

170

189 ->find_many();

190

191 return \array_map( [ $this, 'ensure_permalink' ], $indexables );

192 }

193

343 }

344

345 return \array_map( [ $this, 'ensure_permalink' ], $indexables );

346 }

347

DumpCompletionCommand.php (https://gitlab.com/hoangduys4k5/laravelproject) PHP · 133 lines

1 <?php

2

3 /*

40 protected function configure()

41 {

42 $fullCommand = $_SERVER['PHP_SELF'];

43 $commandName = basename($fullCommand);

44 $fullCommand = realpath($fullCommand) ?: $fullCommand;

127 private function getSupportedShells(): array

128 {

129 return array_map(function ($f) {

130 return pathinfo($f, \PATHINFO_EXTENSION);

131 }, glob(__DIR__.'/../Resources/completion.*'));

RemoteAddress.php (https://gitlab.com/jalon/doadoronline) PHP · 172 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

8 */

9

10 namespace Zend\Http\PhpEnvironment;

11

12 /**

133 $ips = explode(',', $_SERVER[$header]);

134 // trim, so we can compare against trusted proxies properly

135 $ips = array_map('trim', $ips);

136 // remove trusted proxy IPs

137 $ips = array_diff($ips, $this->trustedProxies);

t3form.php (https://gitlab.com/lankerd/paGO---Testing-Site) PHP · 162 lines

1 <?php

2 /**

3 *------------------------------------------------------------------------------

129 // Get the group names as strings for ancestor fields elements.

130 $attrs = $field->xpath('ancestor::fields[@name]/@name');

131 $groups = array_map('strval', $attrs ? $attrs : array());

132

133 // Check to see if the field exists in the current form.

ArrayCookieJar.php (https://gitlab.com/treighton/wpgit) PHP · 237 lines

1 <?php

2

3 namespace Guzzle\Plugin\Cookie\CookieJar;

146 {

147 // Only serialize long term cookies and unexpired cookies

148 return json_encode(array_map(function (Cookie $cookie) {

149 return $cookie->toArray();

150 }, $this->all(null, null, null, true, true)));

160 $this->cookies = array();

161 } else {

162 $this->cookies = array_map(function (array $cookie) {

163 return new Cookie($cookie);

164 }, $data);

translated-object.php (https://gitlab.com/hop23typhu/bryepoxy) PHP · 272 lines

1 <?php

2

3 /**

95 if ( ( $lang = $this->get_language( $id ) ) && isset( $translations ) && is_array( $translations ) ) {

96 // sanitize the translations array

97 $translations = array_map( 'intval', $translations );

98 $translations = array_merge( array( $lang->slug => $id ), $translations ); // make sure this object is in translations

99 $translations = array_diff( $translations, array( 0 ) ); // don't keep non translated languages

ModuleContainer.php (https://gitlab.com/merial/WETE_Ryhma3) PHP · 244 lines

1 <?php

2 namespace Codeception\Lib;

3

207 $part = [strtolower($part)];

208 }

209 $part = array_map('strtolower', $part);

210 $parts = Annotation::forMethod($module, $action)->fetchAll('part');

211 $usedParts = array_intersect($parts, $part);

ArrayCharacterStream.php (https://bitbucket.org/amitholkar/zenfile-18-05.git) PHP · 296 lines

1 <?php

2

3 /*

147 $chars = false;

148 foreach ($arrays as $array) {

149 $chars .= implode('', array_map('chr', $array));

150 }

151

193 $startLength = $this->_charReader->getInitialByteSize();

194

195 $fp = fopen('php://memory', 'w+b');

196 fwrite($fp, $chars);

197 unset($chars);

functions.php (https://github.com/t7systems/assetic.git) PHP · 174 lines

1 <?php

2

3 /*

149

150 if (!is_array($inputs)) {

151 $inputs = array_filter(array_map('trim', explode(',', $inputs)));

152 }

153

154 if (!is_array($filters)) {

155 $filters = array_filter(array_map('trim', explode(',', $filters)));

156 }

157

Collect.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 313 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

133 };

134

135 $stateValues = array_map($stateCallback, $finalDbModuleArray);

136 $installedCount = count($stateValues);

137 $disabledCount = $enabledCount = $uninstalledCount = 0;

260 $dbModuleArray = $this->moduleCollectionFactory->create()->getItems();

261

262 $nameValues = array_map($callback, $dbModuleArray);

263 $moduleChanges = [];

264

ClassNotFoundFatalErrorHandlerTest.php (https://gitlab.com/MineYourMind/BoNeMEAL) PHP · 202 lines

1 <?php

2

3 /*

19 use Composer\Autoload\ClassLoader as ComposerClassLoader;

20

21 class ClassNotFoundFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase

22 {

23 public static function setUpBeforeClass()

49 // autoloader is the only one to be used during the test run.

50 $autoloaders = spl_autoload_functions();

51 array_map('spl_autoload_unregister', $autoloaders);

52 spl_autoload_register($autoloader);

53 }

59 if ($autoloader) {

60 spl_autoload_unregister($autoloader);

61 array_map('spl_autoload_register', $autoloaders);

62 }

63

Ruleset.php (https://github.com/Mordred/less.php.git) PHP · 269 lines

1 <?php

2

3 namespace Less\Node;

25

26 public function compile($env) {

27 $selectors = $this->selectors ? array_map(function($s) use ($env) {

28 return $s->compile($env);

29 }, $this->selectors) : array();

165 if (! $this->root) {

166 if (count($context) === 0) {

167 $paths = array_map(function ($s) { return array($s); }, $this->selectors);

168 } else {

169 $this->joinSelectors($paths, $context, $this->selectors);

201 } else {

202 if (count($rules)) {

203 $selector = array_map(function ($p) use ($env) {

204 return trim(implode('', array_map(function ($s) use ($env) {

ORMWrapper.php (https://github.com/zephrax/cotyledon.git) PHP · 137 lines

1 <?php

2

3 namespace DB;

13 *

14 * You should include Idiorm before you include this file:

15 * require_once 'your/path/to/idiorm.php';

16 *

17 * BSD Licensed.

124 */

125 public function find_many() {

126 return array_map(array($this, '_create_model_instance'), parent::find_many());

127 }

128

class.Subscriber.php (https://gitlab.com/oytunistrator/jobberbase) PHP · 253 lines

1 <?php

2 /**

3 * jobber job board platform

146 if ($tmpResult = $db->QueryArray($sql))

147 {

148 // The following line works only with PHP 5.3 and above

149 // $result = array_map(function($item){ return $item['category_id']; }, $tmpResult);

request.php (https://github.com/mandriva-management-console/mmc.git) PHP · 210 lines

1 <?php

2

3 /**

68 return 'EMPTY';

69 }

70 return implode('||', array_map('to_s', $this->subs));

71 }

72

76

77 function toRPC() {

78 return array_map('to_rpc', $this->subs);

79 }

80

taxonomy.php (https://gitlab.com/thongta/fituet) PHP · 334 lines

1 <?php

2 // Prevent loading this file directly

3 defined( 'ABSPATH' ) || exit;

4 require_once RWMB_FIELDS_DIR . 'select-advanced.php';

5 require_once RWMB_FIELDS_DIR . 'checkbox-list.php';

219 */

220 static function save( $new, $old, $post_id, $field ) {

221 $new = array_unique( array_map( 'intval', (array) $new ) );

222 $new = empty( $new ) ? null : $new;

223 wp_set_object_terms( $post_id, $new, $field['options']['taxonomy'] );

RowCustomizer.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 325 lines

1 <?php

2 /**

3 * Copyright © 2016 Magento. All rights reserved.

144 * @param int $productId

145 * @return array

146 * @SuppressWarnings(PHPMD.UnusedFormalParameter)

147 */

148 public function getAdditionalRowsCount($additionalRowsCount, $productId)

220 . implode(

221 ImportModel::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR,

222 array_map(

223 function ($value, $key) {

224 return $key . ImportProductModel::PAIR_NAME_VALUE_SEPARATOR . $value;

Tax.php (https://github.com/seosamba/ecommerce.git) PHP · 263 lines

1 <?php

2 /**

3 * Handy tools for work with taxes

170 if (!empty($address['state'])){

171 if ($zone->getStates()) {

172 $states = array_map(function($state){ return $state['id'];}, $zone->getStates());

173 if (in_array($address['state'], $states)) {

174 $matchRate += 3;

CacheManager.php (https://gitlab.com/jjpa2018/dashboard) PHP · 420 lines

1 <?php

2

3 namespace Illuminate\Cache;

311 public function refreshEventDispatcher()

312 {

313 array_map([$this, 'setEventDispatcher'], $this->stores);

314 }

315

Status.php (https://github.com/daevid/MWFork.git) PHP · 358 lines

1 <?php

2

3 /**

222 if ( isset( $error['message'] ) && isset( $error['params'] ) ) {

223 return wfMsgNoTrans( $error['message'],

224 array_map( 'wfEscapeWikiText', $this->cleanParams( $error['params'] ) ) );

225 } else {

226 $message = array_shift($error);

227 return wfMsgNoTrans( $message,

228 array_map( 'wfEscapeWikiText', $this->cleanParams( $error ) ) );

229 }

230 } else {

239 */

240 function getWikiTextArray( $errors ) {

241 return array_map( array( $this, 'getWikiTextForError' ), $errors );

242 }

243

get_topLanguages_v4.php (https://github.com/iptomar/codematch_11-12.git) PHP · 104 lines

1 <?php

2 require_once('phpcassa/connection.php');

3 require_once('phpcassa/columnfamily.php');

13 18=>"D",19=>"DIFF",20=>"Dos Style",21=> "Dos Style",22=> "Fortran",23=> "Fortran",24=> "Haskell",25=> "HTML",26=>"Ini file",27=>"InnoSetup", +

14 28=> "Java",29=> "JavaScript",30=> "JSP",31=> "KiXtart",32=> "LISP",33=> "Lua",34=>"Makefile",35=>"Matlab",36=>"NSIS", +

15 37=>"Objective-C",38=> "Pascal",39=> "Perl",40=>"Php",41=> "Portugol",42=> "Postscript",43=> "PowerShell",44=> "Python", +

16 45=>"R",46=> "RC",47=> "Ruby" ,48=> "Scheme",49=> "Smaltalk" ,50=>"SQL" ,50=> "TCL" ,51=>"TeX",52=> "VB/VBS",53=> "Verilog",54=> "VHDL",55=> "XML",+

17 56=>"n/a", 57=>"Delphi/Kylix",58=>"Vala",59=>"Object Pascal",60=>"Common Lisp");

18

19 $converted_array = array_map("strtoupper", $arr);

20

21 $temp = new ColumnFamily($conn, 'temp'); // ColumnFamily

SqlServerConnector.php (https://gitlab.com/ducnv/BTL_CN_WEB) PHP · 145 lines

1 <?php

2

3 namespace Illuminate\Database\Connectors;

111 protected function buildConnectString($driver, array $arguments)

112 {

113 $options = array_map(function ($key) use ($arguments) {

114 return sprintf('%s=%s', $key, $arguments[$key]);

115 }, array_keys($arguments));

Amalgamator.php (https://github.com/livinglab/openlab.git) PHP · 305 lines

1 <?php

2 /**

3 * Merge pre-3.0 duplicate venues and organizers

170 }

171 global $wpdb;

172 array_map( 'intval', $venue_ids );

173 $keep = array_shift( $venue_ids );

174 $old_ids = implode( ',', $venue_ids );

191 }

192 global $wpdb;

193 array_map( 'intval', $organizer_ids );

194 $keep = array_shift( $organizer_ids );

195 $old_ids = implode( ',', $organizer_ids );

268 'post_type' => Tribe__Events__Main::POSTTYPE,

269 'page' => $settings->adminSlug,

270 ], admin_url( 'edit.php' )

271 )

272 );

NegotiatorTest.php (https://gitlab.com/Snizer/PI-DEV-TUNISIAMALL3A6-WEB) PHP · 334 lines

1 <?php

2

3 namespace Negotiation\Tests;

88

89 $this->assertCount(count($expected), $accepts);

90 $this->assertEquals($expected, array_map(function ($result) {

91 return $result->getValue();

92 }, $accepts));

Ruleset.php (https://github.com/agar/less.php.git) PHP · 253 lines

1 <?php

2

3 namespace Less\Node;

157 if (! $this->root) {

158 if (count($context) === 0) {

159 $paths = array_map(function ($s) { return array($s); }, $this->selectors);

160 } else {

161 $this->joinSelectors($paths, $context, $this->selectors);

193 } else {

194 if (count($rules)) {

195 $selector = array_map(function ($p) use ($env) {

196 return trim(implode('', array_map(function ($s) use ($env) {

EmployeeLanguageDaoTest.php (https://github.com/orangehrm/OrangeHRM.git) PHP · 237 lines

1 <?php

2 /**

3 * OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures

181 $this->assertEquals(

182 ['Dutch', 'English', 'Spanish'],

183 array_map(

184 function (Language $language) {

185 return $language->getName();

195 $this->assertEquals(

196 ['Dutch', 'Spanish'],

197 array_map(

198 function (Language $language) {

199 return $language->getName();

209 $this->assertEquals(

210 ['Dutch', 'English', 'Spanish'],

211 array_map(

212 function (Language $language) {

213 return $language->getName();

helpers.php (https://gitlab.com/thongta/fituet) PHP · 240 lines

1 <?php

2 /**

3 * This file contains all helpers/public functions

92 elseif ( 'taxonomy_advanced' == $args['type'] ) {

93 if ( ! empty( $args['taxonomy'] ) ) {

94 $term_ids = array_map( 'intval', array_filter( explode( ',', $meta . ',' ) ) );

95 // Allow to pass more arguments to "get_terms"

96 $func_args = wp_parse_args(

MoreLikeThis.php (https://gitlab.com/Blueprint-Marketing/solr-power) PHP · 341 lines

1 <?php

2 /**

3 * Copyright 2011 Bas de Nooijer. All rights reserved.

95 if (is_string($fields)) {

96 $fields = explode(',', $fields);

97 $fields = array_map('trim', $fields);

98 }

99

296 if (is_string($queryFields)) {

297 $queryFields = explode(',', $queryFields);

298 $queryFields = array_map('trim', $queryFields);

299 }

300

PostgresGrammar.php (https://gitlab.com/techniconline/kmc) PHP · 545 lines

1 <?php namespace Illuminate\Database\Schema\Grammars;

2

3 use Illuminate\Support\Fluent;

386 protected function typeEnum(Fluent $column)

387 {

388 $allowed = array_map(function ($a) {

389 return "'" . $a . "'";

390 }, $column->allowed);

class-wp-http-cookie.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 276 lines

1 <?php

2 /**

3 * HTTP API: WP_Http_Cookie class

208

209 // Port - supports "port-lists" in the format: "80,8000,8080".

210 if ( ! empty( $port ) && ! in_array( $url['port'], array_map( 'intval', explode( ',', $port ) ), true ) ) {

211 return false;

212 }

227 * @return string Header encoded cookie name and value.

228 */

229 public function getHeaderValue() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid

230 if ( ! isset( $this->name ) || ! isset( $this->value ) ) {

231 return '';

250 * @return string

251 */

252 public function getFullHeader() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid

253 return 'Cookie: ' . $this->getHeaderValue();

254 }

HeaderBag.php (https://gitlab.com/techniconline/kmc) PHP · 348 lines

1 <?php

2

3 /*

49 }

50

51 $max = max(array_map('strlen', array_keys($this->headers))) + 1;

52 $content = '';

53 ksort($this->headers);

54 foreach ($this->headers as $name => $values) {

55 $name = implode('-', array_map('ucfirst', explode('-', $name)));

56 foreach ($values as $value) {

57 $content .= sprintf("%-{$max}s %s\r\n", $name . ':', $value);

DimComment.php (https://gitlab.com/Blueprint-Marketing/wordpress-unit-tests) PHP · 238 lines

1 <?php

2

3 /**

4 * Admin ajax functions to be tested

5 */

6 require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );

7

8 /**

29 $post_id = $this->factory->post->create();

30 $this->_comments = $this->factory->comment->create_post_comments( $post_id, 15 );

31 $this->_comments = array_map( 'get_comment', $this->_comments );

32 }

33

65 $_POST['_per_page'] = 100;

66 $_POST['_page'] = 1;

67 $_POST['_url'] = admin_url( 'edit-comments.php' );

68

69 // Save the comment status

mandrill.php (https://gitlab.com/cmtsheikeshadi/first_app_development_project) PHP · 352 lines

1 <?php

2 /**

3 * Fuel

4 *

5 * Fuel is a fast, lightweight, community driven PHP5 framework.

6 *

7 * @package Fuel

10 * @license MIT License

11 * @copyright 2010 - 2016 Fuel Development Team

12 * @link http://fuelphp.com

13 */

14

196 protected function build_rcpt($list = 'to')

197 {

198 return array_map(function ($item) use ($list)

199 {

200 $item['type'] = $list;

CollectionTest.php (https://github.com/ggunlugu/ornekler.git) PHP · 270 lines

1 <?php

2 /**

3 * Lithium: the most rad php framework

4 *

5 * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)

6 * @license http://opensource.org/licenses/bsd-license.php The BSD License

7 */

8

258

259 $result = $collection->to(function($collection) {

260 $value = array_map(

261 function($i) { return is_array($i) ? join(',', $i) : $i; }, $collection->to('array')

262 );

FileSystemLoaderTest.php (https://github.com/liip/LiipImagineBundle.git) PHP · 247 lines

1 <?php

2

3 /*

17 use Liip\ImagineBundle\Binary\Locator\LocatorInterface;

18 use Liip\ImagineBundle\Model\FileBinary;

19 use PHPUnit\Framework\TestCase;

20 use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser;

21 use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser;

132 ];

133

134 return array_map(function ($parameters) use ($pathsPrepended) {

135 return [[$pathsPrepended[mt_rand(0, \count($pathsPrepended) - 1)], $parameters[0]], $parameters[1]];

136 }, static::provideLoadCases());

Driver.php (https://github.com/crmeb/CRMEB.git) PHP · 346 lines

1 <?php

2 // +----------------------------------------------------------------------

3 // | ThinkPHP [ WE CAN DO IT JUST THINK ]

4 // +----------------------------------------------------------------------

5 // | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.

6 // +----------------------------------------------------------------------

7 // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )

185

186 if (!isset($this->tag[$key])) {

187 $name = array_map(function ($val) {

188 return $this->getTagKey($val);

189 }, $name);

class-wc-api-coupons.php (https://gitlab.com/webkod3r/tripolis) PHP · 246 lines

1 <?php

2 /**

3 * WooCommerce API Coupons Class

121 'amount' => wc_format_decimal( $coupon->amount, 2 ),

122 'individual_use' => ( 'yes' === $coupon->individual_use ),

123 'product_ids' => array_map( 'absint', (array) $coupon->product_ids ),

124 'exclude_product_ids' => array_map( 'absint', (array) $coupon->exclude_product_ids ),

129 'expiry_date' => $this->server->format_datetime( $coupon->expiry_date ),

130 'enable_free_shipping' => $coupon->enable_free_shipping(),

131 'product_category_ids' => array_map( 'absint', (array) $coupon->product_categories ),

132 'exclude_product_category_ids' => array_map( 'absint', (array) $coupon->exclude_product_categories ),

submission.php (https://gitlab.com/webkod3r/tripolis) PHP · 297 lines

1 <?php

2

3 class WPCF7_Submission {

117 private function sanitize_posted_data( $value ) {

118 if ( is_array( $value ) ) {

119 $value = array_map( array( $this, 'sanitize_posted_data' ), $value );

120 } elseif ( is_string( $value ) ) {

121 $value = wp_check_invalid_utf8( $value );

180 }

181

182 require_once WPCF7_PLUGIN_DIR . '/includes/validation.php';

183 $result = new WPCF7_Validation();

184

Collection.php (https://gitlab.com/milton2913/myBlog) PHP · 364 lines

1 <?php

2

3 namespace Illuminate\Database\Eloquent;

93 public function modelKeys()

94 {

95 return array_map(function ($model) {

96 return $model->getKey();

97 }, $this->items);

ClassNotFoundFatalErrorHandlerTest.php (https://gitlab.com/xolotsoft/pumasruiz) PHP · 159 lines

1 <?php

2

3 /*

17 use Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler;

18

19 class ClassNotFoundFatalErrorHandlerTest extends \PHPUnit_Framework_TestCase

20 {

21 /**

28 // autoloader is the only one to be used during the test run.

29 $autoloaders = spl_autoload_functions();

30 array_map('spl_autoload_unregister', $autoloaders);

31 spl_autoload_register($autoloader);

32 }

38 if ($autoloader) {

39 spl_autoload_unregister($autoloader);

40 array_map('spl_autoload_register', $autoloaders);

41 }

42

options-sanitize.php (https://github.com/livinglab/openlab.git) PHP · 336 lines

1 <?php

2

3 /* Text */

262 $sizes = range( 9, 71 );

263 $sizes = apply_filters( 'of_recognized_font_sizes', $sizes );

264 $sizes = array_map( 'absint', $sizes );

265 return $sizes;

266 }

mandrill.php (https://github.com/fuel/email.git) PHP · 350 lines

1 <?php

2 /**

3 * Fuel is a fast, lightweight, community driven PHP 5.4+ framework.

8 * @license MIT License

9 * @copyright 2010 - 2019 Fuel Development Team

10 * @link https://fuelphp.com

11 */

12

194 protected function build_rcpt($list = 'to')

195 {

196 return array_map(function ($item) use ($list)

197 {

198 $item['type'] = $list;

SecurityDataCollector.php (https://gitlab.com/pr0055/symfonypizza) PHP · 246 lines

1 <?php

2

3 /*

105 'logout_url' => $logoutUrl,

106 'user' => $token->getUsername(),

107 'roles' => array_map(function (RoleInterface $role) { return $role->getRole();}, $assignedRoles),

108 'inherited_roles' => array_map(function (RoleInterface $role) { return $role->getRole(); }, $inheritedRoles),

ArrayCharacterStream.php (https://github.com/itag/TYPO3v4-Core.git) PHP · 319 lines

1 <?php

2

3 /*

9 */

10

11 //@require 'Swift/CharacterStream.php';

12 //@require 'Swift/OutputByteStream.php';

155 foreach ($arrays as $array)

156 {

157 $chars .= implode('', array_map('chr', $array));

158 }

159 return $chars;

200 $startLength = $this->_charReader->getInitialByteSize();

201

202 $fp = fopen('php://memory', 'w+b');

203 fwrite($fp, $chars);

204 unset($chars);

ClassCollectionLoaderTest.php (https://gitlab.com/Isaki/le331.fr) PHP · 281 lines

102 require_once __DIR__.'/Fixtures/ClassesWithParents/BTrait.php';

103 require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php';

104 require_once __DIR__.'/Fixtures/ClassesWithParents/D.php';

173 public function testFixNamespaceDeclarations($source, $expected)

174 {

175 $this->assertEquals('<?php '.$expected, ClassCollectionLoader::fixNamespaceDeclarations('<?php '.$source));

176 }

177

194 {

195 ClassCollectionLoader::enableTokenizer(false);

196 $this->assertEquals('<?php '.$expected, ClassCollectionLoader::fixNamespaceDeclarations('<?php '.$source));

197 ClassCollectionLoader::enableTokenizer(true);

198 }

224 public function testCommentStripping()

225 {

226 if (is_file($file = sys_get_temp_dir().'/bar.php')) {

227 unlink($file);

228 }

DocblockFormatter.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 168 lines

1 <?php

2

3 /*

89 $template = implode(' ', $template);

90

91 return implode("\n", array_map(function ($line) use ($template) {

92 $escaped = array_map(array('Symfony\Component\Console\Formatter\OutputFormatter', 'escape'), $line);

164 $words = trim(preg_replace('/[\s_-]+/', ' ', preg_replace('/([a-z])([A-Z])/', '$1 $2', $text)));

165

166 return implode(' ', array_map('ucfirst', explode(' ', $words)));

167 }

168 }

DB.php (https://github.com/erictj/protean.git) PHP · 307 lines

1 <?php

2 /**

3 * patForms storage DB

4 *

5 * $Id: DB.php,v 1.1 2006/04/03 20:41:08 eric Exp $

6 *

7 * @package patForms

8 * @subpackage Storage

9 * @author Stephan Schmidt <schst@php-tools.net>

10 */

11

13 * needs PEAR::DB

14 */

15 require_once 'DB.php';

16

17 /**

select.php (https://bitbucket.org/iwtechru/rivoinvest.com.git) PHP · 357 lines

175 <tr class="field_option field_option_<?php echo $this->name; ?>">

176 <td class="label">

177 <label for=""><?php _e("Choices",'acf'); ?></label>

178 <p><?php _e("Enter each choice on a new line.",'acf'); ?></p>

179 <p><?php _e("For more control, you may specify both a value and label like this:",'acf'); ?></p>

180 <p><?php _e("red : Red",'acf'); ?><br /><?php _e("blue : Blue",'acf'); ?></p>

181 </td>

182 <td>

193 </td>

194 </tr>

195 <tr class="field_option field_option_<?php echo $this->name; ?>">

196 <td class="label">

197 <label><?php _e("Default Value",'acf'); ?></label>

199 </td>

200 <td>

201 <?php

202

203 do_action('acf/create_field', array(

solaris_lwp.cc (git://github.com/zpao/v8monkey.git) C++ · 436 lines ✨ Summary

This C++ code is part of a signal handling library for the Solaris operating system. It provides functions to analyze and manipulate stack frames, including finding the context of a signal handler function call, identifying mapped addresses, and listing modules loaded by the process. The code appears to be designed for low-level debugging and analysis of signal-related issues in Solaris systems.

248 prheader_t lphp[HEADER_MAX];

249 prheader_t lhp[HEADER_MAX];

250 prheader_t *Lphp = lphp;

251 prheader_t *Lhp = lhp;

252 lwpsinfo_t *Lpsp;

261 if (read_lfile(pid, "lstatus", Lhp) == NULL)

262 return -1;

263 if (read_lfile(pid, "lpsinfo", Lphp) == NULL) {

264 return -1;

265 }

266

267 Lsp = (lwpstatus_t *)(uintptr_t)(Lhp + 1);

268 Lpsp = (lwpsinfo_t *)(uintptr_t)(Lphp + 1);

269

270 for (ninfo = Lphp->pr_nent; ninfo != 0; --ninfo) {