repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
Torann/laravel-currency
src/Middleware/CurrencyMiddleware.php
CurrencyMiddleware.setUserCurrency
private function setUserCurrency($currency, $request) { $currency = strtoupper($currency); // Set user selection globally currency()->setUserCurrency($currency); // Save it for later too! $request->getSession()->put(['currency' => $currency]); return $currency; ...
php
private function setUserCurrency($currency, $request) { $currency = strtoupper($currency); // Set user selection globally currency()->setUserCurrency($currency); // Save it for later too! $request->getSession()->put(['currency' => $currency]); return $currency; ...
[ "private", "function", "setUserCurrency", "(", "$", "currency", ",", "$", "request", ")", "{", "$", "currency", "=", "strtoupper", "(", "$", "currency", ")", ";", "// Set user selection globally", "currency", "(", ")", "->", "setUserCurrency", "(", "$", "curre...
Set the user currency. @param string $currency @param Request $request @return string
[ "Set", "the", "user", "currency", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Middleware/CurrencyMiddleware.php#L88-L99
Torann/laravel-currency
src/Console/Update.php
Update.handle
public function handle() { // Get Settings $defaultCurrency = $this->currency->config('default'); if ($this->input->getOption('google')) { // Get rates from google return $this->updateFromGoogle($defaultCurrency); } if ($this->input->getOption('opene...
php
public function handle() { // Get Settings $defaultCurrency = $this->currency->config('default'); if ($this->input->getOption('google')) { // Get rates from google return $this->updateFromGoogle($defaultCurrency); } if ($this->input->getOption('opene...
[ "public", "function", "handle", "(", ")", "{", "// Get Settings", "$", "defaultCurrency", "=", "$", "this", "->", "currency", "->", "config", "(", "'default'", ")", ";", "if", "(", "$", "this", "->", "input", "->", "getOption", "(", "'google'", ")", ")",...
Execute the console command. @return void
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Console/Update.php#L59-L79
Torann/laravel-currency
src/Console/Update.php
Update.updateFromOpenExchangeRates
private function updateFromOpenExchangeRates($defaultCurrency, $api) { $this->info('Updating currency exchange rates from OpenExchangeRates.org...'); // Make request $content = json_decode($this->request("http://openexchangerates.org/api/latest.json?base={$defaultCurrency}&app_id={$api}&sho...
php
private function updateFromOpenExchangeRates($defaultCurrency, $api) { $this->info('Updating currency exchange rates from OpenExchangeRates.org...'); // Make request $content = json_decode($this->request("http://openexchangerates.org/api/latest.json?base={$defaultCurrency}&app_id={$api}&sho...
[ "private", "function", "updateFromOpenExchangeRates", "(", "$", "defaultCurrency", ",", "$", "api", ")", "{", "$", "this", "->", "info", "(", "'Updating currency exchange rates from OpenExchangeRates.org...'", ")", ";", "// Make request", "$", "content", "=", "json_deco...
Fetch rates from the API @param $defaultCurrency @param $api
[ "Fetch", "rates", "from", "the", "API" ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Console/Update.php#L87-L115
Torann/laravel-currency
src/Console/Update.php
Update.updateFromGoogle
private function updateFromGoogle($defaultCurrency) { $this->info('Updating currency exchange rates from finance.google.com...'); foreach ($this->currency->getDriver()->all() as $code => $value) { // Don't update the default currency, the value is always 1 if ($code === $defa...
php
private function updateFromGoogle($defaultCurrency) { $this->info('Updating currency exchange rates from finance.google.com...'); foreach ($this->currency->getDriver()->all() as $code => $value) { // Don't update the default currency, the value is always 1 if ($code === $defa...
[ "private", "function", "updateFromGoogle", "(", "$", "defaultCurrency", ")", "{", "$", "this", "->", "info", "(", "'Updating currency exchange rates from finance.google.com...'", ")", ";", "foreach", "(", "$", "this", "->", "currency", "->", "getDriver", "(", ")", ...
Fetch rates from Google Finance @param $defaultCurrency
[ "Fetch", "rates", "from", "Google", "Finance" ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Console/Update.php#L122-L146
Torann/laravel-currency
src/Console/Cleanup.php
Cleanup.handle
public function handle() { // Clear cache $this->currency->clearCache(); $this->comment('Currency cache cleaned.'); // Force the system to rebuild cache $this->currency->getCurrencies(); $this->comment('Currency cache rebuilt.'); }
php
public function handle() { // Clear cache $this->currency->clearCache(); $this->comment('Currency cache cleaned.'); // Force the system to rebuild cache $this->currency->getCurrencies(); $this->comment('Currency cache rebuilt.'); }
[ "public", "function", "handle", "(", ")", "{", "// Clear cache", "$", "this", "->", "currency", "->", "clearCache", "(", ")", ";", "$", "this", "->", "comment", "(", "'Currency cache cleaned.'", ")", ";", "// Force the system to rebuild cache", "$", "this", "->"...
Execute the console command. @return void
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Console/Cleanup.php#L55-L64
Torann/laravel-currency
src/Drivers/Database.php
Database.create
public function create(array $params) { // Ensure the currency doesn't already exist if ($this->find($params['code'], null) !== null) { return 'exists'; } // Created at stamp $created = new DateTime('now'); $params = array_merge([ 'name' => '...
php
public function create(array $params) { // Ensure the currency doesn't already exist if ($this->find($params['code'], null) !== null) { return 'exists'; } // Created at stamp $created = new DateTime('now'); $params = array_merge([ 'name' => '...
[ "public", "function", "create", "(", "array", "$", "params", ")", "{", "// Ensure the currency doesn't already exist", "if", "(", "$", "this", "->", "find", "(", "$", "params", "[", "'code'", "]", ",", "null", ")", "!==", "null", ")", "{", "return", "'exis...
{@inheritdoc}
[ "{" ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Drivers/Database.php#L33-L55
Torann/laravel-currency
src/Drivers/Database.php
Database.all
public function all() { $collection = new Collection($this->database->table($this->config('table'))->get()); return $collection->keyBy('code') ->map(function ($item) { return [ 'id' => $item->id, 'name' => $item->name, ...
php
public function all() { $collection = new Collection($this->database->table($this->config('table'))->get()); return $collection->keyBy('code') ->map(function ($item) { return [ 'id' => $item->id, 'name' => $item->name, ...
[ "public", "function", "all", "(", ")", "{", "$", "collection", "=", "new", "Collection", "(", "$", "this", "->", "database", "->", "table", "(", "$", "this", "->", "config", "(", "'table'", ")", ")", "->", "get", "(", ")", ")", ";", "return", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Drivers/Database.php#L60-L79
Torann/laravel-currency
src/Drivers/Database.php
Database.find
public function find($code, $active = 1) { $query = $this->database->table($this->config('table')) ->where('code', strtoupper($code)); // Make active optional if (is_null($active) === false) { $query->where('active', $active); } return $query->first(...
php
public function find($code, $active = 1) { $query = $this->database->table($this->config('table')) ->where('code', strtoupper($code)); // Make active optional if (is_null($active) === false) { $query->where('active', $active); } return $query->first(...
[ "public", "function", "find", "(", "$", "code", ",", "$", "active", "=", "1", ")", "{", "$", "query", "=", "$", "this", "->", "database", "->", "table", "(", "$", "this", "->", "config", "(", "'table'", ")", ")", "->", "where", "(", "'code'", ","...
{@inheritdoc}
[ "{" ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Drivers/Database.php#L84-L95
Torann/laravel-currency
src/Drivers/Filesystem.php
Filesystem.create
public function create(array $params) { // Get blacklist path $path = $this->config('path'); // Get all as an array $currencies = $this->all(); // Verify the currency doesn't exists if (isset($currencies[$params['code']]) === true) { return 'exists'; ...
php
public function create(array $params) { // Get blacklist path $path = $this->config('path'); // Get all as an array $currencies = $this->all(); // Verify the currency doesn't exists if (isset($currencies[$params['code']]) === true) { return 'exists'; ...
[ "public", "function", "create", "(", "array", "$", "params", ")", "{", "// Get blacklist path", "$", "path", "=", "$", "this", "->", "config", "(", "'path'", ")", ";", "// Get all as an array", "$", "currencies", "=", "$", "this", "->", "all", "(", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Drivers/Filesystem.php#L34-L62
Torann/laravel-currency
src/Drivers/Filesystem.php
Filesystem.update
public function update($code, array $attributes, DateTime $timestamp = null) { // Get blacklist path $path = $this->config('path'); // Get all as an array $currencies = $this->all(); // Verify the currency exists if (isset($currencies[$code]) === false) { ...
php
public function update($code, array $attributes, DateTime $timestamp = null) { // Get blacklist path $path = $this->config('path'); // Get all as an array $currencies = $this->all(); // Verify the currency exists if (isset($currencies[$code]) === false) { ...
[ "public", "function", "update", "(", "$", "code", ",", "array", "$", "attributes", ",", "DateTime", "$", "timestamp", "=", "null", ")", "{", "// Get blacklist path", "$", "path", "=", "$", "this", "->", "config", "(", "'path'", ")", ";", "// Get all as an ...
{@inheritdoc}
[ "{" ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Drivers/Filesystem.php#L98-L120
Torann/laravel-currency
src/Drivers/Filesystem.php
Filesystem.delete
public function delete($code) { // Get blacklist path $path = $this->config('path'); // Get all as an array $currencies = $this->all(); // Verify the currency exists if (isset($currencies[$code]) === false) { return false; } unset($curre...
php
public function delete($code) { // Get blacklist path $path = $this->config('path'); // Get all as an array $currencies = $this->all(); // Verify the currency exists if (isset($currencies[$code]) === false) { return false; } unset($curre...
[ "public", "function", "delete", "(", "$", "code", ")", "{", "// Get blacklist path", "$", "path", "=", "$", "this", "->", "config", "(", "'path'", ")", ";", "// Get all as an array", "$", "currencies", "=", "$", "this", "->", "all", "(", ")", ";", "// Ve...
{@inheritdoc}
[ "{" ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Drivers/Filesystem.php#L125-L141
Torann/laravel-currency
src/CurrencyServiceProvider.php
CurrencyServiceProvider.register
public function register() { $this->registerCurrency(); if ($this->app->runningInConsole()) { $this->registerResources(); $this->registerCurrencyCommands(); } }
php
public function register() { $this->registerCurrency(); if ($this->app->runningInConsole()) { $this->registerResources(); $this->registerCurrencyCommands(); } }
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "registerCurrency", "(", ")", ";", "if", "(", "$", "this", "->", "app", "->", "runningInConsole", "(", ")", ")", "{", "$", "this", "->", "registerResources", "(", ")", ";", "$", "thi...
Register the service provider. @return void
[ "Register", "the", "service", "provider", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/CurrencyServiceProvider.php#L14-L22
Torann/laravel-currency
src/CurrencyServiceProvider.php
CurrencyServiceProvider.registerResources
public function registerResources() { if ($this->isLumen() === false) { $this->publishes([ __DIR__ . '/../config/currency.php' => config_path('currency.php'), ], 'config'); $this->mergeConfigFrom( __DIR__ . '/../config/currency.php...
php
public function registerResources() { if ($this->isLumen() === false) { $this->publishes([ __DIR__ . '/../config/currency.php' => config_path('currency.php'), ], 'config'); $this->mergeConfigFrom( __DIR__ . '/../config/currency.php...
[ "public", "function", "registerResources", "(", ")", "{", "if", "(", "$", "this", "->", "isLumen", "(", ")", "===", "false", ")", "{", "$", "this", "->", "publishes", "(", "[", "__DIR__", ".", "'/../config/currency.php'", "=>", "config_path", "(", "'curren...
Register currency resources. @return void
[ "Register", "currency", "resources", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/CurrencyServiceProvider.php#L44-L59
Torann/laravel-currency
src/Console/Manage.php
Manage.handle
public function handle() { $action = $this->getActionArgument(['add', 'update', 'delete']); foreach ($this->getCurrencyArgument() as $currency) { $this->$action(strtoupper($currency)); } }
php
public function handle() { $action = $this->getActionArgument(['add', 'update', 'delete']); foreach ($this->getCurrencyArgument() as $currency) { $this->$action(strtoupper($currency)); } }
[ "public", "function", "handle", "(", ")", "{", "$", "action", "=", "$", "this", "->", "getActionArgument", "(", "[", "'add'", ",", "'update'", ",", "'delete'", "]", ")", ";", "foreach", "(", "$", "this", "->", "getCurrencyArgument", "(", ")", "as", "$"...
Execute the console command. @return void
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Console/Manage.php#L66-L73
Torann/laravel-currency
src/Console/Manage.php
Manage.update
protected function update($currency) { if (($data = $this->getCurrency($currency)) === null) { return $this->error("Currency \"{$currency}\" not found"); } $this->output->write("Updating {$currency} currency..."); if (is_string($result = $this->storage->update($currency...
php
protected function update($currency) { if (($data = $this->getCurrency($currency)) === null) { return $this->error("Currency \"{$currency}\" not found"); } $this->output->write("Updating {$currency} currency..."); if (is_string($result = $this->storage->update($currency...
[ "protected", "function", "update", "(", "$", "currency", ")", "{", "if", "(", "(", "$", "data", "=", "$", "this", "->", "getCurrency", "(", "$", "currency", ")", ")", "===", "null", ")", "{", "return", "$", "this", "->", "error", "(", "\"Currency \\\...
Update currency in storage. @param string $currency @return void
[ "Update", "currency", "in", "storage", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Console/Manage.php#L107-L121
Torann/laravel-currency
src/Console/Manage.php
Manage.delete
protected function delete($currency) { $this->output->write("Deleting {$currency} currency..."); if (is_string($result = $this->storage->delete($currency))) { $this->output->writeln('<error>' . ($result ?: 'Failed') . '</error>'); } else { $this->output->writ...
php
protected function delete($currency) { $this->output->write("Deleting {$currency} currency..."); if (is_string($result = $this->storage->delete($currency))) { $this->output->writeln('<error>' . ($result ?: 'Failed') . '</error>'); } else { $this->output->writ...
[ "protected", "function", "delete", "(", "$", "currency", ")", "{", "$", "this", "->", "output", "->", "write", "(", "\"Deleting {$currency} currency...\"", ")", ";", "if", "(", "is_string", "(", "$", "result", "=", "$", "this", "->", "storage", "->", "dele...
Delete currency from storage. @param string $currency @return void
[ "Delete", "currency", "from", "storage", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Console/Manage.php#L130-L140
Torann/laravel-currency
src/Console/Manage.php
Manage.getCurrencyArgument
protected function getCurrencyArgument() { // Get the user entered value $value = preg_replace('/\s+/', '', $this->argument('currency')); // Return all currencies if requested if ($value === 'all') { return array_keys($this->currencies); } return explode...
php
protected function getCurrencyArgument() { // Get the user entered value $value = preg_replace('/\s+/', '', $this->argument('currency')); // Return all currencies if requested if ($value === 'all') { return array_keys($this->currencies); } return explode...
[ "protected", "function", "getCurrencyArgument", "(", ")", "{", "// Get the user entered value", "$", "value", "=", "preg_replace", "(", "'/\\s+/'", ",", "''", ",", "$", "this", "->", "argument", "(", "'currency'", ")", ")", ";", "// Return all currencies if requeste...
Get currency argument. @return array
[ "Get", "currency", "argument", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Console/Manage.php#L147-L158
Torann/laravel-currency
src/Console/Manage.php
Manage.getActionArgument
protected function getActionArgument($validActions = []) { $action = strtolower($this->argument('action')); if (in_array($action, $validActions) === false) { throw new \RuntimeException("The \"{$action}\" option does not exist."); } return $action; }
php
protected function getActionArgument($validActions = []) { $action = strtolower($this->argument('action')); if (in_array($action, $validActions) === false) { throw new \RuntimeException("The \"{$action}\" option does not exist."); } return $action; }
[ "protected", "function", "getActionArgument", "(", "$", "validActions", "=", "[", "]", ")", "{", "$", "action", "=", "strtolower", "(", "$", "this", "->", "argument", "(", "'action'", ")", ")", ";", "if", "(", "in_array", "(", "$", "action", ",", "$", ...
Get action argument. @param array $validActions @return array
[ "Get", "action", "argument", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Console/Manage.php#L167-L176
Torann/laravel-currency
database/migrations/2013_11_26_161501_create_currency_table.php
CreateCurrencyTable.up
public function up() { Schema::create($this->table_name, function ($table) { $table->increments('id')->unsigned(); $table->string('name'); $table->string('code', 10)->index(); $table->string('symbol', 25); $table->string('format', 50); ...
php
public function up() { Schema::create($this->table_name, function ($table) { $table->increments('id')->unsigned(); $table->string('name'); $table->string('code', 10)->index(); $table->string('symbol', 25); $table->string('format', 50); ...
[ "public", "function", "up", "(", ")", "{", "Schema", "::", "create", "(", "$", "this", "->", "table_name", ",", "function", "(", "$", "table", ")", "{", "$", "table", "->", "increments", "(", "'id'", ")", "->", "unsigned", "(", ")", ";", "$", "tabl...
Run the migrations. @return void
[ "Run", "the", "migrations", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/database/migrations/2013_11_26_161501_create_currency_table.php#L27-L39
Torann/laravel-currency
src/Currency.php
Currency.format
public function format($value, $code = null, $include_symbol = true) { // Get default currency if one is not set $code = $code ?: $this->config('default'); // Remove unnecessary characters $value = preg_replace('/[\s\',!]/', '', $value); // Check for a custom format...
php
public function format($value, $code = null, $include_symbol = true) { // Get default currency if one is not set $code = $code ?: $this->config('default'); // Remove unnecessary characters $value = preg_replace('/[\s\',!]/', '', $value); // Check for a custom format...
[ "public", "function", "format", "(", "$", "value", ",", "$", "code", "=", "null", ",", "$", "include_symbol", "=", "true", ")", "{", "// Get default currency if one is not set\r", "$", "code", "=", "$", "code", "?", ":", "$", "this", "->", "config", "(", ...
Format the value into the desired currency. @param float $value @param string $code @param bool $include_symbol @return string
[ "Format", "the", "value", "into", "the", "desired", "currency", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Currency.php#L115-L168
Torann/laravel-currency
src/Currency.php
Currency.isActive
public function isActive($code) { return $code && (bool) Arr::get($this->getCurrency($code), 'active', false); }
php
public function isActive($code) { return $code && (bool) Arr::get($this->getCurrency($code), 'active', false); }
[ "public", "function", "isActive", "(", "$", "code", ")", "{", "return", "$", "code", "&&", "(", "bool", ")", "Arr", "::", "get", "(", "$", "this", "->", "getCurrency", "(", "$", "code", ")", ",", "'active'", ",", "false", ")", ";", "}" ]
Determine if the provided currency is active. @param string $code @return bool
[ "Determine", "if", "the", "provided", "currency", "is", "active", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Currency.php#L209-L212
Torann/laravel-currency
src/Currency.php
Currency.getCurrency
public function getCurrency($code = null) { $code = $code ?: $this->getUserCurrency(); return Arr::get($this->getCurrencies(), strtoupper($code)); }
php
public function getCurrency($code = null) { $code = $code ?: $this->getUserCurrency(); return Arr::get($this->getCurrencies(), strtoupper($code)); }
[ "public", "function", "getCurrency", "(", "$", "code", "=", "null", ")", "{", "$", "code", "=", "$", "code", "?", ":", "$", "this", "->", "getUserCurrency", "(", ")", ";", "return", "Arr", "::", "get", "(", "$", "this", "->", "getCurrencies", "(", ...
Return the current currency if the one supplied is not valid. @param string $code @return array|null
[ "Return", "the", "current", "currency", "if", "the", "one", "supplied", "is", "not", "valid", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Currency.php#L222-L227
Torann/laravel-currency
src/Currency.php
Currency.getCurrencies
public function getCurrencies() { if ($this->currencies_cache === null) { if (config('app.debug', false) === true) { $this->currencies_cache = $this->getDriver()->all(); } else { $this->currencies_cache = $this->cache->rememberForeve...
php
public function getCurrencies() { if ($this->currencies_cache === null) { if (config('app.debug', false) === true) { $this->currencies_cache = $this->getDriver()->all(); } else { $this->currencies_cache = $this->cache->rememberForeve...
[ "public", "function", "getCurrencies", "(", ")", "{", "if", "(", "$", "this", "->", "currencies_cache", "===", "null", ")", "{", "if", "(", "config", "(", "'app.debug'", ",", "false", ")", "===", "true", ")", "{", "$", "this", "->", "currencies_cache", ...
Return all currencies. @return array
[ "Return", "all", "currencies", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Currency.php#L234-L248
Torann/laravel-currency
src/Currency.php
Currency.getDriver
public function getDriver() { if ($this->driver === null) { // Get driver configuration $config = $this->config('drivers.' . $this->config('driver'), []); // Get driver class $driver = Arr::pull($config, 'class'); // Create driver instan...
php
public function getDriver() { if ($this->driver === null) { // Get driver configuration $config = $this->config('drivers.' . $this->config('driver'), []); // Get driver class $driver = Arr::pull($config, 'class'); // Create driver instan...
[ "public", "function", "getDriver", "(", ")", "{", "if", "(", "$", "this", "->", "driver", "===", "null", ")", "{", "// Get driver configuration\r", "$", "config", "=", "$", "this", "->", "config", "(", "'drivers.'", ".", "$", "this", "->", "config", "(",...
Get storage driver. @return \Torann\Currency\Contracts\DriverInterface
[ "Get", "storage", "driver", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Currency.php#L267-L281
Torann/laravel-currency
src/Currency.php
Currency.getFormatter
public function getFormatter() { if ($this->formatter === null && $this->config('formatter') !== null) { // Get formatter configuration $config = $this->config('formatters.' . $this->config('formatter'), []); // Get formatter class $class = Arr::pull($...
php
public function getFormatter() { if ($this->formatter === null && $this->config('formatter') !== null) { // Get formatter configuration $config = $this->config('formatters.' . $this->config('formatter'), []); // Get formatter class $class = Arr::pull($...
[ "public", "function", "getFormatter", "(", ")", "{", "if", "(", "$", "this", "->", "formatter", "===", "null", "&&", "$", "this", "->", "config", "(", "'formatter'", ")", "!==", "null", ")", "{", "// Get formatter configuration\r", "$", "config", "=", "$",...
Get formatter driver. @return \Torann\Currency\Contracts\FormatterInterface
[ "Get", "formatter", "driver", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Currency.php#L288-L302
Torann/laravel-currency
src/Currency.php
Currency.config
public function config($key = null, $default = null) { if ($key === null) { return $this->config; } return Arr::get($this->config, $key, $default); }
php
public function config($key = null, $default = null) { if ($key === null) { return $this->config; } return Arr::get($this->config, $key, $default); }
[ "public", "function", "config", "(", "$", "key", "=", "null", ",", "$", "default", "=", "null", ")", "{", "if", "(", "$", "key", "===", "null", ")", "{", "return", "$", "this", "->", "config", ";", "}", "return", "Arr", "::", "get", "(", "$", "...
Get configuration value. @param string $key @param mixed $default @return mixed
[ "Get", "configuration", "value", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Currency.php#L321-L328
Torann/laravel-currency
src/Currency.php
Currency.getCurrencyProp
protected function getCurrencyProp($code, $key, $default = null) { return Arr::get($this->getCurrency($code), $key, $default); }
php
protected function getCurrencyProp($code, $key, $default = null) { return Arr::get($this->getCurrency($code), $key, $default); }
[ "protected", "function", "getCurrencyProp", "(", "$", "code", ",", "$", "key", ",", "$", "default", "=", "null", ")", "{", "return", "Arr", "::", "get", "(", "$", "this", "->", "getCurrency", "(", "$", "code", ")", ",", "$", "key", ",", "$", "defau...
Get the given property value from provided currency. @param string $code @param string $key @param mixed $default @return array
[ "Get", "the", "given", "property", "value", "from", "provided", "currency", "." ]
train
https://github.com/Torann/laravel-currency/blob/69841ec5390d9c45bfbbb6a26495ba09d7476c59/src/Currency.php#L339-L342
michaeldyrynda/laravel-make-user
src/MakeUserServiceProvider.php
MakeUserServiceProvider.register
public function register() { $this->app->singleton('dyrynda.artisan.make:user', function ($app) { return $app->make(MakeUser::class); }); $this->commands('dyrynda.artisan.make:user'); }
php
public function register() { $this->app->singleton('dyrynda.artisan.make:user', function ($app) { return $app->make(MakeUser::class); }); $this->commands('dyrynda.artisan.make:user'); }
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "app", "->", "singleton", "(", "'dyrynda.artisan.make:user'", ",", "function", "(", "$", "app", ")", "{", "return", "$", "app", "->", "make", "(", "MakeUser", "::", "class", ")", ";", ...
Register the application services. @return void
[ "Register", "the", "application", "services", "." ]
train
https://github.com/michaeldyrynda/laravel-make-user/blob/8d4cd8bef67c202419f9dcbc04d7dd03e473a146/src/MakeUserServiceProvider.php#L15-L22
michaeldyrynda/laravel-make-user
src/Console/Commands/MakeUser.php
MakeUser.handle
public function handle() { $email = $this->ask("What is the new user's email address?"); $name = $this->ask("What is the new user's name?") ?: ''; $password = bcrypt($this->secret("What is the new user's password? (blank generates a random one)", str_random(32))); $sendReset = $this-...
php
public function handle() { $email = $this->ask("What is the new user's email address?"); $name = $this->ask("What is the new user's name?") ?: ''; $password = bcrypt($this->secret("What is the new user's password? (blank generates a random one)", str_random(32))); $sendReset = $this-...
[ "public", "function", "handle", "(", ")", "{", "$", "email", "=", "$", "this", "->", "ask", "(", "\"What is the new user's email address?\"", ")", ";", "$", "name", "=", "$", "this", "->", "ask", "(", "\"What is the new user's name?\"", ")", "?", ":", "''", ...
Execute the console command. Handle creation of the new application user. @return void
[ "Execute", "the", "console", "command", "." ]
train
https://github.com/michaeldyrynda/laravel-make-user/blob/8d4cd8bef67c202419f9dcbc04d7dd03e473a146/src/Console/Commands/MakeUser.php#L40-L78
michaeldyrynda/laravel-make-user
src/Console/Commands/MakeUser.php
MakeUser.validateEmail
private function validateEmail($email) { if (! filter_var($email, FILTER_VALIDATE_EMAIL)) { throw MakeUserException::invalidEmail($email); } if (app(config('auth.providers.users.model'))->where('email', $email)->exists()) { throw MakeUserException::emailExists($email...
php
private function validateEmail($email) { if (! filter_var($email, FILTER_VALIDATE_EMAIL)) { throw MakeUserException::invalidEmail($email); } if (app(config('auth.providers.users.model'))->where('email', $email)->exists()) { throw MakeUserException::emailExists($email...
[ "private", "function", "validateEmail", "(", "$", "email", ")", "{", "if", "(", "!", "filter_var", "(", "$", "email", ",", "FILTER_VALIDATE_EMAIL", ")", ")", "{", "throw", "MakeUserException", "::", "invalidEmail", "(", "$", "email", ")", ";", "}", "if", ...
Determine if the given email address already exists. @param string $email @return void @throws \Dyrynda\Artisan\Exceptions\MakeUserException
[ "Determine", "if", "the", "given", "email", "address", "already", "exists", "." ]
train
https://github.com/michaeldyrynda/laravel-make-user/blob/8d4cd8bef67c202419f9dcbc04d7dd03e473a146/src/Console/Commands/MakeUser.php#L88-L97
box-project/box2
src/lib/KevinGH/Box/Command/AbstractCommand.php
AbstractCommand.putln
protected function putln($prefix, $message) { switch ($prefix) { case '!': $prefix = "<error>$prefix</error>"; break; case '*': $prefix = "<info>$prefix</info>"; break; case '?': $prefix = "<c...
php
protected function putln($prefix, $message) { switch ($prefix) { case '!': $prefix = "<error>$prefix</error>"; break; case '*': $prefix = "<info>$prefix</info>"; break; case '?': $prefix = "<c...
[ "protected", "function", "putln", "(", "$", "prefix", ",", "$", "message", ")", "{", "switch", "(", "$", "prefix", ")", "{", "case", "'!'", ":", "$", "prefix", "=", "\"<error>$prefix</error>\"", ";", "break", ";", "case", "'*'", ":", "$", "prefix", "="...
Outputs a message with a colored prefix. @param string $prefix The prefix. @param string $message The message.
[ "Outputs", "a", "message", "with", "a", "colored", "prefix", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Command/AbstractCommand.php#L49-L71
box-project/box2
src/lib/KevinGH/Box/Command/AbstractCommand.php
AbstractCommand.verbose
protected function verbose($message, $newline = false, $type = 0) { if ($this->isVerbose()) { $this->output->write($message, $newline, $type); } }
php
protected function verbose($message, $newline = false, $type = 0) { if ($this->isVerbose()) { $this->output->write($message, $newline, $type); } }
[ "protected", "function", "verbose", "(", "$", "message", ",", "$", "newline", "=", "false", ",", "$", "type", "=", "0", ")", "{", "if", "(", "$", "this", "->", "isVerbose", "(", ")", ")", "{", "$", "this", "->", "output", "->", "write", "(", "$",...
Writes the message only when verbosity is set to VERBOSITY_VERBOSE. @see OutputInterface#write
[ "Writes", "the", "message", "only", "when", "verbosity", "is", "set", "to", "VERBOSITY_VERBOSE", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Command/AbstractCommand.php#L78-L83
box-project/box2
src/lib/KevinGH/Box/Helper/ConfigurationHelper.php
ConfigurationHelper.getDefaultPath
public function getDefaultPath() { if (false === file_exists(self::FILE_NAME)) { if (false === file_exists(self::FILE_NAME . '.dist')) { throw new RuntimeException( sprintf('The configuration file could not be found.') ); } ...
php
public function getDefaultPath() { if (false === file_exists(self::FILE_NAME)) { if (false === file_exists(self::FILE_NAME . '.dist')) { throw new RuntimeException( sprintf('The configuration file could not be found.') ); } ...
[ "public", "function", "getDefaultPath", "(", ")", "{", "if", "(", "false", "===", "file_exists", "(", "self", "::", "FILE_NAME", ")", ")", "{", "if", "(", "false", "===", "file_exists", "(", "self", "::", "FILE_NAME", ".", "'.dist'", ")", ")", "{", "th...
Returns the file path to the default configuration file. @return string The file path. @throws RuntimeException If the default file does not exist.
[ "Returns", "the", "file", "path", "to", "the", "default", "configuration", "file", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Helper/ConfigurationHelper.php#L62-L75
box-project/box2
src/lib/KevinGH/Box/Helper/ConfigurationHelper.php
ConfigurationHelper.loadFile
public function loadFile($file = null) { if (null === $file) { $file = $this->getDefaultPath(); } $json = $this->json->decodeFile($file); if (isset($json->import)) { if (!Path::isAbsolute($json->import)) { $json->import = Path::join( ...
php
public function loadFile($file = null) { if (null === $file) { $file = $this->getDefaultPath(); } $json = $this->json->decodeFile($file); if (isset($json->import)) { if (!Path::isAbsolute($json->import)) { $json->import = Path::join( ...
[ "public", "function", "loadFile", "(", "$", "file", "=", "null", ")", "{", "if", "(", "null", "===", "$", "file", ")", "{", "$", "file", "=", "$", "this", "->", "getDefaultPath", "(", ")", ";", "}", "$", "json", "=", "$", "this", "->", "json", ...
Loads the configuration file and returns it. @param string $file The configuration file path. @return Configuration The configuration settings.
[ "Loads", "the", "configuration", "file", "and", "returns", "it", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Helper/ConfigurationHelper.php#L84-L114
box-project/box2
src/lib/KevinGH/Box/Command/Configurable.php
Configurable.getConfig
protected function getConfig(InputInterface $input) { /** @var $helper ConfigurationHelper */ $helper = $this->getHelper('config'); return $helper->loadFile($input->getOption('configuration')); }
php
protected function getConfig(InputInterface $input) { /** @var $helper ConfigurationHelper */ $helper = $this->getHelper('config'); return $helper->loadFile($input->getOption('configuration')); }
[ "protected", "function", "getConfig", "(", "InputInterface", "$", "input", ")", "{", "/** @var $helper ConfigurationHelper */", "$", "helper", "=", "$", "this", "->", "getHelper", "(", "'config'", ")", ";", "return", "$", "helper", "->", "loadFile", "(", "$", ...
Returns the configuration settings. @param InputInterface $input The input handler. @return Configuration The configuration settings.
[ "Returns", "the", "configuration", "settings", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Command/Configurable.php#L37-L43
box-project/box2
src/lib/KevinGH/Box/Command/Info.php
Info.contents
private function contents( OutputInterface $output, Traversable $list, $indent, $base, Phar $phar, $root ) { /** @var PharFileInfo $item */ foreach ($list as $item) { $item = $phar[str_replace($root, '', $item->getPathname())]; ...
php
private function contents( OutputInterface $output, Traversable $list, $indent, $base, Phar $phar, $root ) { /** @var PharFileInfo $item */ foreach ($list as $item) { $item = $phar[str_replace($root, '', $item->getPathname())]; ...
[ "private", "function", "contents", "(", "OutputInterface", "$", "output", ",", "Traversable", "$", "list", ",", "$", "indent", ",", "$", "base", ",", "Phar", "$", "phar", ",", "$", "root", ")", "{", "/** @var PharFileInfo $item */", "foreach", "(", "$", "l...
Renders the contents of an iterator. @param OutputInterface $output The output handler. @param Traversable $list The traversable list. @param boolean|integer $indent The indentation level. @param string $base The base path. @param Phar $phar The PHP archive. @param string $root ...
[ "Renders", "the", "contents", "of", "an", "iterator", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Command/Info.php#L159-L208
box-project/box2
src/lib/KevinGH/Box/Command/Info.php
Info.render
private function render(OutputInterface $output, array $attributes) { $out = false; foreach ($attributes as $name => $value) { if ($out) { $output->writeln(''); } $output->write("<comment>$name:</comment>"); if (is_array($value)) { ...
php
private function render(OutputInterface $output, array $attributes) { $out = false; foreach ($attributes as $name => $value) { if ($out) { $output->writeln(''); } $output->write("<comment>$name:</comment>"); if (is_array($value)) { ...
[ "private", "function", "render", "(", "OutputInterface", "$", "output", ",", "array", "$", "attributes", ")", "{", "$", "out", "=", "false", ";", "foreach", "(", "$", "attributes", "as", "$", "name", "=>", "$", "value", ")", "{", "if", "(", "$", "out...
Renders the list of attributes. @param OutputInterface $output The output. @param array $attributes The list of attributes.
[ "Renders", "the", "list", "of", "attributes", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Command/Info.php#L216-L239
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getBasePath
public function getBasePath() { if (isset($this->raw->{'base-path'})) { if (false === is_dir($this->raw->{'base-path'})) { throw new InvalidArgumentException( sprintf( 'The base path "%s" is not a directory or does not exist.', ...
php
public function getBasePath() { if (isset($this->raw->{'base-path'})) { if (false === is_dir($this->raw->{'base-path'})) { throw new InvalidArgumentException( sprintf( 'The base path "%s" is not a directory or does not exist.', ...
[ "public", "function", "getBasePath", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "{", "'base-path'", "}", ")", ")", "{", "if", "(", "false", "===", "is_dir", "(", "$", "this", "->", "raw", "->", "{", "'base-path'", "}", ...
Returns the base path. @return string The base path. @throws InvalidArgumentException If the base path is not valid.
[ "Returns", "the", "base", "path", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L71-L87
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getBinaryDirectories
public function getBinaryDirectories() { if (isset($this->raw->{'directories-bin'})) { $directories = (array) $this->raw->{'directories-bin'}; $base = $this->getBasePath(); array_walk( $directories, function (&$directory) use ($base) { ...
php
public function getBinaryDirectories() { if (isset($this->raw->{'directories-bin'})) { $directories = (array) $this->raw->{'directories-bin'}; $base = $this->getBasePath(); array_walk( $directories, function (&$directory) use ($base) { ...
[ "public", "function", "getBinaryDirectories", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "{", "'directories-bin'", "}", ")", ")", "{", "$", "directories", "=", "(", "array", ")", "$", "this", "->", "raw", "->", "{", "'dir...
Returns the list of relative directory paths for binary files. @return array The list of paths.
[ "Returns", "the", "list", "of", "relative", "directory", "paths", "for", "binary", "files", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L106-L125
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getBinaryDirectoriesIterator
public function getBinaryDirectoriesIterator() { if (array() !== ($directories = $this->getBinaryDirectories())) { return Finder::create() ->files() ->filter($this->getBlacklistFilter()) ->ignoreVCS(true) ->in($direc...
php
public function getBinaryDirectoriesIterator() { if (array() !== ($directories = $this->getBinaryDirectories())) { return Finder::create() ->files() ->filter($this->getBlacklistFilter()) ->ignoreVCS(true) ->in($direc...
[ "public", "function", "getBinaryDirectoriesIterator", "(", ")", "{", "if", "(", "array", "(", ")", "!==", "(", "$", "directories", "=", "$", "this", "->", "getBinaryDirectories", "(", ")", ")", ")", "{", "return", "Finder", "::", "create", "(", ")", "->"...
Returns the iterator for the binary directory paths. @return Finder The iterator.
[ "Returns", "the", "iterator", "for", "the", "binary", "directory", "paths", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L132-L143
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getBinaryFiles
public function getBinaryFiles() { if (isset($this->raw->{'files-bin'})) { $base = $this->getBasePath(); $files = array(); foreach ((array) $this->raw->{'files-bin'} as $file) { $files[] = new SplFileInfo( $base . DIRECTORY_SEPARATOR ....
php
public function getBinaryFiles() { if (isset($this->raw->{'files-bin'})) { $base = $this->getBasePath(); $files = array(); foreach ((array) $this->raw->{'files-bin'} as $file) { $files[] = new SplFileInfo( $base . DIRECTORY_SEPARATOR ....
[ "public", "function", "getBinaryFiles", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "{", "'files-bin'", "}", ")", ")", "{", "$", "base", "=", "$", "this", "->", "getBasePath", "(", ")", ";", "$", "files", "=", "array", ...
Returns the list of relative paths for binary files. @return array The list of paths.
[ "Returns", "the", "list", "of", "relative", "paths", "for", "binary", "files", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L150-L166
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getBlacklist
public function getBlacklist() { if (isset($this->raw->blacklist)) { $blacklist = (array) $this->raw->blacklist; array_walk( $blacklist, function (&$file) { $file = Path::canonical($file); } ); ...
php
public function getBlacklist() { if (isset($this->raw->blacklist)) { $blacklist = (array) $this->raw->blacklist; array_walk( $blacklist, function (&$file) { $file = Path::canonical($file); } ); ...
[ "public", "function", "getBlacklist", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "blacklist", ")", ")", "{", "$", "blacklist", "=", "(", "array", ")", "$", "this", "->", "raw", "->", "blacklist", ";", "array_walk", "(", ...
Returns the list of blacklisted relative file paths. @return array The list of paths.
[ "Returns", "the", "list", "of", "blacklisted", "relative", "file", "paths", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L201-L217
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getBlacklistFilter
public function getBlacklistFilter() { $blacklist = $this->getBlacklist(); $base = '/^' . preg_quote($this->getBasePath() . DIRECTORY_SEPARATOR, '/') . '/'; return function (SplFileInfo $file) use ($base, $blacklist) { $path = Path::canonical( ...
php
public function getBlacklistFilter() { $blacklist = $this->getBlacklist(); $base = '/^' . preg_quote($this->getBasePath() . DIRECTORY_SEPARATOR, '/') . '/'; return function (SplFileInfo $file) use ($base, $blacklist) { $path = Path::canonical( ...
[ "public", "function", "getBlacklistFilter", "(", ")", "{", "$", "blacklist", "=", "$", "this", "->", "getBlacklist", "(", ")", ";", "$", "base", "=", "'/^'", ".", "preg_quote", "(", "$", "this", "->", "getBasePath", "(", ")", ".", "DIRECTORY_SEPARATOR", ...
Returns a filter callable for the configured blacklist. @return callable The callable.
[ "Returns", "a", "filter", "callable", "for", "the", "configured", "blacklist", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L224-L242
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getBootstrapFile
public function getBootstrapFile() { if (isset($this->raw->bootstrap)) { $path = $this->raw->bootstrap; if (false === Path::isAbsolute($path)) { $path = Path::canonical( $this->getBasePath() . DIRECTORY_SEPARATOR . $path ); ...
php
public function getBootstrapFile() { if (isset($this->raw->bootstrap)) { $path = $this->raw->bootstrap; if (false === Path::isAbsolute($path)) { $path = Path::canonical( $this->getBasePath() . DIRECTORY_SEPARATOR . $path ); ...
[ "public", "function", "getBootstrapFile", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "bootstrap", ")", ")", "{", "$", "path", "=", "$", "this", "->", "raw", "->", "bootstrap", ";", "if", "(", "false", "===", "Path", "::...
Returns the bootstrap file path. @return string The file path.
[ "Returns", "the", "bootstrap", "file", "path", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L249-L264
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getCompactors
public function getCompactors() { $compactors = array(); if (isset($this->raw->compactors)) { foreach ((array) $this->raw->compactors as $class) { if (false === class_exists($class)) { throw new InvalidArgumentException( sprint...
php
public function getCompactors() { $compactors = array(); if (isset($this->raw->compactors)) { foreach ((array) $this->raw->compactors as $class) { if (false === class_exists($class)) { throw new InvalidArgumentException( sprint...
[ "public", "function", "getCompactors", "(", ")", "{", "$", "compactors", "=", "array", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "compactors", ")", ")", "{", "foreach", "(", "(", "array", ")", "$", "this", "->", "raw",...
Returns the list of file contents compactors. @return CompactorInterface[] The list of compactors. @throws InvalidArgumentException If a class is not valid.
[ "Returns", "the", "list", "of", "file", "contents", "compactors", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L273-L318
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getCompressionAlgorithm
public function getCompressionAlgorithm() { if (isset($this->raw->compression)) { if (is_string($this->raw->compression)) { if (false === defined('Phar::' . $this->raw->compression)) { throw new InvalidArgumentException( sprintf( ...
php
public function getCompressionAlgorithm() { if (isset($this->raw->compression)) { if (is_string($this->raw->compression)) { if (false === defined('Phar::' . $this->raw->compression)) { throw new InvalidArgumentException( sprintf( ...
[ "public", "function", "getCompressionAlgorithm", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "compression", ")", ")", "{", "if", "(", "is_string", "(", "$", "this", "->", "raw", "->", "compression", ")", ")", "{", "if", "(...
Returns the Phar compression algorithm. @return integer The compression algorithm. @throws InvalidArgumentException If the algorithm is not valid.
[ "Returns", "the", "Phar", "compression", "algorithm", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L327-L354
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getDirectories
public function getDirectories() { if (isset($this->raw->directories)) { $directories = (array) $this->raw->directories; $base = $this->getBasePath(); array_walk( $directories, function (&$directory) use ($base) { $dire...
php
public function getDirectories() { if (isset($this->raw->directories)) { $directories = (array) $this->raw->directories; $base = $this->getBasePath(); array_walk( $directories, function (&$directory) use ($base) { $dire...
[ "public", "function", "getDirectories", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "directories", ")", ")", "{", "$", "directories", "=", "(", "array", ")", "$", "this", "->", "raw", "->", "directories", ";", "$", "base",...
Returns the list of relative directory paths. @return array The list of paths.
[ "Returns", "the", "list", "of", "relative", "directory", "paths", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L361-L380
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getDirectoriesIterator
public function getDirectoriesIterator() { if (array() !== ($directories = $this->getDirectories())) { return Finder::create() ->files() ->filter($this->getBlacklistFilter()) ->ignoreVCS(true) ->in($directories); ...
php
public function getDirectoriesIterator() { if (array() !== ($directories = $this->getDirectories())) { return Finder::create() ->files() ->filter($this->getBlacklistFilter()) ->ignoreVCS(true) ->in($directories); ...
[ "public", "function", "getDirectoriesIterator", "(", ")", "{", "if", "(", "array", "(", ")", "!==", "(", "$", "directories", "=", "$", "this", "->", "getDirectories", "(", ")", ")", ")", "{", "return", "Finder", "::", "create", "(", ")", "->", "files",...
Returns the iterator for the directory paths. @return Finder The iterator.
[ "Returns", "the", "iterator", "for", "the", "directory", "paths", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L387-L398
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getFileMode
public function getFileMode() { if (isset($this->raw->chmod)) { return intval($this->raw->chmod, 8); } return null; }
php
public function getFileMode() { if (isset($this->raw->chmod)) { return intval($this->raw->chmod, 8); } return null; }
[ "public", "function", "getFileMode", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "chmod", ")", ")", "{", "return", "intval", "(", "$", "this", "->", "raw", "->", "chmod", ",", "8", ")", ";", "}", "return", "null", ";",...
Returns the file mode in octal form. @return integer The file mode.
[ "Returns", "the", "file", "mode", "in", "octal", "form", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L405-L412
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getFiles
public function getFiles() { if (isset($this->raw->files)) { $base = $this->getBasePath(); $files = array(); foreach ((array) $this->raw->files as $file) { $file = new SplFileInfo( $path = $base . DIRECTORY_SEPARATOR . Path::canonical(...
php
public function getFiles() { if (isset($this->raw->files)) { $base = $this->getBasePath(); $files = array(); foreach ((array) $this->raw->files as $file) { $file = new SplFileInfo( $path = $base . DIRECTORY_SEPARATOR . Path::canonical(...
[ "public", "function", "getFiles", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "files", ")", ")", "{", "$", "base", "=", "$", "this", "->", "getBasePath", "(", ")", ";", "$", "files", "=", "array", "(", ")", ";", "for...
Returns the list of relative file paths. @return array The list of paths. @throws RuntimeException If one of the files does not exist.
[ "Returns", "the", "list", "of", "relative", "file", "paths", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L421-L448
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getFinders
public function getFinders() { if (isset($this->raw->finder)) { return $this->processFinders($this->raw->finder); } return array(); }
php
public function getFinders() { if (isset($this->raw->finder)) { return $this->processFinders($this->raw->finder); } return array(); }
[ "public", "function", "getFinders", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "finder", ")", ")", "{", "return", "$", "this", "->", "processFinders", "(", "$", "this", "->", "raw", "->", "finder", ")", ";", "}", "retur...
Returns the list of configured Finder instances. @return Finder[] The list of Finders.
[ "Returns", "the", "list", "of", "configured", "Finder", "instances", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L469-L476
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getGitVersion
public function getGitVersion() { try { return $this->getGitTag(); } catch (RuntimeException $exception) { try { return $this->getGitHash(true); } catch (RuntimeException $exception) { throw new RuntimeException( ...
php
public function getGitVersion() { try { return $this->getGitTag(); } catch (RuntimeException $exception) { try { return $this->getGitHash(true); } catch (RuntimeException $exception) { throw new RuntimeException( ...
[ "public", "function", "getGitVersion", "(", ")", "{", "try", "{", "return", "$", "this", "->", "getGitTag", "(", ")", ";", "}", "catch", "(", "RuntimeException", "$", "exception", ")", "{", "try", "{", "return", "$", "this", "->", "getGitHash", "(", "t...
Returns the Git tag name or short commit hash. @return string The tag name or short commit hash. @throws RuntimeException If the version could not be retrieved.
[ "Returns", "the", "Git", "tag", "name", "or", "short", "commit", "hash", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L584-L603
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getMainScriptContents
public function getMainScriptContents() { if (null !== ($path = $this->getMainScriptPath())) { $path = $this->getBasePath() . DIRECTORY_SEPARATOR . $path; if (false === ($contents = @file_get_contents($path))) { $errors = error_get_last(); if ($errors...
php
public function getMainScriptContents() { if (null !== ($path = $this->getMainScriptPath())) { $path = $this->getBasePath() . DIRECTORY_SEPARATOR . $path; if (false === ($contents = @file_get_contents($path))) { $errors = error_get_last(); if ($errors...
[ "public", "function", "getMainScriptContents", "(", ")", "{", "if", "(", "null", "!==", "(", "$", "path", "=", "$", "this", "->", "getMainScriptPath", "(", ")", ")", ")", "{", "$", "path", "=", "$", "this", "->", "getBasePath", "(", ")", ".", "DIRECT...
Returns the processed contents of the main script file. @return string The contents. @throws RuntimeException If the file could not be read.
[ "Returns", "the", "processed", "contents", "of", "the", "main", "script", "file", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L626-L644
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getMainScriptPath
public function getMainScriptPath() { if (isset($this->raw->main)) { return Path::canonical($this->raw->main); } return null; }
php
public function getMainScriptPath() { if (isset($this->raw->main)) { return Path::canonical($this->raw->main); } return null; }
[ "public", "function", "getMainScriptPath", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "main", ")", ")", "{", "return", "Path", "::", "canonical", "(", "$", "this", "->", "raw", "->", "main", ")", ";", "}", "return", "nu...
Returns the main script file path. @return string The file path.
[ "Returns", "the", "main", "script", "file", "path", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L651-L658
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getMap
public function getMap() { if (isset($this->raw->map)) { $map = array(); foreach ((array) $this->raw->map as $item) { $processed = array(); foreach ($item as $match => $replace) { $processed[Path::canonical($match)] = Path::canoni...
php
public function getMap() { if (isset($this->raw->map)) { $map = array(); foreach ((array) $this->raw->map as $item) { $processed = array(); foreach ($item as $match => $replace) { $processed[Path::canonical($match)] = Path::canoni...
[ "public", "function", "getMap", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "map", ")", ")", "{", "$", "map", "=", "array", "(", ")", ";", "foreach", "(", "(", "array", ")", "$", "this", "->", "raw", "->", "map", "...
Returns the internal file path mapping. @return array The mapping.
[ "Returns", "the", "internal", "file", "path", "mapping", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L665-L690
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getMapper
public function getMapper() { $map = $this->getMap(); return function ($path) use ($map) { foreach ($map as $item) { foreach ($item as $match => $replace) { if (empty($match)) { return $replace . $path; } el...
php
public function getMapper() { $map = $this->getMap(); return function ($path) use ($map) { foreach ($map as $item) { foreach ($item as $match => $replace) { if (empty($match)) { return $replace . $path; } el...
[ "public", "function", "getMapper", "(", ")", "{", "$", "map", "=", "$", "this", "->", "getMap", "(", ")", ";", "return", "function", "(", "$", "path", ")", "use", "(", "$", "map", ")", "{", "foreach", "(", "$", "map", "as", "$", "item", ")", "{...
Returns a mapping callable for the configured map. @return callable The mapping callable.
[ "Returns", "a", "mapping", "callable", "for", "the", "configured", "map", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L697-L718
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getMetadata
public function getMetadata() { if (isset($this->raw->metadata)) { if (is_object($this->raw->metadata)) { return (array) $this->raw->metadata; } return $this->raw->metadata; } return null; }
php
public function getMetadata() { if (isset($this->raw->metadata)) { if (is_object($this->raw->metadata)) { return (array) $this->raw->metadata; } return $this->raw->metadata; } return null; }
[ "public", "function", "getMetadata", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "metadata", ")", ")", "{", "if", "(", "is_object", "(", "$", "this", "->", "raw", "->", "metadata", ")", ")", "{", "return", "(", "array", ...
Returns the Phar metadata. @return mixed The metadata.
[ "Returns", "the", "Phar", "metadata", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L725-L736
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getOutputPath
public function getOutputPath() { $base = getcwd() . DIRECTORY_SEPARATOR; if (isset($this->raw->output)) { $path = $this->raw->output; if (false === Path::isAbsolute($path)) { $path = Path::canonical($base . $path); } } else { ...
php
public function getOutputPath() { $base = getcwd() . DIRECTORY_SEPARATOR; if (isset($this->raw->output)) { $path = $this->raw->output; if (false === Path::isAbsolute($path)) { $path = Path::canonical($base . $path); } } else { ...
[ "public", "function", "getOutputPath", "(", ")", "{", "$", "base", "=", "getcwd", "(", ")", ".", "DIRECTORY_SEPARATOR", ";", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "output", ")", ")", "{", "$", "path", "=", "$", "this", "->", "raw...
Returns the output file path. @return string The file path.
[ "Returns", "the", "output", "file", "path", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L785-L804
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getPrivateKeyPassphrase
public function getPrivateKeyPassphrase() { if (isset($this->raw->{'key-pass'}) && is_string($this->raw->{'key-pass'})) { return $this->raw->{'key-pass'}; } return null; }
php
public function getPrivateKeyPassphrase() { if (isset($this->raw->{'key-pass'}) && is_string($this->raw->{'key-pass'})) { return $this->raw->{'key-pass'}; } return null; }
[ "public", "function", "getPrivateKeyPassphrase", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "{", "'key-pass'", "}", ")", "&&", "is_string", "(", "$", "this", "->", "raw", "->", "{", "'key-pass'", "}", ")", ")", "{", "retu...
Returns the private key passphrase. @return string The passphrase.
[ "Returns", "the", "private", "key", "passphrase", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L811-L819
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getProcessedReplacements
public function getProcessedReplacements() { $values = $this->getReplacements(); if (null !== ($git = $this->getGitHashPlaceholder())) { $values[$git] = $this->getGitHash(); } if (null !== ($git = $this->getGitShortHashPlaceholder())) { $values[$git] = $this...
php
public function getProcessedReplacements() { $values = $this->getReplacements(); if (null !== ($git = $this->getGitHashPlaceholder())) { $values[$git] = $this->getGitHash(); } if (null !== ($git = $this->getGitShortHashPlaceholder())) { $values[$git] = $this...
[ "public", "function", "getProcessedReplacements", "(", ")", "{", "$", "values", "=", "$", "this", "->", "getReplacements", "(", ")", ";", "if", "(", "null", "!==", "(", "$", "git", "=", "$", "this", "->", "getGitHashPlaceholder", "(", ")", ")", ")", "{...
Returns the processed list of replacement placeholders and their values. @return array The list of replacements.
[ "Returns", "the", "processed", "list", "of", "replacement", "placeholders", "and", "their", "values", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L840-L873
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getShebang
public function getShebang() { if (isset($this->raw->shebang)) { if (('' === $this->raw->shebang) || (false === $this->raw->shebang)) { return ''; } $shebang = trim($this->raw->shebang); if ('#!' !== substr($shebang, 0, 2)) { ...
php
public function getShebang() { if (isset($this->raw->shebang)) { if (('' === $this->raw->shebang) || (false === $this->raw->shebang)) { return ''; } $shebang = trim($this->raw->shebang); if ('#!' !== substr($shebang, 0, 2)) { ...
[ "public", "function", "getShebang", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "shebang", ")", ")", "{", "if", "(", "(", "''", "===", "$", "this", "->", "raw", "->", "shebang", ")", "||", "(", "false", "===", "$", "...
Returns the shebang line. @return string The shebang line. @throws InvalidArgumentException If the shebang line is no valid.
[ "Returns", "the", "shebang", "line", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L910-L932
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getSigningAlgorithm
public function getSigningAlgorithm() { if (isset($this->raw->algorithm)) { if (is_string($this->raw->algorithm)) { if (false === defined('Phar::' . $this->raw->algorithm)) { throw new InvalidArgumentException( sprintf( ...
php
public function getSigningAlgorithm() { if (isset($this->raw->algorithm)) { if (is_string($this->raw->algorithm)) { if (false === defined('Phar::' . $this->raw->algorithm)) { throw new InvalidArgumentException( sprintf( ...
[ "public", "function", "getSigningAlgorithm", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "algorithm", ")", ")", "{", "if", "(", "is_string", "(", "$", "this", "->", "raw", "->", "algorithm", ")", ")", "{", "if", "(", "fa...
Returns the Phar signing algorithm. @return integer The signing algorithm. @throws InvalidArgumentException If the algorithm is not valid.
[ "Returns", "the", "Phar", "signing", "algorithm", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L941-L961
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getStubBannerFromFile
public function getStubBannerFromFile() { if (null !== ($path = $this->getStubBannerPath())) { $path = $this->getBasePath() . DIRECTORY_SEPARATOR . $path; if (false === ($contents = @file_get_contents($path))) { $errors = error_get_last(); if ($errors...
php
public function getStubBannerFromFile() { if (null !== ($path = $this->getStubBannerPath())) { $path = $this->getBasePath() . DIRECTORY_SEPARATOR . $path; if (false === ($contents = @file_get_contents($path))) { $errors = error_get_last(); if ($errors...
[ "public", "function", "getStubBannerFromFile", "(", ")", "{", "if", "(", "null", "!==", "(", "$", "path", "=", "$", "this", "->", "getStubBannerPath", "(", ")", ")", ")", "{", "$", "path", "=", "$", "this", "->", "getBasePath", "(", ")", ".", "DIRECT...
Returns the stub banner comment from the file. @return string The stub banner comment. @throws RuntimeException If the comment file could not be read.
[ "Returns", "the", "stub", "banner", "comment", "from", "the", "file", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L984-L1002
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.getStubPath
public function getStubPath() { if (isset($this->raw->stub) && is_string($this->raw->stub)) { return $this->raw->stub; } return null; }
php
public function getStubPath() { if (isset($this->raw->stub) && is_string($this->raw->stub)) { return $this->raw->stub; } return null; }
[ "public", "function", "getStubPath", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "stub", ")", "&&", "is_string", "(", "$", "this", "->", "raw", "->", "stub", ")", ")", "{", "return", "$", "this", "->", "raw", "->", "st...
Returns the Phar stub file path. @return string The file path.
[ "Returns", "the", "Phar", "stub", "file", "path", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L1022-L1029
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.isStubGenerated
public function isStubGenerated() { if (isset($this->raw->stub) && (true === $this->raw->stub)) { return true; } return false; }
php
public function isStubGenerated() { if (isset($this->raw->stub) && (true === $this->raw->stub)) { return true; } return false; }
[ "public", "function", "isStubGenerated", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "raw", "->", "stub", ")", "&&", "(", "true", "===", "$", "this", "->", "raw", "->", "stub", ")", ")", "{", "return", "true", ";", "}", "return", "...
Checks if the Phar stub should be generated. @return boolean TRUE if it should be generated, FALSE if not.
[ "Checks", "if", "the", "Phar", "stub", "should", "be", "generated", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L1079-L1086
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.loadBootstrap
public function loadBootstrap() { if (null !== ($file = $this->getBootstrapFile())) { if (false === file_exists($file)) { throw new InvalidArgumentException( sprintf( 'The bootstrap path "%s" is not a file or does not exist.', ...
php
public function loadBootstrap() { if (null !== ($file = $this->getBootstrapFile())) { if (false === file_exists($file)) { throw new InvalidArgumentException( sprintf( 'The bootstrap path "%s" is not a file or does not exist.', ...
[ "public", "function", "loadBootstrap", "(", ")", "{", "if", "(", "null", "!==", "(", "$", "file", "=", "$", "this", "->", "getBootstrapFile", "(", ")", ")", ")", "{", "if", "(", "false", "===", "file_exists", "(", "$", "file", ")", ")", "{", "throw...
Loads the configured bootstrap file if available.
[ "Loads", "the", "configured", "bootstrap", "file", "if", "available", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L1105-L1120
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.processFinders
private function processFinders(array $config) { $finders = array(); $filter = $this->getBlacklistFilter(); foreach ($config as $methods) { $finder = Finder::create() ->files() ->filter($filter) ->ignoreVCS(...
php
private function processFinders(array $config) { $finders = array(); $filter = $this->getBlacklistFilter(); foreach ($config as $methods) { $finder = Finder::create() ->files() ->filter($filter) ->ignoreVCS(...
[ "private", "function", "processFinders", "(", "array", "$", "config", ")", "{", "$", "finders", "=", "array", "(", ")", ";", "$", "filter", "=", "$", "this", "->", "getBlacklistFilter", "(", ")", ";", "foreach", "(", "$", "config", "as", "$", "methods"...
Processes the Finders configuration list. @param array $config The configuration. @return Finder[] The list of Finders. @throws InvalidArgumentException If the configured method does not exist.
[ "Processes", "the", "Finders", "configuration", "list", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L1131-L1177
box-project/box2
src/lib/KevinGH/Box/Configuration.php
Configuration.runGitCommand
private function runGitCommand($command) { $path = dirname($this->file); $process = new Process($command, $path); if (0 === $process->run()) { return trim($process->getOutput()); } throw new RuntimeException( sprintf( 'The tag or comm...
php
private function runGitCommand($command) { $path = dirname($this->file); $process = new Process($command, $path); if (0 === $process->run()) { return trim($process->getOutput()); } throw new RuntimeException( sprintf( 'The tag or comm...
[ "private", "function", "runGitCommand", "(", "$", "command", ")", "{", "$", "path", "=", "dirname", "(", "$", "this", "->", "file", ")", ";", "$", "process", "=", "new", "Process", "(", "$", "command", ",", "$", "path", ")", ";", "if", "(", "0", ...
Runs a Git command on the repository. @param string $command The command. @return string The trimmed output from the command. @throws RuntimeException If the command failed.
[ "Runs", "a", "Git", "command", "on", "the", "repository", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Configuration.php#L1188-L1204
box-project/box2
src/lib/KevinGH/Box/Command/Build.php
Build.add
private function add( Traversable $iterator = null, $message = null, $binary = false ) { static $count = 0; if ($iterator) { if ($message) { $this->putln('?', $message); } $box = $binary ? $this->box->getPhar() : $this->bo...
php
private function add( Traversable $iterator = null, $message = null, $binary = false ) { static $count = 0; if ($iterator) { if ($message) { $this->putln('?', $message); } $box = $binary ? $this->box->getPhar() : $this->bo...
[ "private", "function", "add", "(", "Traversable", "$", "iterator", "=", "null", ",", "$", "message", "=", "null", ",", "$", "binary", "=", "false", ")", "{", "static", "$", "count", "=", "0", ";", "if", "(", "$", "iterator", ")", "{", "if", "(", ...
Adds files using an iterator. @param Traversable $iterator The iterator. @param string $message The message to announce. @param boolean $binary Should the adding be binary-safe? @throws RuntimeException If a file is not readable.
[ "Adds", "files", "using", "an", "iterator", "." ]
train
https://github.com/box-project/box2/blob/740f8ce7742f523056e38cb2cb077f2edb32e5af/src/lib/KevinGH/Box/Command/Build.php#L651-L699
spatie/laravel-googletagmanager
src/GoogleTagManagerMiddleware.php
GoogleTagManagerMiddleware.handle
public function handle($request, Closure $next) { if ($this->session->has($this->sessionKey)) { $this->googleTagManager->set($this->session->get($this->sessionKey)); } $response = $next($request); $this->session->flash($this->sessionKey, $this->googleTagManager->getFlas...
php
public function handle($request, Closure $next) { if ($this->session->has($this->sessionKey)) { $this->googleTagManager->set($this->session->get($this->sessionKey)); } $response = $next($request); $this->session->flash($this->sessionKey, $this->googleTagManager->getFlas...
[ "public", "function", "handle", "(", "$", "request", ",", "Closure", "$", "next", ")", "{", "if", "(", "$", "this", "->", "session", "->", "has", "(", "$", "this", "->", "sessionKey", ")", ")", "{", "$", "this", "->", "googleTagManager", "->", "set",...
Handle an incoming request. @param \Illuminate\Http\Request $request @param \Closure $next @return mixed
[ "Handle", "an", "incoming", "request", "." ]
train
https://github.com/spatie/laravel-googletagmanager/blob/8e58e47767df0484055b415ec49dc7ef42bc3a9c/src/GoogleTagManagerMiddleware.php#L46-L57
spatie/laravel-googletagmanager
src/GoogleTagManager.php
GoogleTagManager.push
public function push($key, $value = null) { $pushItem = new DataLayer(); $pushItem->set($key, $value); $this->pushDataLayer->push($pushItem); }
php
public function push($key, $value = null) { $pushItem = new DataLayer(); $pushItem->set($key, $value); $this->pushDataLayer->push($pushItem); }
[ "public", "function", "push", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "$", "pushItem", "=", "new", "DataLayer", "(", ")", ";", "$", "pushItem", "->", "set", "(", "$", "key", ",", "$", "value", ")", ";", "$", "this", "->", "pu...
Add data to be pushed to the data layer. @param array|string $key @param mixed $value
[ "Add", "data", "to", "be", "pushed", "to", "the", "data", "layer", "." ]
train
https://github.com/spatie/laravel-googletagmanager/blob/8e58e47767df0484055b415ec49dc7ef42bc3a9c/src/GoogleTagManager.php#L140-L145
spatie/laravel-googletagmanager
src/GoogleTagManagerServiceProvider.php
GoogleTagManagerServiceProvider.boot
public function boot() { $this->loadViewsFrom(__DIR__.'/../resources/views', 'googletagmanager'); $this->publishes([ __DIR__.'/../resources/config/config.php' => config_path('googletagmanager.php'), ], 'config'); $this->publishes([ __DIR__.'/../resources/vie...
php
public function boot() { $this->loadViewsFrom(__DIR__.'/../resources/views', 'googletagmanager'); $this->publishes([ __DIR__.'/../resources/config/config.php' => config_path('googletagmanager.php'), ], 'config'); $this->publishes([ __DIR__.'/../resources/vie...
[ "public", "function", "boot", "(", ")", "{", "$", "this", "->", "loadViewsFrom", "(", "__DIR__", ".", "'/../resources/views'", ",", "'googletagmanager'", ")", ";", "$", "this", "->", "publishes", "(", "[", "__DIR__", ".", "'/../resources/config/config.php'", "=>...
Bootstrap the application services.
[ "Bootstrap", "the", "application", "services", "." ]
train
https://github.com/spatie/laravel-googletagmanager/blob/8e58e47767df0484055b415ec49dc7ef42bc3a9c/src/GoogleTagManagerServiceProvider.php#L13-L29
spatie/laravel-googletagmanager
src/GoogleTagManagerServiceProvider.php
GoogleTagManagerServiceProvider.register
public function register() { $this->mergeConfigFrom(__DIR__.'/../resources/config/config.php', 'googletagmanager'); $googleTagManager = new GoogleTagManager(config('googletagmanager.id')); if (config('googletagmanager.enabled') === false) { $googleTagManager->disable(); ...
php
public function register() { $this->mergeConfigFrom(__DIR__.'/../resources/config/config.php', 'googletagmanager'); $googleTagManager = new GoogleTagManager(config('googletagmanager.id')); if (config('googletagmanager.enabled') === false) { $googleTagManager->disable(); ...
[ "public", "function", "register", "(", ")", "{", "$", "this", "->", "mergeConfigFrom", "(", "__DIR__", ".", "'/../resources/config/config.php'", ",", "'googletagmanager'", ")", ";", "$", "googleTagManager", "=", "new", "GoogleTagManager", "(", "config", "(", "'goo...
Register the application services.
[ "Register", "the", "application", "services", "." ]
train
https://github.com/spatie/laravel-googletagmanager/blob/8e58e47767df0484055b415ec49dc7ef42bc3a9c/src/GoogleTagManagerServiceProvider.php#L34-L50
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINean8.php
CINean8.draw
public function draw($im) { // Checksum $this->calculateChecksum(); $temp_text = $this->text . $this->keys[$this->checksumValue]; // Starting Code $this->drawChar($im, '000', true); // Draw First 4 Chars (Left-Hand) for ($i = 0; $i < 4; $i++) { ...
php
public function draw($im) { // Checksum $this->calculateChecksum(); $temp_text = $this->text . $this->keys[$this->checksumValue]; // Starting Code $this->drawChar($im, '000', true); // Draw First 4 Chars (Left-Hand) for ($i = 0; $i < 4; $i++) { ...
[ "public", "function", "draw", "(", "$", "im", ")", "{", "// Checksum\r", "$", "this", "->", "calculateChecksum", "(", ")", ";", "$", "temp_text", "=", "$", "this", "->", "text", ".", "$", "this", "->", "keys", "[", "$", "this", "->", "checksumValue", ...
Draws the barcode. @param resource $im
[ "Draws", "the", "barcode", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINean8.php#L58-L87
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINean8.php
CINean8.getDimension
public function getDimension($w, $h) { $startlength = 3; $centerlength = 5; $textlength = 8 * 7; $endlength = 3; $w += $startlength + $centerlength + $textlength + $endlength; $h += $this->thickness; return parent::getDimension($w, $h); }
php
public function getDimension($w, $h) { $startlength = 3; $centerlength = 5; $textlength = 8 * 7; $endlength = 3; $w += $startlength + $centerlength + $textlength + $endlength; $h += $this->thickness; return parent::getDimension($w, $h); }
[ "public", "function", "getDimension", "(", "$", "w", ",", "$", "h", ")", "{", "$", "startlength", "=", "3", ";", "$", "centerlength", "=", "5", ";", "$", "textlength", "=", "8", "*", "7", ";", "$", "endlength", "=", "3", ";", "$", "w", "+=", "$...
Returns the maximal size of a barcode. @param int $w @param int $h @return int[]
[ "Returns", "the", "maximal", "size", "of", "a", "barcode", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINean8.php#L96-L105
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINean8.php
CINean8.addDefaultLabel
protected function addDefaultLabel() { if ($this->isDefaultEanLabelEnabled()) { $this->processChecksum(); $label = $this->getLabel(); $font = $this->font; $this->labelLeft = new CINLabel(substr($label, 0, 4), $font, CINLabel::POSITION_BOTTOM, CINLabel::ALIG...
php
protected function addDefaultLabel() { if ($this->isDefaultEanLabelEnabled()) { $this->processChecksum(); $label = $this->getLabel(); $font = $this->font; $this->labelLeft = new CINLabel(substr($label, 0, 4), $font, CINLabel::POSITION_BOTTOM, CINLabel::ALIG...
[ "protected", "function", "addDefaultLabel", "(", ")", "{", "if", "(", "$", "this", "->", "isDefaultEanLabelEnabled", "(", ")", ")", "{", "$", "this", "->", "processChecksum", "(", ")", ";", "$", "label", "=", "$", "this", "->", "getLabel", "(", ")", ";...
Adds the default label.
[ "Adds", "the", "default", "label", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINean8.php#L110-L127
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINean8.php
CINean8.isDefaultEanLabelEnabled
protected function isDefaultEanLabelEnabled() { $label = $this->getLabel(); $font = $this->font; return $label !== null && $label !== '' && $font !== null && $this->defaultLabel !== null; }
php
protected function isDefaultEanLabelEnabled() { $label = $this->getLabel(); $font = $this->font; return $label !== null && $label !== '' && $font !== null && $this->defaultLabel !== null; }
[ "protected", "function", "isDefaultEanLabelEnabled", "(", ")", "{", "$", "label", "=", "$", "this", "->", "getLabel", "(", ")", ";", "$", "font", "=", "$", "this", "->", "font", ";", "return", "$", "label", "!==", "null", "&&", "$", "label", "!==", "...
Checks if the default ean label is enabled. @return bool
[ "Checks", "if", "the", "default", "ean", "label", "is", "enabled", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINean8.php#L134-L138
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINean8.php
CINean8.processChecksum
protected function processChecksum() { if ($this->checksumValue === false) { // Calculate the checksum only once $this->calculateChecksum(); } if ($this->checksumValue !== false) { return $this->keys[$this->checksumValue]; } return false; }
php
protected function processChecksum() { if ($this->checksumValue === false) { // Calculate the checksum only once $this->calculateChecksum(); } if ($this->checksumValue !== false) { return $this->keys[$this->checksumValue]; } return false; }
[ "protected", "function", "processChecksum", "(", ")", "{", "if", "(", "$", "this", "->", "checksumValue", "===", "false", ")", "{", "// Calculate the checksum only once\r", "$", "this", "->", "calculateChecksum", "(", ")", ";", "}", "if", "(", "$", "this", "...
Overloaded method to display the checksum.
[ "Overloaded", "method", "to", "display", "the", "checksum", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINean8.php#L201-L211
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINcodabar.php
CINcodabar.draw
public function draw($im) { $c = strlen($this->text); for ($i = 0; $i < $c; $i++) { $this->drawChar($im, $this->findCode($this->text[$i]), true); } $this->drawText($im, 0, 0, $this->positionX, $this->thickness); }
php
public function draw($im) { $c = strlen($this->text); for ($i = 0; $i < $c; $i++) { $this->drawChar($im, $this->findCode($this->text[$i]), true); } $this->drawText($im, 0, 0, $this->positionX, $this->thickness); }
[ "public", "function", "draw", "(", "$", "im", ")", "{", "$", "c", "=", "strlen", "(", "$", "this", "->", "text", ")", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "c", ";", "$", "i", "++", ")", "{", "$", "this", "->", "...
Draws the barcode. @param resource $im
[ "Draws", "the", "barcode", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINcodabar.php#L62-L69
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINcodabar.php
CINcodabar.getDimension
public function getDimension($w, $h) { $textLength = 0; $c = strlen($this->text); for ($i = 0; $i < $c; $i++) { $index = $this->findIndex($this->text[$i]); if ($index !== false) { $textLength += 8; $textLength += substr_count($this->...
php
public function getDimension($w, $h) { $textLength = 0; $c = strlen($this->text); for ($i = 0; $i < $c; $i++) { $index = $this->findIndex($this->text[$i]); if ($index !== false) { $textLength += 8; $textLength += substr_count($this->...
[ "public", "function", "getDimension", "(", "$", "w", ",", "$", "h", ")", "{", "$", "textLength", "=", "0", ";", "$", "c", "=", "strlen", "(", "$", "this", "->", "text", ")", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "c",...
Returns the maximal size of a barcode. @param int $w @param int $h @return int[]
[ "Returns", "the", "maximal", "size", "of", "a", "barcode", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINcodabar.php#L78-L92
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINcodabar.php
CINcodabar.validate
protected function validate() { $c = strlen($this->text); if ($c === 0) { throw new CINParseException('codabar', 'No data has been entered.'); } // Checking if all chars are allowed for ($i = 0; $i < $c; $i++) { if (array_search($this->text[$i], $...
php
protected function validate() { $c = strlen($this->text); if ($c === 0) { throw new CINParseException('codabar', 'No data has been entered.'); } // Checking if all chars are allowed for ($i = 0; $i < $c; $i++) { if (array_search($this->text[$i], $...
[ "protected", "function", "validate", "(", ")", "{", "$", "c", "=", "strlen", "(", "$", "this", "->", "text", ")", ";", "if", "(", "$", "c", "===", "0", ")", "{", "throw", "new", "CINParseException", "(", "'codabar'", ",", "'No data has been entered.'", ...
Validates the input.
[ "Validates", "the", "input", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINcodabar.php#L97-L122
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINcode39extended.php
CINcode39extended.getDimension
public function getDimension($w, $h) { $textlength = 13 * count($this->data); $startlength = 13; $checksumlength = 0; if ($this->checksum === true) { $checksumlength = 13; } $endlength = 13; $w += $startlength + $textlength + $checksumlengt...
php
public function getDimension($w, $h) { $textlength = 13 * count($this->data); $startlength = 13; $checksumlength = 0; if ($this->checksum === true) { $checksumlength = 13; } $endlength = 13; $w += $startlength + $textlength + $checksumlengt...
[ "public", "function", "getDimension", "(", "$", "w", ",", "$", "h", ")", "{", "$", "textlength", "=", "13", "*", "count", "(", "$", "this", "->", "data", ")", ";", "$", "startlength", "=", "13", ";", "$", "checksumlength", "=", "0", ";", "if", "(...
Returns the maximal size of a barcode. @param int $w @param int $h @return int[]
[ "Returns", "the", "maximal", "size", "of", "a", "barcode", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINcode39extended.php#L119-L132
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINcode39extended.php
CINcode39extended.setData
private function setData($data) { $this->indcheck = $data[0]; $this->data = $data[1]; $this->calculateChecksum(); }
php
private function setData($data) { $this->indcheck = $data[0]; $this->data = $data[1]; $this->calculateChecksum(); }
[ "private", "function", "setData", "(", "$", "data", ")", "{", "$", "this", "->", "indcheck", "=", "$", "data", "[", "0", "]", ";", "$", "this", "->", "data", "=", "$", "data", "[", "1", "]", ";", "$", "this", "->", "calculateChecksum", "(", ")", ...
Saves data into the classes. This method will save data, calculate real column number (if -1 was selected), the real error level (if -1 was selected)... It will add Padding to the end and generate the error codes. @param array $data
[ "Saves", "data", "into", "the", "classes", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINcode39extended.php#L169-L173
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINcode39extended.php
CINcode39extended.getExtendedVersion
private static function getExtendedVersion($char) { $o = ord($char); if ($o === 0) { return '%U'; } elseif ($o >= 1 && $o <= 26) { return '$' . chr($o + 64); } elseif (($o >= 33 && $o <= 44) || $o === 47 || $o === 48) { return '/' . chr($o + 32)...
php
private static function getExtendedVersion($char) { $o = ord($char); if ($o === 0) { return '%U'; } elseif ($o >= 1 && $o <= 26) { return '$' . chr($o + 64); } elseif (($o >= 33 && $o <= 44) || $o === 47 || $o === 48) { return '/' . chr($o + 32)...
[ "private", "static", "function", "getExtendedVersion", "(", "$", "char", ")", "{", "$", "o", "=", "ord", "(", "$", "char", ")", ";", "if", "(", "$", "o", "===", "0", ")", "{", "return", "'%U'", ";", "}", "elseif", "(", "$", "o", ">=", "1", "&&"...
Returns the extended reprensentation of the character. @param string $char @return string
[ "Returns", "the", "extended", "reprensentation", "of", "the", "character", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINcode39extended.php#L181-L208
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINcode93.php
CINcode93.parse
public function parse($text) { $this->text = $text; $data = array(); $indcheck = array(); $c = strlen($this->text); for ($i = 0; $i < $c; $i++) { $pos = array_search($this->text[$i], $this->keys); if ($pos === false) { // Search...
php
public function parse($text) { $this->text = $text; $data = array(); $indcheck = array(); $c = strlen($this->text); for ($i = 0; $i < $c; $i++) { $pos = array_search($this->text[$i], $this->keys); if ($pos === false) { // Search...
[ "public", "function", "parse", "(", "$", "text", ")", "{", "$", "this", "->", "text", "=", "$", "text", ";", "$", "data", "=", "array", "(", ")", ";", "$", "indcheck", "=", "array", "(", ")", ";", "$", "c", "=", "strlen", "(", "$", "this", "-...
Parses the text before displaying it. @param mixed $text
[ "Parses", "the", "text", "before", "displaying", "it", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINcode93.php#L94-L139
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINcode93.php
CINcode93.draw
public function draw($im) { // Starting * $this->drawChar($im, $this->code[$this->starting], true); $c = count($this->data); for ($i = 0; $i < $c; $i++) { $this->drawChar($im, $this->data[$i], true); } // Checksum $c = count($this->checksumVa...
php
public function draw($im) { // Starting * $this->drawChar($im, $this->code[$this->starting], true); $c = count($this->data); for ($i = 0; $i < $c; $i++) { $this->drawChar($im, $this->data[$i], true); } // Checksum $c = count($this->checksumVa...
[ "public", "function", "draw", "(", "$", "im", ")", "{", "// Starting *\r", "$", "this", "->", "drawChar", "(", "$", "im", ",", "$", "this", "->", "code", "[", "$", "this", "->", "starting", "]", ",", "true", ")", ";", "$", "c", "=", "count", "(",...
Draws the barcode. @param resource $im
[ "Draws", "the", "barcode", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINcode93.php#L146-L166
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINcode93.php
CINcode93.getDimension
public function getDimension($w, $h) { $startlength = 9; $textlength = 9 * count($this->data); $checksumlength = 2 * 9; $endlength = 9 + 1; // + final bar $w += $startlength + $textlength + $checksumlength + $endlength; $h += $this->thickness; return pare...
php
public function getDimension($w, $h) { $startlength = 9; $textlength = 9 * count($this->data); $checksumlength = 2 * 9; $endlength = 9 + 1; // + final bar $w += $startlength + $textlength + $checksumlength + $endlength; $h += $this->thickness; return pare...
[ "public", "function", "getDimension", "(", "$", "w", ",", "$", "h", ")", "{", "$", "startlength", "=", "9", ";", "$", "textlength", "=", "9", "*", "count", "(", "$", "this", "->", "data", ")", ";", "$", "checksumlength", "=", "2", "*", "9", ";", ...
Returns the maximal size of a barcode. @param int $w @param int $h @return int[]
[ "Returns", "the", "maximal", "size", "of", "a", "barcode", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINcode93.php#L175-L184
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINcode93.php
CINcode93.calculateChecksum
protected function calculateChecksum() { // Checksum // First CheckSUM "C" // The "C" checksum character is the modulo 47 remainder of the sum of the weighted // value of the data characters. The weighting value starts at "1" for the right-most // data character, 2 for the s...
php
protected function calculateChecksum() { // Checksum // First CheckSUM "C" // The "C" checksum character is the modulo 47 remainder of the sum of the weighted // value of the data characters. The weighting value starts at "1" for the right-most // data character, 2 for the s...
[ "protected", "function", "calculateChecksum", "(", ")", "{", "// Checksum\r", "// First CheckSUM \"C\"\r", "// The \"C\" checksum character is the modulo 47 remainder of the sum of the weighted\r", "// value of the data characters. The weighting value starts at \"1\" for the right-most\r", "// d...
Overloaded method to calculate checksum.
[ "Overloaded", "method", "to", "calculate", "checksum", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINcode93.php#L201-L229
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINcode93.php
CINcode93.processChecksum
protected function processChecksum() { if ($this->checksumValue === false) { // Calculate the checksum only once $this->calculateChecksum(); } if ($this->checksumValue !== false) { $ret = ''; $c = count($this->checksumValue); for ($i = 0; ...
php
protected function processChecksum() { if ($this->checksumValue === false) { // Calculate the checksum only once $this->calculateChecksum(); } if ($this->checksumValue !== false) { $ret = ''; $c = count($this->checksumValue); for ($i = 0; ...
[ "protected", "function", "processChecksum", "(", ")", "{", "if", "(", "$", "this", "->", "checksumValue", "===", "false", ")", "{", "// Calculate the checksum only once\r", "$", "this", "->", "calculateChecksum", "(", ")", ";", "}", "if", "(", "$", "this", "...
Overloaded method to display the checksum.
[ "Overloaded", "method", "to", "display", "the", "checksum", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINcode93.php#L234-L250
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php
CINBarcode1D.setThickness
public function setThickness($thickness) { $thickness = intval($thickness); if ($thickness <= 0) { throw new CINArgumentException('The thickness must be larger than 0.', 'thickness'); } $this->thickness = $thickness; }
php
public function setThickness($thickness) { $thickness = intval($thickness); if ($thickness <= 0) { throw new CINArgumentException('The thickness must be larger than 0.', 'thickness'); } $this->thickness = $thickness; }
[ "public", "function", "setThickness", "(", "$", "thickness", ")", "{", "$", "thickness", "=", "intval", "(", "$", "thickness", ")", ";", "if", "(", "$", "thickness", "<=", "0", ")", "{", "throw", "new", "CINArgumentException", "(", "'The thickness must be la...
Sets the thickness. @param int $thickness
[ "Sets", "the", "thickness", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php#L67-L74
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php
CINBarcode1D.getLabel
public function getLabel() { $label = $this->label; if ($this->label === self::AUTO_LABEL) { $label = $this->text; if ($this->displayChecksum === true && ($checksum = $this->processChecksum()) !== false) { $label .= $checksum; } } ...
php
public function getLabel() { $label = $this->label; if ($this->label === self::AUTO_LABEL) { $label = $this->text; if ($this->displayChecksum === true && ($checksum = $this->processChecksum()) !== false) { $label .= $checksum; } } ...
[ "public", "function", "getLabel", "(", ")", "{", "$", "label", "=", "$", "this", "->", "label", ";", "if", "(", "$", "this", "->", "label", "===", "self", "::", "AUTO_LABEL", ")", "{", "$", "label", "=", "$", "this", "->", "text", ";", "if", "(",...
Gets the label. If the label was set to CINBarcode1D::AUTO_LABEL, the label will display the value from the text parsed. @return string
[ "Gets", "the", "label", ".", "If", "the", "label", "was", "set", "to", "CINBarcode1D", "::", "AUTO_LABEL", "the", "label", "will", "display", "the", "value", "from", "the", "text", "parsed", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php#L82-L92
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php
CINBarcode1D.setFont
public function setFont($font) { if (is_int($font)) { if ($font === 0) { $font = null; } else { $font = new CINFontPhp($font); } } $this->font = $font; }
php
public function setFont($font) { if (is_int($font)) { if ($font === 0) { $font = null; } else { $font = new CINFontPhp($font); } } $this->font = $font; }
[ "public", "function", "setFont", "(", "$", "font", ")", "{", "if", "(", "is_int", "(", "$", "font", ")", ")", "{", "if", "(", "$", "font", "===", "0", ")", "{", "$", "font", "=", "null", ";", "}", "else", "{", "$", "font", "=", "new", "CINFon...
Sets the font. @param mixed $font CINFont or int
[ "Sets", "the", "font", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php#L118-L128
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php
CINBarcode1D.parse
public function parse($text) { $this->text = $text; $this->checksumValue = false; // Reset checksumValue $this->validate(); parent::parse($text); $this->addDefaultLabel(); }
php
public function parse($text) { $this->text = $text; $this->checksumValue = false; // Reset checksumValue $this->validate(); parent::parse($text); $this->addDefaultLabel(); }
[ "public", "function", "parse", "(", "$", "text", ")", "{", "$", "this", "->", "text", "=", "$", "text", ";", "$", "this", "->", "checksumValue", "=", "false", ";", "// Reset checksumValue\r", "$", "this", "->", "validate", "(", ")", ";", "parent", "::"...
Parses the text before displaying it. @param mixed $text
[ "Parses", "the", "text", "before", "displaying", "it", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php#L135-L143
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php
CINBarcode1D.addDefaultLabel
protected function addDefaultLabel() { $label = $this->getLabel(); $font = $this->font; if ($label !== null && $label !== '' && $font !== null && $this->defaultLabel !== null) { $this->defaultLabel->setText($label); $this->defaultLabel->setFont($font); $...
php
protected function addDefaultLabel() { $label = $this->getLabel(); $font = $this->font; if ($label !== null && $label !== '' && $font !== null && $this->defaultLabel !== null) { $this->defaultLabel->setText($label); $this->defaultLabel->setFont($font); $...
[ "protected", "function", "addDefaultLabel", "(", ")", "{", "$", "label", "=", "$", "this", "->", "getLabel", "(", ")", ";", "$", "font", "=", "$", "this", "->", "font", ";", "if", "(", "$", "label", "!==", "null", "&&", "$", "label", "!==", "''", ...
Adds the default label.
[ "Adds", "the", "default", "label", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php#L168-L176
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php
CINBarcode1D.drawChar
protected function drawChar($im, $code, $startBar = true) { $colors = array(CINBarcode::COLOR_FG, CINBarcode::COLOR_BG); $currentColor = $startBar ? 0 : 1; $c = strlen($code); for ($i = 0; $i < $c; $i++) { for ($j = 0; $j < intval($code[$i]) + 1; $j++) { ...
php
protected function drawChar($im, $code, $startBar = true) { $colors = array(CINBarcode::COLOR_FG, CINBarcode::COLOR_BG); $currentColor = $startBar ? 0 : 1; $c = strlen($code); for ($i = 0; $i < $c; $i++) { for ($j = 0; $j < intval($code[$i]) + 1; $j++) { ...
[ "protected", "function", "drawChar", "(", "$", "im", ",", "$", "code", ",", "$", "startBar", "=", "true", ")", "{", "$", "colors", "=", "array", "(", "CINBarcode", "::", "COLOR_FG", ",", "CINBarcode", "::", "COLOR_BG", ")", ";", "$", "currentColor", "=...
Draws all chars thanks to $code. If $startBar is true, the line begins by a space. If $startBar is false, the line begins by a bar. @param resource $im @param string $code @param boolean $startBar
[ "Draws", "all", "chars", "thanks", "to", "$code", ".", "If", "$startBar", "is", "true", "the", "line", "begins", "by", "a", "space", ".", "If", "$startBar", "is", "false", "the", "line", "begins", "by", "a", "bar", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php#L213-L225
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php
CINBarcode1D.drawSingleBar
protected function drawSingleBar($im, $color) { $this->drawFilledRectangle($im, $this->positionX, 0, $this->positionX, $this->thickness - 1, $color); }
php
protected function drawSingleBar($im, $color) { $this->drawFilledRectangle($im, $this->positionX, 0, $this->positionX, $this->thickness - 1, $color); }
[ "protected", "function", "drawSingleBar", "(", "$", "im", ",", "$", "color", ")", "{", "$", "this", "->", "drawFilledRectangle", "(", "$", "im", ",", "$", "this", "->", "positionX", ",", "0", ",", "$", "this", "->", "positionX", ",", "$", "this", "->...
Draws a Bar of $color depending of the resolution. @param resource $img @param int $color
[ "Draws", "a", "Bar", "of", "$color", "depending", "of", "the", "resolution", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINBarcode1D.php#L233-L235
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINFontPhp.php
CINFontPhp.setRotationAngle
public function setRotationAngle($rotationAngle) { $this->rotationAngle = (int)$rotationAngle; if ($this->rotationAngle !== 90 && $this->rotationAngle !== 180 && $this->rotationAngle !== 270) { $this->rotationAngle = 0; } $this->rotationAngle = (360 - $this->rotationAn...
php
public function setRotationAngle($rotationAngle) { $this->rotationAngle = (int)$rotationAngle; if ($this->rotationAngle !== 90 && $this->rotationAngle !== 180 && $this->rotationAngle !== 270) { $this->rotationAngle = 0; } $this->rotationAngle = (360 - $this->rotationAn...
[ "public", "function", "setRotationAngle", "(", "$", "rotationAngle", ")", "{", "$", "this", "->", "rotationAngle", "=", "(", "int", ")", "$", "rotationAngle", ";", "if", "(", "$", "this", "->", "rotationAngle", "!==", "90", "&&", "$", "this", "->", "rota...
Sets the rotation in degree. @param int
[ "Sets", "the", "rotation", "in", "degree", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINFontPhp.php#L67-L74
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINFontPhp.php
CINFontPhp.getDimension
public function getDimension() { $w = imagefontwidth($this->font) * strlen($this->text); $h = imagefontheight($this->font); $rotationAngle = $this->getRotationAngle(); if ($rotationAngle === 90 || $rotationAngle === 270) { return array($h, $w); } else { ...
php
public function getDimension() { $w = imagefontwidth($this->font) * strlen($this->text); $h = imagefontheight($this->font); $rotationAngle = $this->getRotationAngle(); if ($rotationAngle === 90 || $rotationAngle === 270) { return array($h, $w); } else { ...
[ "public", "function", "getDimension", "(", ")", "{", "$", "w", "=", "imagefontwidth", "(", "$", "this", "->", "font", ")", "*", "strlen", "(", "$", "this", "->", "text", ")", ";", "$", "h", "=", "imagefontheight", "(", "$", "this", "->", "font", ")...
Returns the width and height that the text takes to be written. @return int[]
[ "Returns", "the", "width", "and", "height", "that", "the", "text", "takes", "to", "be", "written", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINFontPhp.php#L117-L127
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINFontPhp.php
CINFontPhp.draw
public function draw($im, $x, $y) { if ($this->getRotationAngle() !== 0) { if (!function_exists('imagerotate')) { throw new CINDrawException('The method imagerotate doesn\'t exist on your server. Do not use any rotation.'); } $w = imagefontwidth($this->...
php
public function draw($im, $x, $y) { if ($this->getRotationAngle() !== 0) { if (!function_exists('imagerotate')) { throw new CINDrawException('The method imagerotate doesn\'t exist on your server. Do not use any rotation.'); } $w = imagefontwidth($this->...
[ "public", "function", "draw", "(", "$", "im", ",", "$", "x", ",", "$", "y", ")", "{", "if", "(", "$", "this", "->", "getRotationAngle", "(", ")", "!==", "0", ")", "{", "if", "(", "!", "function_exists", "(", "'imagerotate'", ")", ")", "{", "throw...
Draws the text on the image at a specific position. $x and $y represent the left bottom corner. @param resource $im @param int $x @param int $y
[ "Draws", "the", "text", "on", "the", "image", "at", "a", "specific", "position", ".", "$x", "and", "$y", "represent", "the", "left", "bottom", "corner", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINFontPhp.php#L137-L153
codeitnowin/barcode-generator
CodeItNow/BarcodeBundle/Generator/CINLabel.php
CINLabel.setText
public function setText($text) { $this->text = $text; $this->font->setText($this->text); }
php
public function setText($text) { $this->text = $text; $this->font->setText($this->text); }
[ "public", "function", "setText", "(", "$", "text", ")", "{", "$", "this", "->", "text", "=", "$", "text", ";", "$", "this", "->", "font", "->", "setText", "(", "$", "this", "->", "text", ")", ";", "}" ]
Sets the text. @param string $text
[ "Sets", "the", "text", "." ]
train
https://github.com/codeitnowin/barcode-generator/blob/6325a15ae904ec401b947e1a3e868de1c2cc80b0/CodeItNow/BarcodeBundle/Generator/CINLabel.php#L74-L77