id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
34,800
yawik/jobs
src/Repository/Job.php
Job.findActiveOrganizations
public function findActiveOrganizations($term = null) { $qb = $this->createQueryBuilder(); $qb->distinct('organization') ->hydrate(true) ->field('status.name')->notIn([ StatusInterface::EXPIRED, StatusInterface::INACTIVE ]); $q = $qb->getQuery(); $r = $q->exec...
php
public function findActiveOrganizations($term = null) { $qb = $this->createQueryBuilder(); $qb->distinct('organization') ->hydrate(true) ->field('status.name')->notIn([ StatusInterface::EXPIRED, StatusInterface::INACTIVE ]); $q = $qb->getQuery(); $r = $q->exec...
[ "public", "function", "findActiveOrganizations", "(", "$", "term", "=", "null", ")", "{", "$", "qb", "=", "$", "this", "->", "createQueryBuilder", "(", ")", ";", "$", "qb", "->", "distinct", "(", "'organization'", ")", "->", "hydrate", "(", "true", ")", ...
Selects all Organizations with Active Jobs @return mixed @throws \Doctrine\ODM\MongoDB\MongoDBException
[ "Selects", "all", "Organizations", "with", "Active", "Jobs" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Repository/Job.php#L134-L155
34,801
yawik/jobs
src/Repository/Job.php
Job.createQueryBuilder
public function createQueryBuilder($isDeleted = false) { $qb = parent::createQueryBuilder(); if (null !== $isDeleted) { $qb->addAnd( $qb->expr()->addOr($qb->expr()->field('isDeleted')->equals($isDeleted)) ->addOr($qb->expr()->field('isDeleted')-...
php
public function createQueryBuilder($isDeleted = false) { $qb = parent::createQueryBuilder(); if (null !== $isDeleted) { $qb->addAnd( $qb->expr()->addOr($qb->expr()->field('isDeleted')->equals($isDeleted)) ->addOr($qb->expr()->field('isDeleted')-...
[ "public", "function", "createQueryBuilder", "(", "$", "isDeleted", "=", "false", ")", "{", "$", "qb", "=", "parent", "::", "createQueryBuilder", "(", ")", ";", "if", "(", "null", "!==", "$", "isDeleted", ")", "{", "$", "qb", "->", "addAnd", "(", "$", ...
Create a query builder instance. @param bool $isDeleted Value of the isDeleted flag. Pass "null" to ignore this field. @return Query\Builder
[ "Create", "a", "query", "builder", "instance", "." ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Repository/Job.php#L203-L215
34,802
yawik/jobs
src/Repository/Categories.php
Categories.createDefaultCategory
public function createDefaultCategory($value) { if (is_array($value)) { $value = isset($value['value']) ? $value['value'] : ''; } if ('professions' != $value && 'employmentTypes' != $value && 'industries' != $value) { return null; } $builder = $this-...
php
public function createDefaultCategory($value) { if (is_array($value)) { $value = isset($value['value']) ? $value['value'] : ''; } if ('professions' != $value && 'employmentTypes' != $value && 'industries' != $value) { return null; } $builder = $this-...
[ "public", "function", "createDefaultCategory", "(", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "$", "value", "=", "isset", "(", "$", "value", "[", "'value'", "]", ")", "?", "$", "value", "[", "'value'", "]", ":...
Creates and stores the default category hirarchy for the given value. @param array|string $value @return null|\Jobs\Entity\Category
[ "Creates", "and", "stores", "the", "default", "category", "hirarchy", "for", "the", "given", "value", "." ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Repository/Categories.php#L46-L63
34,803
yawik/jobs
src/Controller/TemplateController.php
TemplateController.viewAction
public function viewAction() { $id = $this->params()->fromQuery('id'); $channel = $this->params()->fromRoute('channel', 'default'); $response = $this->getResponse(); /* @var \Jobs\Entity\Job $job */ try { $job = $this->initializeJob()->get($this->params(), true); ...
php
public function viewAction() { $id = $this->params()->fromQuery('id'); $channel = $this->params()->fromRoute('channel', 'default'); $response = $this->getResponse(); /* @var \Jobs\Entity\Job $job */ try { $job = $this->initializeJob()->get($this->params(), true); ...
[ "public", "function", "viewAction", "(", ")", "{", "$", "id", "=", "$", "this", "->", "params", "(", ")", "->", "fromQuery", "(", "'id'", ")", ";", "$", "channel", "=", "$", "this", "->", "params", "(", ")", "->", "fromRoute", "(", "'channel'", ","...
Handles the job opening template in preview mode @return ViewModel @throws \RuntimeException
[ "Handles", "the", "job", "opening", "template", "in", "preview", "mode" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Controller/TemplateController.php#L76-L122
34,804
yawik/jobs
src/Entity/Decorator/JsonLdProvider.php
JsonLdProvider.getLocations
private function getLocations($locations) { $array=[]; foreach ($locations as $location) { /* @var \Core\Entity\LocationInterface $location */ array_push( $array, [ '@type' => 'Place', 'address' => [ ...
php
private function getLocations($locations) { $array=[]; foreach ($locations as $location) { /* @var \Core\Entity\LocationInterface $location */ array_push( $array, [ '@type' => 'Place', 'address' => [ ...
[ "private", "function", "getLocations", "(", "$", "locations", ")", "{", "$", "array", "=", "[", "]", ";", "foreach", "(", "$", "locations", "as", "$", "location", ")", "{", "/* @var \\Core\\Entity\\LocationInterface $location */", "array_push", "(", "$", "array"...
Generates a location array @param Collection $locations, @return array
[ "Generates", "a", "location", "array" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Entity/Decorator/JsonLdProvider.php#L96-L116
34,805
yawik/jobs
src/Entity/Decorator/JsonLdProvider.php
JsonLdProvider.getDescription
private function getDescription(TemplateValuesInterface $values) { $description=sprintf( "<p>%s</p>". "<h1>%s</h1>". "<h3>Requirements</h3><p>%s</p>". "<h3>Qualifications</h3><p>%s</p>". "<h3>Benefits</h3><p>%s</p>", $values->getDescrip...
php
private function getDescription(TemplateValuesInterface $values) { $description=sprintf( "<p>%s</p>". "<h1>%s</h1>". "<h3>Requirements</h3><p>%s</p>". "<h3>Qualifications</h3><p>%s</p>". "<h3>Benefits</h3><p>%s</p>", $values->getDescrip...
[ "private", "function", "getDescription", "(", "TemplateValuesInterface", "$", "values", ")", "{", "$", "description", "=", "sprintf", "(", "\"<p>%s</p>\"", ".", "\"<h1>%s</h1>\"", ".", "\"<h3>Requirements</h3><p>%s</p>\"", ".", "\"<h3>Qualifications</h3><p>%s</p>\"", ".", ...
Generates a description from template values @param TemplateValuesInterface $values @return string
[ "Generates", "a", "description", "from", "template", "values" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Entity/Decorator/JsonLdProvider.php#L125-L140
34,806
yawik/jobs
src/Controller/ManageController.php
ManageController.preDispatch
public function preDispatch(MvcEvent $e) { if ('calculate' == $this->params()->fromQuery('do')) { return; } $routeMatch = $e->getRouteMatch(); $action = $routeMatch->getParam('action'); $services = $e->getApplication()->getServiceManager(); if (in_array($acti...
php
public function preDispatch(MvcEvent $e) { if ('calculate' == $this->params()->fromQuery('do')) { return; } $routeMatch = $e->getRouteMatch(); $action = $routeMatch->getParam('action'); $services = $e->getApplication()->getServiceManager(); if (in_array($acti...
[ "public", "function", "preDispatch", "(", "MvcEvent", "$", "e", ")", "{", "if", "(", "'calculate'", "==", "$", "this", "->", "params", "(", ")", "->", "fromQuery", "(", "'do'", ")", ")", "{", "return", ";", "}", "$", "routeMatch", "=", "$", "e", "-...
Dispatch listener callback. Attaches the MailSender aggregate listener to the job event manager. @param MvcEvent $e @since 0.19
[ "Dispatch", "listener", "callback", "." ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Controller/ManageController.php#L154-L168
34,807
yawik/jobs
src/Controller/ManageController.php
ManageController.completionAction
public function completionAction() { $job = $this->initializeJob()->get($this->params(), false, true); if ($job->isDraft()) { $job->setIsDraft(false); $reference = $job->getReference(); if (empty($reference)) { /* @var $repository \Jobs\Reposi...
php
public function completionAction() { $job = $this->initializeJob()->get($this->params(), false, true); if ($job->isDraft()) { $job->setIsDraft(false); $reference = $job->getReference(); if (empty($reference)) { /* @var $repository \Jobs\Reposi...
[ "public", "function", "completionAction", "(", ")", "{", "$", "job", "=", "$", "this", "->", "initializeJob", "(", ")", "->", "get", "(", "$", "this", "->", "params", "(", ")", ",", "false", ",", "true", ")", ";", "if", "(", "$", "job", "->", "is...
Job opening is completed. @return array
[ "Job", "opening", "is", "completed", "." ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Controller/ManageController.php#L492-L542
34,808
yawik/jobs
src/Controller/ManageController.php
ManageController.deactivateAction
public function deactivateAction() { $user = $this->auth->getUser(); $jobEntity = $this->initializeJob()->get($this->params()); try { $jobEntity->changeStatus(Status::INACTIVE, sprintf(/*@translate*/ "Job was deactivated by %s", $user->getInfo()->getDisplayName())); ...
php
public function deactivateAction() { $user = $this->auth->getUser(); $jobEntity = $this->initializeJob()->get($this->params()); try { $jobEntity->changeStatus(Status::INACTIVE, sprintf(/*@translate*/ "Job was deactivated by %s", $user->getInfo()->getDisplayName())); ...
[ "public", "function", "deactivateAction", "(", ")", "{", "$", "user", "=", "$", "this", "->", "auth", "->", "getUser", "(", ")", ";", "$", "jobEntity", "=", "$", "this", "->", "initializeJob", "(", ")", "->", "get", "(", "$", "this", "->", "params", ...
Deactivate a job posting @return null|ViewModel
[ "Deactivate", "a", "job", "posting" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Controller/ManageController.php#L644-L658
34,809
yawik/jobs
src/Controller/ManageController.php
ManageController.templateAction
public function templateAction() { try { $jobEntity = $this->initializeJob()->get($this->params()); $jobEntity->setTemplate($this->params('template', 'default')); $this->repositoryService->store($jobEntity); $this->notification()->success(/* @translate*/ 'Temp...
php
public function templateAction() { try { $jobEntity = $this->initializeJob()->get($this->params()); $jobEntity->setTemplate($this->params('template', 'default')); $this->repositoryService->store($jobEntity); $this->notification()->success(/* @translate*/ 'Temp...
[ "public", "function", "templateAction", "(", ")", "{", "try", "{", "$", "jobEntity", "=", "$", "this", "->", "initializeJob", "(", ")", "->", "get", "(", "$", "this", "->", "params", "(", ")", ")", ";", "$", "jobEntity", "->", "setTemplate", "(", "$"...
Assign a template to a job posting @return JsonModel
[ "Assign", "a", "template", "to", "a", "job", "posting" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Controller/ManageController.php#L676-L688
34,810
yawik/jobs
src/Filter/ViewModelTemplateFilterAbstract.php
ViewModelTemplateFilterAbstract.setApplyData
protected function setApplyData() { if (!isset($this->job)) { throw new \InvalidArgumentException('cannot create a viewModel for Templates without a $job'); } $data = [ 'applyId' => $this->job->getApplyId(), 'uri' => null, 'oneClickPro...
php
protected function setApplyData() { if (!isset($this->job)) { throw new \InvalidArgumentException('cannot create a viewModel for Templates without a $job'); } $data = [ 'applyId' => $this->job->getApplyId(), 'uri' => null, 'oneClickPro...
[ "protected", "function", "setApplyData", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "job", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'cannot create a viewModel for Templates without a $job'", ")", ";", "}", "$", ...
Set the apply buttons of the job posting @return ViewModelTemplateFilterAbstract @throws \InvalidArgumentException
[ "Set", "the", "apply", "buttons", "of", "the", "job", "posting" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Filter/ViewModelTemplateFilterAbstract.php#L198-L224
34,811
yawik/jobs
src/Filter/ViewModelTemplateFilterAbstract.php
ViewModelTemplateFilterAbstract.setLocation
protected function setLocation() { if (!isset($this->job)) { throw new \InvalidArgumentException('cannot create a viewModel for Templates without aa $job'); } $location = $this->job->getLocation(); $this->container['location'] = isset($location)?$location:''; retu...
php
protected function setLocation() { if (!isset($this->job)) { throw new \InvalidArgumentException('cannot create a viewModel for Templates without aa $job'); } $location = $this->job->getLocation(); $this->container['location'] = isset($location)?$location:''; retu...
[ "protected", "function", "setLocation", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "job", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'cannot create a viewModel for Templates without aa $job'", ")", ";", "}", "$", ...
Sets the location of a jobs @return $this @throws \InvalidArgumentException
[ "Sets", "the", "location", "of", "a", "jobs" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Filter/ViewModelTemplateFilterAbstract.php#L232-L240
34,812
yawik/jobs
src/Filter/ViewModelTemplateFilterAbstract.php
ViewModelTemplateFilterAbstract.setDescription
protected function setDescription() { if (!isset($this->job)) { throw new \InvalidArgumentException('cannot create a viewModel for Templates without a $job'); } if (empty($this->job->getTemplateValues()->getDescription()) && is_object($this->job->getOrganization())) { ...
php
protected function setDescription() { if (!isset($this->job)) { throw new \InvalidArgumentException('cannot create a viewModel for Templates without a $job'); } if (empty($this->job->getTemplateValues()->getDescription()) && is_object($this->job->getOrganization())) { ...
[ "protected", "function", "setDescription", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "job", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'cannot create a viewModel for Templates without a $job'", ")", ";", "}", "if...
Sets the company description of a job. Use the description of an organization as default @return $this @throws \InvalidArgumentException
[ "Sets", "the", "company", "description", "of", "a", "job", ".", "Use", "the", "description", "of", "an", "organization", "as", "default" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Filter/ViewModelTemplateFilterAbstract.php#L248-L261
34,813
yawik/jobs
src/Filter/ViewModelTemplateFilterAbstract.php
ViewModelTemplateFilterAbstract.setOrganizationInfo
protected function setOrganizationInfo() { if (!isset($this->job)) { throw new \InvalidArgumentException('cannot create a viewModel for Templates without a $job'); } $organizationName = ''; $organizationStreet = ''; $organizationPostalCode = ''; $organizat...
php
protected function setOrganizationInfo() { if (!isset($this->job)) { throw new \InvalidArgumentException('cannot create a viewModel for Templates without a $job'); } $organizationName = ''; $organizationStreet = ''; $organizationPostalCode = ''; $organizat...
[ "protected", "function", "setOrganizationInfo", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "job", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'cannot create a viewModel for Templates without a $job'", ")", ";", "}", ...
Sets the organizations contact address @return $this @throws \InvalidArgumentException
[ "Sets", "the", "organizations", "contact", "address" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Filter/ViewModelTemplateFilterAbstract.php#L269-L310
34,814
yawik/jobs
src/Filter/ViewModelTemplateFilterAbstract.php
ViewModelTemplateFilterAbstract.setTemplateDefaultValues
protected function setTemplateDefaultValues() { if (!isset($this->job)) { throw new \InvalidArgumentException('cannot create a viewModel for Templates without a $job'); } $labelQualifications=''; $labelBenefits=''; $labelRequirements=''; $organization = $...
php
protected function setTemplateDefaultValues() { if (!isset($this->job)) { throw new \InvalidArgumentException('cannot create a viewModel for Templates without a $job'); } $labelQualifications=''; $labelBenefits=''; $labelRequirements=''; $organization = $...
[ "protected", "function", "setTemplateDefaultValues", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "job", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'cannot create a viewModel for Templates without a $job'", ")", ";", ...
Sets the default values of an organizations job template @return $this @throws \InvalidArgumentException
[ "Sets", "the", "default", "values", "of", "an", "organizations", "job", "template" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Filter/ViewModelTemplateFilterAbstract.php#L318-L338
34,815
yawik/jobs
src/Filter/ViewModelTemplateFilterAbstract.php
ViewModelTemplateFilterAbstract.makeAbsolutePath
protected function makeAbsolutePath($path) { $path = $this->serverUrlHelper->__invoke($this->basePathHelper->__invoke($path)); return $path; }
php
protected function makeAbsolutePath($path) { $path = $this->serverUrlHelper->__invoke($this->basePathHelper->__invoke($path)); return $path; }
[ "protected", "function", "makeAbsolutePath", "(", "$", "path", ")", "{", "$", "path", "=", "$", "this", "->", "serverUrlHelper", "->", "__invoke", "(", "$", "this", "->", "basePathHelper", "->", "__invoke", "(", "$", "path", ")", ")", ";", "return", "$",...
combines two helper @param $path @return mixed
[ "combines", "two", "helper" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Filter/ViewModelTemplateFilterAbstract.php#L357-L361
34,816
yawik/jobs
src/Filter/ChannelPrices.php
ChannelPrices.filter
public function filter($value = []) { $sum = 0; $amount = 0; $absoluteDiscount = 0; if (empty($value)) { return 0; } foreach ($value as $channelKey) { /* @var $channel ChannelOptions */ $channel = $this->providers->getChannel($chan...
php
public function filter($value = []) { $sum = 0; $amount = 0; $absoluteDiscount = 0; if (empty($value)) { return 0; } foreach ($value as $channelKey) { /* @var $channel ChannelOptions */ $channel = $this->providers->getChannel($chan...
[ "public", "function", "filter", "(", "$", "value", "=", "[", "]", ")", "{", "$", "sum", "=", "0", ";", "$", "amount", "=", "0", ";", "$", "absoluteDiscount", "=", "0", ";", "if", "(", "empty", "(", "$", "value", ")", ")", "{", "return", "0", ...
This filter allows you to loop over the selected Channels. Each channel can have three prices 'min', 'base', 'list'. The default calculation simply adds a discount of 13,5% if more than one channel is selected. In addition, you'll get a special discount of 100 whatever, if your job will be posted on jobs.yawik.org :-)...
[ "This", "filter", "allows", "you", "to", "loop", "over", "the", "selected", "Channels", ".", "Each", "channel", "can", "have", "three", "prices", "min", "base", "list", ".", "The", "default", "calculation", "simply", "adds", "a", "discount", "of", "13", "5...
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Filter/ChannelPrices.php#L61-L86
34,817
yawik/jobs
src/Controller/IndexController.php
IndexController.indexAction
public function indexAction() { /* @var $request \Zend\Http\Request */ $request = $this->getRequest(); $queryParams = $request->getQuery(); $params = $queryParams->get('params', []); $jsonFormat = 'json' == $queryParams->get('format'); $isRecruiter = $this->...
php
public function indexAction() { /* @var $request \Zend\Http\Request */ $request = $this->getRequest(); $queryParams = $request->getQuery(); $params = $queryParams->get('params', []); $jsonFormat = 'json' == $queryParams->get('format'); $isRecruiter = $this->...
[ "public", "function", "indexAction", "(", ")", "{", "/* @var $request \\Zend\\Http\\Request */", "$", "request", "=", "$", "this", "->", "getRequest", "(", ")", ";", "$", "queryParams", "=", "$", "request", "->", "getQuery", "(", ")", ";", "$", "params", "="...
List job postings @return ViewModel
[ "List", "job", "postings" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Controller/IndexController.php#L64-L108
34,818
yawik/jobs
src/Controller/IndexController.php
IndexController.dashboardAction
public function dashboardAction() { /* @var $request \Zend\Http\Request */ $request = $this->getRequest(); $params = $request->getQuery(); $isRecruiter = $this->Acl()->isRole(User::ROLE_RECRUITER); if ($isRecruiter) { $params->set('by', 'me'); } ...
php
public function dashboardAction() { /* @var $request \Zend\Http\Request */ $request = $this->getRequest(); $params = $request->getQuery(); $isRecruiter = $this->Acl()->isRole(User::ROLE_RECRUITER); if ($isRecruiter) { $params->set('by', 'me'); } ...
[ "public", "function", "dashboardAction", "(", ")", "{", "/* @var $request \\Zend\\Http\\Request */", "$", "request", "=", "$", "this", "->", "getRequest", "(", ")", ";", "$", "params", "=", "$", "request", "->", "getQuery", "(", ")", ";", "$", "isRecruiter", ...
Handles the dashboard widget for the jobs module. @return array
[ "Handles", "the", "dashboard", "widget", "for", "the", "jobs", "module", "." ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Controller/IndexController.php#L115-L134
34,819
yawik/jobs
src/Form/OrganizationSelect.php
OrganizationSelect.setSelectableOrganizations
public function setSelectableOrganizations($organizations, $addEmptyOption = true) { $options = $addEmptyOption ? ['0' => ''] : []; foreach ($organizations as $org) { /* @var $org \Organizations\Entity\Organization */ $name = $org->getOrganizationName()->getName(); ...
php
public function setSelectableOrganizations($organizations, $addEmptyOption = true) { $options = $addEmptyOption ? ['0' => ''] : []; foreach ($organizations as $org) { /* @var $org \Organizations\Entity\Organization */ $name = $org->getOrganizationName()->getName(); ...
[ "public", "function", "setSelectableOrganizations", "(", "$", "organizations", ",", "$", "addEmptyOption", "=", "true", ")", "{", "$", "options", "=", "$", "addEmptyOption", "?", "[", "'0'", "=>", "''", "]", ":", "[", "]", ";", "foreach", "(", "$", "orga...
Sets the selectable organizations. @param Cursor|array $organizations @param bool $addEmptyOption If true, an empty option is created as the first value option. @return self
[ "Sets", "the", "selectable", "organizations", "." ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Form/OrganizationSelect.php#L53-L73
34,820
yawik/jobs
src/Entity/Salary.php
Salary.setUnit
public function setUnit($unit) { $validUnits = self::getValidUnits(); if (!in_array($unit, $validUnits)) { throw new \InvalidArgumentException('Unknown value for time unit interval.'); } $this->unit = $unit; return $this; }
php
public function setUnit($unit) { $validUnits = self::getValidUnits(); if (!in_array($unit, $validUnits)) { throw new \InvalidArgumentException('Unknown value for time unit interval.'); } $this->unit = $unit; return $this; }
[ "public", "function", "setUnit", "(", "$", "unit", ")", "{", "$", "validUnits", "=", "self", "::", "getValidUnits", "(", ")", ";", "if", "(", "!", "in_array", "(", "$", "unit", ",", "$", "validUnits", ")", ")", "{", "throw", "new", "\\", "InvalidArgu...
Sets time interval unit. @param string $unit @throws \InvalidArgumentException @return $this
[ "Sets", "time", "interval", "unit", "." ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Entity/Salary.php#L140-L151
34,821
yawik/jobs
src/Entity/Salary.php
Salary.getValidUnits
public static function getValidUnits() { return array( self::UNIT_HOUR, self::UNIT_DAY, self::UNIT_WEEK, self::UNIT_MONTH, self::UNIT_YEAR, ); }
php
public static function getValidUnits() { return array( self::UNIT_HOUR, self::UNIT_DAY, self::UNIT_WEEK, self::UNIT_MONTH, self::UNIT_YEAR, ); }
[ "public", "static", "function", "getValidUnits", "(", ")", "{", "return", "array", "(", "self", "::", "UNIT_HOUR", ",", "self", "::", "UNIT_DAY", ",", "self", "::", "UNIT_WEEK", ",", "self", "::", "UNIT_MONTH", ",", "self", "::", "UNIT_YEAR", ",", ")", "...
Gets valid time interval units collection. @return array
[ "Gets", "valid", "time", "interval", "units", "collection", "." ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Entity/Salary.php#L168-L177
34,822
yawik/jobs
src/Form/ImportFieldset.php
ImportFieldset.init
public function init() { $this->setName('job'); $this->setAttribute('id', 'job'); $this->add( [ 'type' => 'hidden', 'name' => 'id' ] ); $this->add( [ 'type' => 'Zend\Form\Element\Text', ...
php
public function init() { $this->setName('job'); $this->setAttribute('id', 'job'); $this->add( [ 'type' => 'hidden', 'name' => 'id' ] ); $this->add( [ 'type' => 'Zend\Form\Element\Text', ...
[ "public", "function", "init", "(", ")", "{", "$", "this", "->", "setName", "(", "'job'", ")", ";", "$", "this", "->", "setAttribute", "(", "'id'", ",", "'job'", ")", ";", "$", "this", "->", "add", "(", "[", "'type'", "=>", "'hidden'", ",", "'name'"...
defines the valid formular fields, which can be used via API
[ "defines", "the", "valid", "formular", "fields", "which", "can", "be", "used", "via", "API" ]
50c124152e9de98bd789bf7593d152019269ff7b
https://github.com/yawik/jobs/blob/50c124152e9de98bd789bf7593d152019269ff7b/src/Form/ImportFieldset.php#L97-L177
34,823
Litecms/Page
src/Http/Controllers/PagePublicController.php
PagePublicController.getPage
protected function getPage($slug) { // get page by slug $page = $this->model->getPage($slug); if (is_null($page)) { abort(404); } //Set theme variables $view = $page->view; $view = view()->exists('page::' . $view) ? $view : 'default'; if...
php
protected function getPage($slug) { // get page by slug $page = $this->model->getPage($slug); if (is_null($page)) { abort(404); } //Set theme variables $view = $page->view; $view = view()->exists('page::' . $view) ? $view : 'default'; if...
[ "protected", "function", "getPage", "(", "$", "slug", ")", "{", "// get page by slug", "$", "page", "=", "$", "this", "->", "model", "->", "getPage", "(", "$", "slug", ")", ";", "if", "(", "is_null", "(", "$", "page", ")", ")", "{", "abort", "(", "...
Show page. @param string $slug @return response
[ "Show", "page", "." ]
787a2473098ab2e853163d3865d2374db75a144c
https://github.com/Litecms/Page/blob/787a2473098ab2e853163d3865d2374db75a144c/src/Http/Controllers/PagePublicController.php#L29-L54
34,824
Litecms/Page
src/Page.php
Page.pages
public function pages($idslug, $field) { $page = $this->model->getPage($idslug); return $page[$field]; }
php
public function pages($idslug, $field) { $page = $this->model->getPage($idslug); return $page[$field]; }
[ "public", "function", "pages", "(", "$", "idslug", ",", "$", "field", ")", "{", "$", "page", "=", "$", "this", "->", "model", "->", "getPage", "(", "$", "idslug", ")", ";", "return", "$", "page", "[", "$", "field", "]", ";", "}" ]
Return return field value of a page. @param mixed $idslug @param string $field @return string
[ "Return", "return", "field", "value", "of", "a", "page", "." ]
787a2473098ab2e853163d3865d2374db75a144c
https://github.com/Litecms/Page/blob/787a2473098ab2e853163d3865d2374db75a144c/src/Page.php#L60-L65
34,825
Litecms/Page
src/Policies/PagePolicy.php
PagePolicy.view
public function view(User $user, Page $page) { if ($user->canDo('page.page.view')) { return true; } return $user->id == $page->user_id; }
php
public function view(User $user, Page $page) { if ($user->canDo('page.page.view')) { return true; } return $user->id == $page->user_id; }
[ "public", "function", "view", "(", "User", "$", "user", ",", "Page", "$", "page", ")", "{", "if", "(", "$", "user", "->", "canDo", "(", "'page.page.view'", ")", ")", "{", "return", "true", ";", "}", "return", "$", "user", "->", "id", "==", "$", "...
Determine if the given user can view the page. @param User $user @param Page $page @return bool
[ "Determine", "if", "the", "given", "user", "can", "view", "the", "page", "." ]
787a2473098ab2e853163d3865d2374db75a144c
https://github.com/Litecms/Page/blob/787a2473098ab2e853163d3865d2374db75a144c/src/Policies/PagePolicy.php#L21-L29
34,826
Litecms/Page
src/Http/Controllers/PageResourceController.php
PageResourceController.show
public function show(PageRequest $request, Page $page) { if ($page->exists) { $view = 'page::admin.page.show'; } else { $view = 'page::admin.page.new'; } return $this->response->setMetaTitle(trans('app.view') . ' ' . trans('page::page.name')) ->d...
php
public function show(PageRequest $request, Page $page) { if ($page->exists) { $view = 'page::admin.page.show'; } else { $view = 'page::admin.page.new'; } return $this->response->setMetaTitle(trans('app.view') . ' ' . trans('page::page.name')) ->d...
[ "public", "function", "show", "(", "PageRequest", "$", "request", ",", "Page", "$", "page", ")", "{", "if", "(", "$", "page", "->", "exists", ")", "{", "$", "view", "=", "'page::admin.page.show'", ";", "}", "else", "{", "$", "view", "=", "'page::admin....
Display page. @param Request $request @param Model $page @return Response
[ "Display", "page", "." ]
787a2473098ab2e853163d3865d2374db75a144c
https://github.com/Litecms/Page/blob/787a2473098ab2e853163d3865d2374db75a144c/src/Http/Controllers/PageResourceController.php#L65-L78
34,827
Litecms/Page
src/Http/Controllers/PageResourceController.php
PageResourceController.edit
public function edit(PageRequest $request, Page $page) { return $this->response->setMetaTitle(trans('app.edit') . ' ' . trans('page::page.name')) ->view('page::admin.page.edit') ->data(compact('page')) ->output(); }
php
public function edit(PageRequest $request, Page $page) { return $this->response->setMetaTitle(trans('app.edit') . ' ' . trans('page::page.name')) ->view('page::admin.page.edit') ->data(compact('page')) ->output(); }
[ "public", "function", "edit", "(", "PageRequest", "$", "request", ",", "Page", "$", "page", ")", "{", "return", "$", "this", "->", "response", "->", "setMetaTitle", "(", "trans", "(", "'app.edit'", ")", ".", "' '", ".", "trans", "(", "'page::page.name'", ...
Show page for editing. @param Request $request @param Model $page @return Response
[ "Show", "page", "for", "editing", "." ]
787a2473098ab2e853163d3865d2374db75a144c
https://github.com/Litecms/Page/blob/787a2473098ab2e853163d3865d2374db75a144c/src/Http/Controllers/PageResourceController.php#L135-L141
34,828
Litecms/Page
src/Http/Controllers/PageAPIController.php
PageAPIController.setRepository
public function setRepository() { $this->repository = app()->make(PageRepositoryInterface::class); $this->repository ->pushCriteria(\Litepie\Repository\Criteria\RequestCriteria::class) ->pushCriteria(\Litecms\Page\Repositories\Criteria\PageResourceCriteria::class); }
php
public function setRepository() { $this->repository = app()->make(PageRepositoryInterface::class); $this->repository ->pushCriteria(\Litepie\Repository\Criteria\RequestCriteria::class) ->pushCriteria(\Litecms\Page\Repositories\Criteria\PageResourceCriteria::class); }
[ "public", "function", "setRepository", "(", ")", "{", "$", "this", "->", "repository", "=", "app", "(", ")", "->", "make", "(", "PageRepositoryInterface", "::", "class", ")", ";", "$", "this", "->", "repository", "->", "pushCriteria", "(", "\\", "Litepie",...
Initialize page resource controller. @param type PageRepositoryInterface $page @return null
[ "Initialize", "page", "resource", "controller", "." ]
787a2473098ab2e853163d3865d2374db75a144c
https://github.com/Litecms/Page/blob/787a2473098ab2e853163d3865d2374db75a144c/src/Http/Controllers/PageAPIController.php#L23-L29
34,829
Litecms/Page
src/Http/Controllers/PageAPIController.php
PageAPIController.store
public function store(PageRequest $request) { try { $data = $request->all(); $data['user_id'] = user_id(); $data['user_type'] = user_type(); $data = $this->repository->create($data); $message = trans('messages....
php
public function store(PageRequest $request) { try { $data = $request->all(); $data['user_id'] = user_id(); $data['user_type'] = user_type(); $data = $this->repository->create($data); $message = trans('messages....
[ "public", "function", "store", "(", "PageRequest", "$", "request", ")", "{", "try", "{", "$", "data", "=", "$", "request", "->", "all", "(", ")", ";", "$", "data", "[", "'user_id'", "]", "=", "user_id", "(", ")", ";", "$", "data", "[", "'user_type'...
Create new page. @param Request $request @return Response
[ "Create", "new", "page", "." ]
787a2473098ab2e853163d3865d2374db75a144c
https://github.com/Litecms/Page/blob/787a2473098ab2e853163d3865d2374db75a144c/src/Http/Controllers/PageAPIController.php#L63-L81
34,830
Litecms/Page
src/Http/Controllers/PageAPIController.php
PageAPIController.destroy
public function destroy(PageRequest $request, Page $page) { try { $page->delete(); $message = trans('messages.success.deleted', ['Module' => trans('page::page.name')]); $code = 202; $status = 'success'; $url = guard_url('page/page/0'); ...
php
public function destroy(PageRequest $request, Page $page) { try { $page->delete(); $message = trans('messages.success.deleted', ['Module' => trans('page::page.name')]); $code = 202; $status = 'success'; $url = guard_url('page/page/0'); ...
[ "public", "function", "destroy", "(", "PageRequest", "$", "request", ",", "Page", "$", "page", ")", "{", "try", "{", "$", "page", "->", "delete", "(", ")", ";", "$", "message", "=", "trans", "(", "'messages.success.deleted'", ",", "[", "'Module'", "=>", ...
Remove the page. @param Model $page @return Response
[ "Remove", "the", "page", "." ]
787a2473098ab2e853163d3865d2374db75a144c
https://github.com/Litecms/Page/blob/787a2473098ab2e853163d3865d2374db75a144c/src/Http/Controllers/PageAPIController.php#L117-L132
34,831
statickidz/php-google-translate-free
src/GoogleTranslate.php
GoogleTranslate.translate
public static function translate($source, $target, $text) { // Request translation $response = self::requestTranslation($source, $target, $text); // Get translation text // $response = self::getStringBetween("onmouseout=\"this.style.backgroundColor='#fff'\">", "</span></div>", strva...
php
public static function translate($source, $target, $text) { // Request translation $response = self::requestTranslation($source, $target, $text); // Get translation text // $response = self::getStringBetween("onmouseout=\"this.style.backgroundColor='#fff'\">", "</span></div>", strva...
[ "public", "static", "function", "translate", "(", "$", "source", ",", "$", "target", ",", "$", "text", ")", "{", "// Request translation", "$", "response", "=", "self", "::", "requestTranslation", "(", "$", "source", ",", "$", "target", ",", "$", "text", ...
Retrieves the translation of a text @param string $source Original language of the text on notation xx. For example: es, en, it, fr... @param string $target Language to which you want to translate the text in format xx. For example: es, en, it, fr... @param string $text Text that you want to translate @return string ...
[ "Retrieves", "the", "translation", "of", "a", "text" ]
4fe3155b3f5845d65c15a82dc8b594885d31a035
https://github.com/statickidz/php-google-translate-free/blob/4fe3155b3f5845d65c15a82dc8b594885d31a035/src/GoogleTranslate.php#L40-L52
34,832
statickidz/php-google-translate-free
src/GoogleTranslate.php
GoogleTranslate.requestTranslation
protected static function requestTranslation($source, $target, $text) { // Google translate URL $url = "https://translate.google.com/translate_a/single?client=at&dt=t&dt=ld&dt=qca&dt=rm&dt=bd&dj=1&hl=es-ES&ie=UTF-8&oe=UTF-8&inputm=2&otf=2&iid=1dd3b944-fa62-4b55-b330-74909a99969e"; $fields ...
php
protected static function requestTranslation($source, $target, $text) { // Google translate URL $url = "https://translate.google.com/translate_a/single?client=at&dt=t&dt=ld&dt=qca&dt=rm&dt=bd&dj=1&hl=es-ES&ie=UTF-8&oe=UTF-8&inputm=2&otf=2&iid=1dd3b944-fa62-4b55-b330-74909a99969e"; $fields ...
[ "protected", "static", "function", "requestTranslation", "(", "$", "source", ",", "$", "target", ",", "$", "text", ")", "{", "// Google translate URL", "$", "url", "=", "\"https://translate.google.com/translate_a/single?client=at&dt=t&dt=ld&dt=qca&dt=rm&dt=bd&dj=1&hl=es-ES&ie=U...
Internal function to make the request to the translator service @internal @param string $source Original language taken from the 'translate' function @param string $target Target language taken from the ' translate' function @param string $text Text to translate taken from the 'translate' function @return object[] T...
[ "Internal", "function", "to", "make", "the", "request", "to", "the", "translator", "service" ]
4fe3155b3f5845d65c15a82dc8b594885d31a035
https://github.com/statickidz/php-google-translate-free/blob/4fe3155b3f5845d65c15a82dc8b594885d31a035/src/GoogleTranslate.php#L68-L111
34,833
statickidz/php-google-translate-free
src/GoogleTranslate.php
GoogleTranslate.getSentencesFromJSON
protected static function getSentencesFromJSON($json) { $sentencesArray = json_decode($json, true); $sentences = ""; foreach ($sentencesArray["sentences"] as $s) { $sentences .= isset($s["trans"]) ? $s["trans"] : ''; } return $sentences; }
php
protected static function getSentencesFromJSON($json) { $sentencesArray = json_decode($json, true); $sentences = ""; foreach ($sentencesArray["sentences"] as $s) { $sentences .= isset($s["trans"]) ? $s["trans"] : ''; } return $sentences; }
[ "protected", "static", "function", "getSentencesFromJSON", "(", "$", "json", ")", "{", "$", "sentencesArray", "=", "json_decode", "(", "$", "json", ",", "true", ")", ";", "$", "sentences", "=", "\"\"", ";", "foreach", "(", "$", "sentencesArray", "[", "\"se...
Dump of the JSON's response in an array @param string $json The JSON object returned by the request function @return string A single string with the translation
[ "Dump", "of", "the", "JSON", "s", "response", "in", "an", "array" ]
4fe3155b3f5845d65c15a82dc8b594885d31a035
https://github.com/statickidz/php-google-translate-free/blob/4fe3155b3f5845d65c15a82dc8b594885d31a035/src/GoogleTranslate.php#L121-L131
34,834
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.run
public function run(): self { // Make sure this is a valid call. $this->validateSecret(); $this->validateRequest(); if ($this->action->isAction('webhookinfo')) { $webhookinfo = Request::getWebhookInfo(); /** @noinspection ForgottenDebugOutputInspection */ ...
php
public function run(): self { // Make sure this is a valid call. $this->validateSecret(); $this->validateRequest(); if ($this->action->isAction('webhookinfo')) { $webhookinfo = Request::getWebhookInfo(); /** @noinspection ForgottenDebugOutputInspection */ ...
[ "public", "function", "run", "(", ")", ":", "self", "{", "// Make sure this is a valid call.", "$", "this", "->", "validateSecret", "(", ")", ";", "$", "this", "->", "validateRequest", "(", ")", ";", "if", "(", "$", "this", "->", "action", "->", "isAction"...
Run this thing in all its glory! @return \TelegramBot\TelegramBotManager\BotManager @throws \Longman\TelegramBot\Exception\TelegramException @throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException @throws \TelegramBot\TelegramBotManager\Exception\InvalidWebhookException @throws \Exception
[ "Run", "this", "thing", "in", "all", "its", "glory!" ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L127-L152
34,835
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.initLogging
public function initLogging(array $log_paths): self { foreach ($log_paths as $logger => $logfile) { ('debug' === $logger) && TelegramLog::initDebugLog($logfile); ('error' === $logger) && TelegramLog::initErrorLog($logfile); ('update' === $logger) && TelegramLog::initUpdat...
php
public function initLogging(array $log_paths): self { foreach ($log_paths as $logger => $logfile) { ('debug' === $logger) && TelegramLog::initDebugLog($logfile); ('error' === $logger) && TelegramLog::initErrorLog($logfile); ('update' === $logger) && TelegramLog::initUpdat...
[ "public", "function", "initLogging", "(", "array", "$", "log_paths", ")", ":", "self", "{", "foreach", "(", "$", "log_paths", "as", "$", "logger", "=>", "$", "logfile", ")", "{", "(", "'debug'", "===", "$", "logger", ")", "&&", "TelegramLog", "::", "in...
Initialise all loggers. @param array $log_paths @return \TelegramBot\TelegramBotManager\BotManager @throws \Exception
[ "Initialise", "all", "loggers", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L162-L171
34,836
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.validateSecret
public function validateSecret(bool $force = false): self { // If we're running from CLI, secret isn't necessary. if ($force || 'cli' !== PHP_SAPI) { $secret = $this->params->getBotParam('secret'); $secret_get = $this->params->getScriptParam('s'); if (!isset($...
php
public function validateSecret(bool $force = false): self { // If we're running from CLI, secret isn't necessary. if ($force || 'cli' !== PHP_SAPI) { $secret = $this->params->getBotParam('secret'); $secret_get = $this->params->getScriptParam('s'); if (!isset($...
[ "public", "function", "validateSecret", "(", "bool", "$", "force", "=", "false", ")", ":", "self", "{", "// If we're running from CLI, secret isn't necessary.", "if", "(", "$", "force", "||", "'cli'", "!==", "PHP_SAPI", ")", "{", "$", "secret", "=", "$", "this...
Make sure the passed secret is valid. @param bool $force Force validation, even on CLI. @return \TelegramBot\TelegramBotManager\BotManager @throws \TelegramBot\TelegramBotManager\Exception\InvalidAccessException
[ "Make", "sure", "the", "passed", "secret", "is", "valid", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L181-L193
34,837
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.validateAndSetWebhook
public function validateAndSetWebhook(): self { $webhook = $this->params->getBotParam('webhook'); if (empty($webhook['url'] ?? null) && $this->action->isAction(['set', 'reset'])) { throw new InvalidWebhookException('Invalid webhook'); } if ($this->action->isAction(['unse...
php
public function validateAndSetWebhook(): self { $webhook = $this->params->getBotParam('webhook'); if (empty($webhook['url'] ?? null) && $this->action->isAction(['set', 'reset'])) { throw new InvalidWebhookException('Invalid webhook'); } if ($this->action->isAction(['unse...
[ "public", "function", "validateAndSetWebhook", "(", ")", ":", "self", "{", "$", "webhook", "=", "$", "this", "->", "params", "->", "getBotParam", "(", "'webhook'", ")", ";", "if", "(", "empty", "(", "$", "webhook", "[", "'url'", "]", "??", "null", ")",...
Make sure the webhook is valid and perform the requested webhook operation. @return \TelegramBot\TelegramBotManager\BotManager @throws \Longman\TelegramBot\Exception\TelegramException @throws \TelegramBot\TelegramBotManager\Exception\InvalidWebhookException
[ "Make", "sure", "the", "webhook", "is", "valid", "and", "perform", "the", "requested", "webhook", "operation", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L202-L237
34,838
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.handleOutput
private function handleOutput(string $output): self { $this->output .= $output; if (!self::inTest()) { echo $output; } return $this; }
php
private function handleOutput(string $output): self { $this->output .= $output; if (!self::inTest()) { echo $output; } return $this; }
[ "private", "function", "handleOutput", "(", "string", "$", "output", ")", ":", "self", "{", "$", "this", "->", "output", ".=", "$", "output", ";", "if", "(", "!", "self", "::", "inTest", "(", ")", ")", "{", "echo", "$", "output", ";", "}", "return"...
Save the test output and echo it if we're not in a test. @param string $output @return \TelegramBot\TelegramBotManager\BotManager
[ "Save", "the", "test", "output", "and", "echo", "it", "if", "we", "re", "not", "in", "a", "test", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L246-L255
34,839
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.setBotExtrasTelegram
protected function setBotExtrasTelegram(): self { $simple_extras = [ 'admins' => 'enableAdmins', 'commands.paths' => 'addCommandsPaths', 'custom_input' => 'setCustomInput', 'paths.download' => 'setDownloadPath', 'paths.upload' => 'setUp...
php
protected function setBotExtrasTelegram(): self { $simple_extras = [ 'admins' => 'enableAdmins', 'commands.paths' => 'addCommandsPaths', 'custom_input' => 'setCustomInput', 'paths.download' => 'setDownloadPath', 'paths.upload' => 'setUp...
[ "protected", "function", "setBotExtrasTelegram", "(", ")", ":", "self", "{", "$", "simple_extras", "=", "[", "'admins'", "=>", "'enableAdmins'", ",", "'commands.paths'", "=>", "'addCommandsPaths'", ",", "'custom_input'", "=>", "'setCustomInput'", ",", "'paths.download...
Set extra bot parameters for Telegram object. @return \TelegramBot\TelegramBotManager\BotManager @throws \Longman\TelegramBot\Exception\TelegramException
[ "Set", "extra", "bot", "parameters", "for", "Telegram", "object", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L277-L316
34,840
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.setBotExtrasRequest
protected function setBotExtrasRequest(): self { $request_extras = [ // None at the moment... ]; // For request extras, just pass the single param value to the Request method. foreach ($request_extras as $param_key => $method) { $param = $this->params->getBotP...
php
protected function setBotExtrasRequest(): self { $request_extras = [ // None at the moment... ]; // For request extras, just pass the single param value to the Request method. foreach ($request_extras as $param_key => $method) { $param = $this->params->getBotP...
[ "protected", "function", "setBotExtrasRequest", "(", ")", ":", "self", "{", "$", "request_extras", "=", "[", "// None at the moment...", "]", ";", "// For request extras, just pass the single param value to the Request method.", "foreach", "(", "$", "request_extras", "as", ...
Set extra bot parameters for Request class. @return \TelegramBot\TelegramBotManager\BotManager @throws \Longman\TelegramBot\Exception\TelegramException
[ "Set", "extra", "bot", "parameters", "for", "Request", "class", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L324-L345
34,841
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.handleRequest
public function handleRequest(): self { if ($this->params->getBotParam('webhook.url')) { return $this->handleWebhook(); } if ($loop_time = $this->getLoopTime()) { return $this->handleGetUpdatesLoop($loop_time, $this->getLoopInterval()); } return $thi...
php
public function handleRequest(): self { if ($this->params->getBotParam('webhook.url')) { return $this->handleWebhook(); } if ($loop_time = $this->getLoopTime()) { return $this->handleGetUpdatesLoop($loop_time, $this->getLoopInterval()); } return $thi...
[ "public", "function", "handleRequest", "(", ")", ":", "self", "{", "if", "(", "$", "this", "->", "params", "->", "getBotParam", "(", "'webhook.url'", ")", ")", "{", "return", "$", "this", "->", "handleWebhook", "(", ")", ";", "}", "if", "(", "$", "lo...
Handle the request, which calls either the Webhook or getUpdates method respectively. @return \TelegramBot\TelegramBotManager\BotManager @throws \Longman\TelegramBot\Exception\TelegramException
[ "Handle", "the", "request", "which", "calls", "either", "the", "Webhook", "or", "getUpdates", "method", "respectively", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L353-L364
34,842
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.handleCron
public function handleCron(): self { $groups = explode(',', $this->params->getScriptParam('g', 'default')); $commands = []; foreach ($groups as $group) { $commands[] = $this->params->getBotParam('cron.groups.' . $group, []); } $this->telegram->runCommands(array_m...
php
public function handleCron(): self { $groups = explode(',', $this->params->getScriptParam('g', 'default')); $commands = []; foreach ($groups as $group) { $commands[] = $this->params->getBotParam('cron.groups.' . $group, []); } $this->telegram->runCommands(array_m...
[ "public", "function", "handleCron", "(", ")", ":", "self", "{", "$", "groups", "=", "explode", "(", "','", ",", "$", "this", "->", "params", "->", "getScriptParam", "(", "'g'", ",", "'default'", ")", ")", ";", "$", "commands", "=", "[", "]", ";", "...
Handle cron. @return \TelegramBot\TelegramBotManager\BotManager @throws \Longman\TelegramBot\Exception\TelegramException
[ "Handle", "cron", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L372-L383
34,843
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.getLoopTime
public function getLoopTime(): int { $loop_time = $this->params->getScriptParam('l'); if (null === $loop_time) { return 0; } if (\is_string($loop_time) && '' === trim($loop_time)) { return 604800; // Default to 7 days. } return max(0, (int) ...
php
public function getLoopTime(): int { $loop_time = $this->params->getScriptParam('l'); if (null === $loop_time) { return 0; } if (\is_string($loop_time) && '' === trim($loop_time)) { return 604800; // Default to 7 days. } return max(0, (int) ...
[ "public", "function", "getLoopTime", "(", ")", ":", "int", "{", "$", "loop_time", "=", "$", "this", "->", "params", "->", "getScriptParam", "(", "'l'", ")", ";", "if", "(", "null", "===", "$", "loop_time", ")", "{", "return", "0", ";", "}", "if", "...
Get the number of seconds the script should loop. @return int
[ "Get", "the", "number", "of", "seconds", "the", "script", "should", "loop", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L390-L403
34,844
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.getLoopInterval
public function getLoopInterval(): int { $interval_time = $this->params->getScriptParam('i'); if (null === $interval_time || (\is_string($interval_time) && '' === trim($interval_time))) { return 2; } // Minimum interval is 1 second. return max(1, (int) $interval...
php
public function getLoopInterval(): int { $interval_time = $this->params->getScriptParam('i'); if (null === $interval_time || (\is_string($interval_time) && '' === trim($interval_time))) { return 2; } // Minimum interval is 1 second. return max(1, (int) $interval...
[ "public", "function", "getLoopInterval", "(", ")", ":", "int", "{", "$", "interval_time", "=", "$", "this", "->", "params", "->", "getScriptParam", "(", "'i'", ")", ";", "if", "(", "null", "===", "$", "interval_time", "||", "(", "\\", "is_string", "(", ...
Get the number of seconds the script should wait after each getUpdates request. @return int
[ "Get", "the", "number", "of", "seconds", "the", "script", "should", "wait", "after", "each", "getUpdates", "request", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L410-L420
34,845
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.handleGetUpdatesLoop
public function handleGetUpdatesLoop(int $loop_time_in_seconds, int $loop_interval_in_seconds = 2): self { // Remember the time we started this loop. $now = time(); $this->handleOutput('Looping getUpdates until ' . date('Y-m-d H:i:s', $now + $loop_time_in_seconds) . PHP_EOL); while...
php
public function handleGetUpdatesLoop(int $loop_time_in_seconds, int $loop_interval_in_seconds = 2): self { // Remember the time we started this loop. $now = time(); $this->handleOutput('Looping getUpdates until ' . date('Y-m-d H:i:s', $now + $loop_time_in_seconds) . PHP_EOL); while...
[ "public", "function", "handleGetUpdatesLoop", "(", "int", "$", "loop_time_in_seconds", ",", "int", "$", "loop_interval_in_seconds", "=", "2", ")", ":", "self", "{", "// Remember the time we started this loop.", "$", "now", "=", "time", "(", ")", ";", "$", "this", ...
Loop the getUpdates method for the passed amount of seconds. @param int $loop_time_in_seconds @param int $loop_interval_in_seconds @return \TelegramBot\TelegramBotManager\BotManager @throws \Longman\TelegramBot\Exception\TelegramException
[ "Loop", "the", "getUpdates", "method", "for", "the", "passed", "amount", "of", "seconds", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L431-L446
34,846
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.handleGetUpdates
public function handleGetUpdates(): self { $get_updates_response = $this->telegram->handleGetUpdates(); // Check if the user has set a custom callback for handling the response. if ($this->custom_get_updates_callback !== null) { $this->handleOutput(\call_user_func($this->custom_...
php
public function handleGetUpdates(): self { $get_updates_response = $this->telegram->handleGetUpdates(); // Check if the user has set a custom callback for handling the response. if ($this->custom_get_updates_callback !== null) { $this->handleOutput(\call_user_func($this->custom_...
[ "public", "function", "handleGetUpdates", "(", ")", ":", "self", "{", "$", "get_updates_response", "=", "$", "this", "->", "telegram", "->", "handleGetUpdates", "(", ")", ";", "// Check if the user has set a custom callback for handling the response.", "if", "(", "$", ...
Handle the updates using the getUpdates method. @return \TelegramBot\TelegramBotManager\BotManager @throws \Longman\TelegramBot\Exception\TelegramException
[ "Handle", "the", "updates", "using", "the", "getUpdates", "method", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L467-L479
34,847
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.defaultGetUpdatesCallback
protected function defaultGetUpdatesCallback($get_updates_response): string { if (!$get_updates_response->isOk()) { return sprintf( '%s - Failed to fetch updates' . PHP_EOL . '%s', date('Y-m-d H:i:s'), $get_updates_response->printError(true) ...
php
protected function defaultGetUpdatesCallback($get_updates_response): string { if (!$get_updates_response->isOk()) { return sprintf( '%s - Failed to fetch updates' . PHP_EOL . '%s', date('Y-m-d H:i:s'), $get_updates_response->printError(true) ...
[ "protected", "function", "defaultGetUpdatesCallback", "(", "$", "get_updates_response", ")", ":", "string", "{", "if", "(", "!", "$", "get_updates_response", "->", "isOk", "(", ")", ")", "{", "return", "sprintf", "(", "'%s - Failed to fetch updates'", ".", "PHP_EO...
Return the default output for getUpdates handling. @param Entities\ServerResponse $get_updates_response @return string
[ "Return", "the", "default", "output", "for", "getUpdates", "handling", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L488-L530
34,848
php-telegram-bot/telegram-bot-manager
src/BotManager.php
BotManager.isValidRequest
public function isValidRequest(): bool { // If we're running from CLI, requests are always valid, unless we're running the tests. if ((!self::inTest() && 'cli' === PHP_SAPI) || false === $this->params->getBotParam('validate_request')) { return true; } $ip = $_SERVER['REM...
php
public function isValidRequest(): bool { // If we're running from CLI, requests are always valid, unless we're running the tests. if ((!self::inTest() && 'cli' === PHP_SAPI) || false === $this->params->getBotParam('validate_request')) { return true; } $ip = $_SERVER['REM...
[ "public", "function", "isValidRequest", "(", ")", ":", "bool", "{", "// If we're running from CLI, requests are always valid, unless we're running the tests.", "if", "(", "(", "!", "self", "::", "inTest", "(", ")", "&&", "'cli'", "===", "PHP_SAPI", ")", "||", "false",...
Check if this is a valid request coming from a Telegram API IP address. @link https://core.telegram.org/bots/webhooks#the-short-version @return bool
[ "Check", "if", "this", "is", "a", "valid", "request", "coming", "from", "a", "Telegram", "API", "IP", "address", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/BotManager.php#L565-L584
34,849
php-telegram-bot/telegram-bot-manager
src/Params.php
Params.validateAndSetBotParams
private function validateAndSetBotParams(array $params): self { $this->validateAndSetBotParamsVital($params); $this->validateAndSetBotParamsSpecial($params); $this->validateAndSetBotParamsExtra($params); return $this; }
php
private function validateAndSetBotParams(array $params): self { $this->validateAndSetBotParamsVital($params); $this->validateAndSetBotParamsSpecial($params); $this->validateAndSetBotParamsExtra($params); return $this; }
[ "private", "function", "validateAndSetBotParams", "(", "array", "$", "params", ")", ":", "self", "{", "$", "this", "->", "validateAndSetBotParamsVital", "(", "$", "params", ")", ";", "$", "this", "->", "validateAndSetBotParamsSpecial", "(", "$", "params", ")", ...
Validate and set up the vital and extra params. @param array $params @return \TelegramBot\TelegramBotManager\Params @throws \TelegramBot\TelegramBotManager\Exception\InvalidParamsException
[ "Validate", "and", "set", "up", "the", "vital", "and", "extra", "params", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/Params.php#L118-L125
34,850
php-telegram-bot/telegram-bot-manager
src/Params.php
Params.validateAndSetBotParamsVital
private function validateAndSetBotParamsVital(array $params) { foreach (self::$valid_vital_bot_params as $vital_key) { if (!array_key_exists($vital_key, $params)) { throw new InvalidParamsException('Some vital info is missing: ' . $vital_key); } $this->bo...
php
private function validateAndSetBotParamsVital(array $params) { foreach (self::$valid_vital_bot_params as $vital_key) { if (!array_key_exists($vital_key, $params)) { throw new InvalidParamsException('Some vital info is missing: ' . $vital_key); } $this->bo...
[ "private", "function", "validateAndSetBotParamsVital", "(", "array", "$", "params", ")", "{", "foreach", "(", "self", "::", "$", "valid_vital_bot_params", "as", "$", "vital_key", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "vital_key", ",", "$", ...
Set all vital params. @param array $params @throws \TelegramBot\TelegramBotManager\Exception\InvalidParamsException
[ "Set", "all", "vital", "params", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/Params.php#L134-L143
34,851
php-telegram-bot/telegram-bot-manager
src/Params.php
Params.validateAndSetBotParamsSpecial
private function validateAndSetBotParamsSpecial(array $params) { // Special case, where secret MUST be defined if we have a webhook. if (($params['webhook']['url'] ?? null) && !($params['secret'] ?? null)) { // This does not apply when using CLI, but make sure it gets tested for! ...
php
private function validateAndSetBotParamsSpecial(array $params) { // Special case, where secret MUST be defined if we have a webhook. if (($params['webhook']['url'] ?? null) && !($params['secret'] ?? null)) { // This does not apply when using CLI, but make sure it gets tested for! ...
[ "private", "function", "validateAndSetBotParamsSpecial", "(", "array", "$", "params", ")", "{", "// Special case, where secret MUST be defined if we have a webhook.", "if", "(", "(", "$", "params", "[", "'webhook'", "]", "[", "'url'", "]", "??", "null", ")", "&&", "...
Special case parameters. @param array $params @throws \TelegramBot\TelegramBotManager\Exception\InvalidParamsException
[ "Special", "case", "parameters", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/Params.php#L152-L161
34,852
php-telegram-bot/telegram-bot-manager
src/Params.php
Params.validateAndSetBotParamsExtra
private function validateAndSetBotParamsExtra(array $params) { foreach (self::$valid_extra_bot_params as $extra_key) { if (!array_key_exists($extra_key, $params)) { continue; } $this->bot_params[$extra_key] = $params[$extra_key]; } }
php
private function validateAndSetBotParamsExtra(array $params) { foreach (self::$valid_extra_bot_params as $extra_key) { if (!array_key_exists($extra_key, $params)) { continue; } $this->bot_params[$extra_key] = $params[$extra_key]; } }
[ "private", "function", "validateAndSetBotParamsExtra", "(", "array", "$", "params", ")", "{", "foreach", "(", "self", "::", "$", "valid_extra_bot_params", "as", "$", "extra_key", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "extra_key", ",", "$", ...
Set all extra params. @param array $params
[ "Set", "all", "extra", "params", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/Params.php#L168-L177
34,853
php-telegram-bot/telegram-bot-manager
src/Params.php
Params.setScriptParams
private function setScriptParams() { $this->script_params = $_GET; // If we're not running from CLI, script parameters are already set from $_GET. if ('cli' !== PHP_SAPI) { return; } // We don't need the first arg (the file name). $args = \array_slice($_...
php
private function setScriptParams() { $this->script_params = $_GET; // If we're not running from CLI, script parameters are already set from $_GET. if ('cli' !== PHP_SAPI) { return; } // We don't need the first arg (the file name). $args = \array_slice($_...
[ "private", "function", "setScriptParams", "(", ")", "{", "$", "this", "->", "script_params", "=", "$", "_GET", ";", "// If we're not running from CLI, script parameters are already set from $_GET.", "if", "(", "'cli'", "!==", "PHP_SAPI", ")", "{", "return", ";", "}", ...
Set script parameters from query string or CLI.
[ "Set", "script", "parameters", "from", "query", "string", "or", "CLI", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/Params.php#L198-L215
34,854
php-telegram-bot/telegram-bot-manager
src/Params.php
Params.validateScriptParams
private function validateScriptParams() { $this->script_params = array_intersect_key( $this->script_params, array_fill_keys(self::$valid_script_params, null) ); }
php
private function validateScriptParams() { $this->script_params = array_intersect_key( $this->script_params, array_fill_keys(self::$valid_script_params, null) ); }
[ "private", "function", "validateScriptParams", "(", ")", "{", "$", "this", "->", "script_params", "=", "array_intersect_key", "(", "$", "this", "->", "script_params", ",", "array_fill_keys", "(", "self", "::", "$", "valid_script_params", ",", "null", ")", ")", ...
Keep only valid script parameters.
[ "Keep", "only", "valid", "script", "parameters", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/Params.php#L220-L226
34,855
php-telegram-bot/telegram-bot-manager
src/Params.php
Params.getBotParam
public function getBotParam(string $param, $default = null) { $param_path = explode('.', $param); $value = $this->bot_params[array_shift($param_path)] ?? null; foreach ($param_path as $sub_param_key) { $value = $value[$sub_param_key] ?? null; if (null === $value) { ...
php
public function getBotParam(string $param, $default = null) { $param_path = explode('.', $param); $value = $this->bot_params[array_shift($param_path)] ?? null; foreach ($param_path as $sub_param_key) { $value = $value[$sub_param_key] ?? null; if (null === $value) { ...
[ "public", "function", "getBotParam", "(", "string", "$", "param", ",", "$", "default", "=", "null", ")", "{", "$", "param_path", "=", "explode", "(", "'.'", ",", "$", "param", ")", ";", "$", "value", "=", "$", "this", "->", "bot_params", "[", "array_...
Get a specific bot param, allowing array-dot notation. @param string $param @param mixed $default @return mixed
[ "Get", "a", "specific", "bot", "param", "allowing", "array", "-", "dot", "notation", "." ]
62333217bdd00fe140ca33ef5a45c16139bc675a
https://github.com/php-telegram-bot/telegram-bot-manager/blob/62333217bdd00fe140ca33ef5a45c16139bc675a/src/Params.php#L236-L249
34,856
zicht/messages-bundle
src/Zicht/Bundle/MessagesBundle/Admin/MessageAdmin.php
MessageAdmin.filteredOnTranslations
public function filteredOnTranslations($queryBuilder, $alias, $field, $value) { if (!$value['value']) { return false; } $queryBuilder->leftJoin(sprintf('%s.translations', $alias), 't'); $queryBuilder->andWhere( $queryBuilder->expr()->orX( ...
php
public function filteredOnTranslations($queryBuilder, $alias, $field, $value) { if (!$value['value']) { return false; } $queryBuilder->leftJoin(sprintf('%s.translations', $alias), 't'); $queryBuilder->andWhere( $queryBuilder->expr()->orX( ...
[ "public", "function", "filteredOnTranslations", "(", "$", "queryBuilder", ",", "$", "alias", ",", "$", "field", ",", "$", "value", ")", "{", "if", "(", "!", "$", "value", "[", "'value'", "]", ")", "{", "return", "false", ";", "}", "$", "queryBuilder", ...
Custom search handler Changes the filter behaviour to also search in the message_translation table @param \Doctrine\ORM\QueryBuilder $queryBuilder @param string $alias @param string $field @param array $value @return bool
[ "Custom", "search", "handler" ]
779797b5bd263e0619bba88ec29ef77ec49be52d
https://github.com/zicht/messages-bundle/blob/779797b5bd263e0619bba88ec29ef77ec49be52d/src/Zicht/Bundle/MessagesBundle/Admin/MessageAdmin.php#L130-L148
34,857
duncan3dc/object-intruder
src/Intruder.php
Intruder.getReflection
private function getReflection(): \ReflectionClass { if ($this->_intruderReflection === null) { $this->_intruderReflection = new \ReflectionClass($this->_intruderInstance); } return $this->_intruderReflection; }
php
private function getReflection(): \ReflectionClass { if ($this->_intruderReflection === null) { $this->_intruderReflection = new \ReflectionClass($this->_intruderInstance); } return $this->_intruderReflection; }
[ "private", "function", "getReflection", "(", ")", ":", "\\", "ReflectionClass", "{", "if", "(", "$", "this", "->", "_intruderReflection", "===", "null", ")", "{", "$", "this", "->", "_intruderReflection", "=", "new", "\\", "ReflectionClass", "(", "$", "this"...
Get a reflection class of the object we are wrapping. @return \ReflectionClass
[ "Get", "a", "reflection", "class", "of", "the", "object", "we", "are", "wrapping", "." ]
40388a680eac9d4558e56df990c177555ba59ed8
https://github.com/duncan3dc/object-intruder/blob/40388a680eac9d4558e56df990c177555ba59ed8/src/Intruder.php#L45-L52
34,858
duncan3dc/object-intruder
src/Intruder.php
Intruder.getProperty
private function getProperty(string $name): \ReflectionProperty { $class = $this->getReflection(); # See if the literal class has this property if ($class->hasProperty($name)) { return $class->getProperty($name); } # If not this class then check its parents ...
php
private function getProperty(string $name): \ReflectionProperty { $class = $this->getReflection(); # See if the literal class has this property if ($class->hasProperty($name)) { return $class->getProperty($name); } # If not this class then check its parents ...
[ "private", "function", "getProperty", "(", "string", "$", "name", ")", ":", "\\", "ReflectionProperty", "{", "$", "class", "=", "$", "this", "->", "getReflection", "(", ")", ";", "# See if the literal class has this property", "if", "(", "$", "class", "->", "h...
Go hunting for a property up the class hierarchy. @param string $name The name of the property we're looking for @return \ReflectionProperty
[ "Go", "hunting", "for", "a", "property", "up", "the", "class", "hierarchy", "." ]
40388a680eac9d4558e56df990c177555ba59ed8
https://github.com/duncan3dc/object-intruder/blob/40388a680eac9d4558e56df990c177555ba59ed8/src/Intruder.php#L62-L86
34,859
duncan3dc/object-intruder
src/Intruder.php
Intruder._call
public function _call(string $name, &...$arguments) { $method = $this->getReflection()->getMethod($name); $method->setAccessible(true); return $method->invokeArgs($this->getInstance(), $arguments); }
php
public function _call(string $name, &...$arguments) { $method = $this->getReflection()->getMethod($name); $method->setAccessible(true); return $method->invokeArgs($this->getInstance(), $arguments); }
[ "public", "function", "_call", "(", "string", "$", "name", ",", "&", "...", "$", "arguments", ")", "{", "$", "method", "=", "$", "this", "->", "getReflection", "(", ")", "->", "getMethod", "(", "$", "name", ")", ";", "$", "method", "->", "setAccessib...
Allow methods with references to be called. @param string $name The name of the method to call @param array<int, mixed> ...$arguments Any parameters the method accepts @return mixed
[ "Allow", "methods", "with", "references", "to", "be", "called", "." ]
40388a680eac9d4558e56df990c177555ba59ed8
https://github.com/duncan3dc/object-intruder/blob/40388a680eac9d4558e56df990c177555ba59ed8/src/Intruder.php#L142-L148
34,860
zicht/messages-bundle
src/Zicht/Bundle/MessagesBundle/Entity/Message.php
Message.hasTranslation
public function hasTranslation($locale) { foreach ($this->translations as $translation) { if ($locale == $translation->locale) { return $translation; } } return false; }
php
public function hasTranslation($locale) { foreach ($this->translations as $translation) { if ($locale == $translation->locale) { return $translation; } } return false; }
[ "public", "function", "hasTranslation", "(", "$", "locale", ")", "{", "foreach", "(", "$", "this", "->", "translations", "as", "$", "translation", ")", "{", "if", "(", "$", "locale", "==", "$", "translation", "->", "locale", ")", "{", "return", "$", "t...
Checks if the translation for the specified locale exists. @param string $locale @return bool
[ "Checks", "if", "the", "translation", "for", "the", "specified", "locale", "exists", "." ]
779797b5bd263e0619bba88ec29ef77ec49be52d
https://github.com/zicht/messages-bundle/blob/779797b5bd263e0619bba88ec29ef77ec49be52d/src/Zicht/Bundle/MessagesBundle/Entity/Message.php#L100-L108
34,861
zicht/messages-bundle
src/Zicht/Bundle/MessagesBundle/Entity/Message.php
Message.addMissingTranslations
public function addMissingTranslations($locales) { foreach ($locales as $localeCode) { if (!$this->hasTranslation($localeCode)) { $this->addTranslations(new MessageTranslation($localeCode, $this->getMessage())); } } foreach ($this->translations as $tr...
php
public function addMissingTranslations($locales) { foreach ($locales as $localeCode) { if (!$this->hasTranslation($localeCode)) { $this->addTranslations(new MessageTranslation($localeCode, $this->getMessage())); } } foreach ($this->translations as $tr...
[ "public", "function", "addMissingTranslations", "(", "$", "locales", ")", "{", "foreach", "(", "$", "locales", "as", "$", "localeCode", ")", "{", "if", "(", "!", "$", "this", "->", "hasTranslation", "(", "$", "localeCode", ")", ")", "{", "$", "this", "...
Adds missing translations @param array $locales @return void
[ "Adds", "missing", "translations" ]
779797b5bd263e0619bba88ec29ef77ec49be52d
https://github.com/zicht/messages-bundle/blob/779797b5bd263e0619bba88ec29ef77ec49be52d/src/Zicht/Bundle/MessagesBundle/Entity/Message.php#L117-L128
34,862
zicht/messages-bundle
src/Zicht/Bundle/MessagesBundle/Subscriber/FlushCatalogueCacheSubscriber.php
FlushCatalogueCacheSubscriber.onFlush
public function onFlush($args) { if (!$this->isDirty) { /** @var $em \Doctrine\ORM\EntityManager */ $em = $args->getEntityManager(); /** @var $uow \Doctrine\ORM\UnitOfWork */ $uow = $em->getUnitOfWork(); $array = array( $uow->getS...
php
public function onFlush($args) { if (!$this->isDirty) { /** @var $em \Doctrine\ORM\EntityManager */ $em = $args->getEntityManager(); /** @var $uow \Doctrine\ORM\UnitOfWork */ $uow = $em->getUnitOfWork(); $array = array( $uow->getS...
[ "public", "function", "onFlush", "(", "$", "args", ")", "{", "if", "(", "!", "$", "this", "->", "isDirty", ")", "{", "/** @var $em \\Doctrine\\ORM\\EntityManager */", "$", "em", "=", "$", "args", "->", "getEntityManager", "(", ")", ";", "/** @var $uow \\Doctri...
Listens to the flush event and checks if any of the configured entities was inserted, updated or deleted. If so, invokes the helper to @param mixed $args @return void
[ "Listens", "to", "the", "flush", "event", "and", "checks", "if", "any", "of", "the", "configured", "entities", "was", "inserted", "updated", "or", "deleted", ".", "If", "so", "invokes", "the", "helper", "to" ]
779797b5bd263e0619bba88ec29ef77ec49be52d
https://github.com/zicht/messages-bundle/blob/779797b5bd263e0619bba88ec29ef77ec49be52d/src/Zicht/Bundle/MessagesBundle/Subscriber/FlushCatalogueCacheSubscriber.php#L54-L86
34,863
zicht/messages-bundle
src/Zicht/Bundle/MessagesBundle/Manager/MessageManager.php
MessageManager.getOverwriteValue
protected function getOverwriteValue($state, $overwrites) { if (is_array($overwrites) && array_key_exists($state, $overwrites)) { return $overwrites[$state]; } return false; }
php
protected function getOverwriteValue($state, $overwrites) { if (is_array($overwrites) && array_key_exists($state, $overwrites)) { return $overwrites[$state]; } return false; }
[ "protected", "function", "getOverwriteValue", "(", "$", "state", ",", "$", "overwrites", ")", "{", "if", "(", "is_array", "(", "$", "overwrites", ")", "&&", "array_key_exists", "(", "$", "state", ",", "$", "overwrites", ")", ")", "{", "return", "$", "ove...
Helper function for more readable check @param string $state @param mixed $overwrites @return bool
[ "Helper", "function", "for", "more", "readable", "check" ]
779797b5bd263e0619bba88ec29ef77ec49be52d
https://github.com/zicht/messages-bundle/blob/779797b5bd263e0619bba88ec29ef77ec49be52d/src/Zicht/Bundle/MessagesBundle/Manager/MessageManager.php#L245-L251
34,864
zicht/messages-bundle
src/Zicht/Bundle/MessagesBundle/Manager/MessageManager.php
MessageManager.check
public function check(TranslatorInterface $translator, $kernelRoot, $fix = false) { $issues = array(); /** @var Message[] $messages */ $messages = $this->getRepository()->findAll(); foreach ($messages as $message) { foreach ($message->getTranslations() as $translation) { ...
php
public function check(TranslatorInterface $translator, $kernelRoot, $fix = false) { $issues = array(); /** @var Message[] $messages */ $messages = $this->getRepository()->findAll(); foreach ($messages as $message) { foreach ($message->getTranslations() as $translation) { ...
[ "public", "function", "check", "(", "TranslatorInterface", "$", "translator", ",", "$", "kernelRoot", ",", "$", "fix", "=", "false", ")", "{", "$", "issues", "=", "array", "(", ")", ";", "/** @var Message[] $messages */", "$", "messages", "=", "$", "this", ...
Does some sanity checks @param TranslatorInterface $translator @param string $kernelRoot @param bool $fix @return array
[ "Does", "some", "sanity", "checks" ]
779797b5bd263e0619bba88ec29ef77ec49be52d
https://github.com/zicht/messages-bundle/blob/779797b5bd263e0619bba88ec29ef77ec49be52d/src/Zicht/Bundle/MessagesBundle/Manager/MessageManager.php#L272-L308
34,865
DarvinStudio/darvin-utils
Composer/ScriptHandler.php
ScriptHandler.exportAssetsVersion
public static function exportAssetsVersion() { $process = new Process('git log -n 1'); if (0 !== $process->run()) { return; } $output = $process->getOutput(); if (empty($output)) { return; } putenv(self::ENV_ASSETS_VERSION.'='.md5($...
php
public static function exportAssetsVersion() { $process = new Process('git log -n 1'); if (0 !== $process->run()) { return; } $output = $process->getOutput(); if (empty($output)) { return; } putenv(self::ENV_ASSETS_VERSION.'='.md5($...
[ "public", "static", "function", "exportAssetsVersion", "(", ")", "{", "$", "process", "=", "new", "Process", "(", "'git log -n 1'", ")", ";", "if", "(", "0", "!==", "$", "process", "->", "run", "(", ")", ")", "{", "return", ";", "}", "$", "output", "...
Exports assets version environment variable
[ "Exports", "assets", "version", "environment", "variable" ]
9bdf101cd2fbd5d5f58300a4155bbd4c105ed649
https://github.com/DarvinStudio/darvin-utils/blob/9bdf101cd2fbd5d5f58300a4155bbd4c105ed649/Composer/ScriptHandler.php#L25-L40
34,866
zicht/messages-bundle
src/Zicht/Bundle/MessagesBundle/Entity/MessageRepository.php
MessageRepository.getTranslations
public function getTranslations($locale, $domain) { $conn = $this->getEntityManager()->getConnection(); $stmt = $conn->executeQuery( 'SELECT m.message, t.translation FROM message m JOIN message_translation t ON (t.message_id = m.id AND t.locale = ? ) WHERE m.domain = ?', [$lo...
php
public function getTranslations($locale, $domain) { $conn = $this->getEntityManager()->getConnection(); $stmt = $conn->executeQuery( 'SELECT m.message, t.translation FROM message m JOIN message_translation t ON (t.message_id = m.id AND t.locale = ? ) WHERE m.domain = ?', [$lo...
[ "public", "function", "getTranslations", "(", "$", "locale", ",", "$", "domain", ")", "{", "$", "conn", "=", "$", "this", "->", "getEntityManager", "(", ")", "->", "getConnection", "(", ")", ";", "$", "stmt", "=", "$", "conn", "->", "executeQuery", "("...
Returns all translations for the specified domain @param string $locale @param string $domain @return \Generator
[ "Returns", "all", "translations", "for", "the", "specified", "domain" ]
779797b5bd263e0619bba88ec29ef77ec49be52d
https://github.com/zicht/messages-bundle/blob/779797b5bd263e0619bba88ec29ef77ec49be52d/src/Zicht/Bundle/MessagesBundle/Entity/MessageRepository.php#L24-L34
34,867
zicht/messages-bundle
src/Zicht/Bundle/MessagesBundle/Entity/MessageRepository.php
MessageRepository.getDomains
public function getDomains() { $q = $this ->createQueryBuilder('m') ->select('m.domain') ->distinct() ->orderBy('m.domain'); $ret = array(); foreach ($q->getQuery()->execute() as $result) { $ret[$result['domain']] = $result['domain...
php
public function getDomains() { $q = $this ->createQueryBuilder('m') ->select('m.domain') ->distinct() ->orderBy('m.domain'); $ret = array(); foreach ($q->getQuery()->execute() as $result) { $ret[$result['domain']] = $result['domain...
[ "public", "function", "getDomains", "(", ")", "{", "$", "q", "=", "$", "this", "->", "createQueryBuilder", "(", "'m'", ")", "->", "select", "(", "'m.domain'", ")", "->", "distinct", "(", ")", "->", "orderBy", "(", "'m.domain'", ")", ";", "$", "ret", ...
Returns all domains that are defined in the database @return array
[ "Returns", "all", "domains", "that", "are", "defined", "in", "the", "database" ]
779797b5bd263e0619bba88ec29ef77ec49be52d
https://github.com/zicht/messages-bundle/blob/779797b5bd263e0619bba88ec29ef77ec49be52d/src/Zicht/Bundle/MessagesBundle/Entity/MessageRepository.php#L41-L54
34,868
starweb/starlit-utils
src/Arr.php
Arr.anyIn
public static function anyIn($anyValue, array $array): bool { if (is_array($anyValue)) { return (bool) array_intersect($anyValue, $array); } return in_array($anyValue, $array); }
php
public static function anyIn($anyValue, array $array): bool { if (is_array($anyValue)) { return (bool) array_intersect($anyValue, $array); } return in_array($anyValue, $array); }
[ "public", "static", "function", "anyIn", "(", "$", "anyValue", ",", "array", "$", "array", ")", ":", "bool", "{", "if", "(", "is_array", "(", "$", "anyValue", ")", ")", "{", "return", "(", "bool", ")", "array_intersect", "(", "$", "anyValue", ",", "$...
If any of the provided values is in an array. This is a convenient function for constructs like in_array('val1', $a) || in_array('val2, $a) etc. @param array|string $anyValue Array of needles (will try any for a match) @param array $array Haystack array @return bool
[ "If", "any", "of", "the", "provided", "values", "is", "in", "an", "array", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Arr.php#L22-L29
34,869
starweb/starlit-utils
src/Arr.php
Arr.allIn
public static function allIn($allValues, array $array): bool { if (is_array($allValues)) { if (empty($allValues)) { return false; } foreach ($allValues as $value) { if (!in_array($value, $array)) { return false; ...
php
public static function allIn($allValues, array $array): bool { if (is_array($allValues)) { if (empty($allValues)) { return false; } foreach ($allValues as $value) { if (!in_array($value, $array)) { return false; ...
[ "public", "static", "function", "allIn", "(", "$", "allValues", ",", "array", "$", "array", ")", ":", "bool", "{", "if", "(", "is_array", "(", "$", "allValues", ")", ")", "{", "if", "(", "empty", "(", "$", "allValues", ")", ")", "{", "return", "fal...
If all of the provided values is in an array. This is a convenient function for constructs like in_array('val1', $a) && in_array('val2, $a) etc. @param array|mixed $allValues Array of needles (will try all for a match) @param array $array Haystack array @return bool
[ "If", "all", "of", "the", "provided", "values", "is", "in", "an", "array", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Arr.php#L40-L58
34,870
starweb/starlit-utils
src/Arr.php
Arr.objectsMethodValues
public static function objectsMethodValues(array $objectArray, string $methodName): array { $methodValues = []; foreach ($objectArray as $object) { $methodValues[] = $object->$methodName(); } return $methodValues; }
php
public static function objectsMethodValues(array $objectArray, string $methodName): array { $methodValues = []; foreach ($objectArray as $object) { $methodValues[] = $object->$methodName(); } return $methodValues; }
[ "public", "static", "function", "objectsMethodValues", "(", "array", "$", "objectArray", ",", "string", "$", "methodName", ")", ":", "array", "{", "$", "methodValues", "=", "[", "]", ";", "foreach", "(", "$", "objectArray", "as", "$", "object", ")", "{", ...
Collect values from method calls from an array of objects. @param array $objectArray @param string $methodName @return array
[ "Collect", "values", "from", "method", "calls", "from", "an", "array", "of", "objects", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Arr.php#L131-L140
34,871
starweb/starlit-utils
src/Arr.php
Arr.valuesWithType
public static function valuesWithType(array $inputArray, string $type): array { $newArray = []; foreach ($inputArray as $key => $value) { if (is_scalar($value)) { $newValue = $value; settype($newValue, $type); $newArray[$key] = $newValue; ...
php
public static function valuesWithType(array $inputArray, string $type): array { $newArray = []; foreach ($inputArray as $key => $value) { if (is_scalar($value)) { $newValue = $value; settype($newValue, $type); $newArray[$key] = $newValue; ...
[ "public", "static", "function", "valuesWithType", "(", "array", "$", "inputArray", ",", "string", "$", "type", ")", ":", "array", "{", "$", "newArray", "=", "[", "]", ";", "foreach", "(", "$", "inputArray", "as", "$", "key", "=>", "$", "value", ")", ...
Get a new array with all scalar values cast to type. @param array $inputArray @param string $type @return array
[ "Get", "a", "new", "array", "with", "all", "scalar", "values", "cast", "to", "type", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Arr.php#L149-L161
34,872
starweb/starlit-utils
src/Arr.php
Arr.replaceExisting
public static function replaceExisting(array $array1, array $array2, bool $recursive = false): array { foreach ($array1 as $key => $value) { if (array_key_exists($key, $array2)) { $value2 = $array2[$key]; if ($recursive && is_array($value)) { $...
php
public static function replaceExisting(array $array1, array $array2, bool $recursive = false): array { foreach ($array1 as $key => $value) { if (array_key_exists($key, $array2)) { $value2 = $array2[$key]; if ($recursive && is_array($value)) { $...
[ "public", "static", "function", "replaceExisting", "(", "array", "$", "array1", ",", "array", "$", "array2", ",", "bool", "$", "recursive", "=", "false", ")", ":", "array", "{", "foreach", "(", "$", "array1", "as", "$", "key", "=>", "$", "value", ")", ...
Replaces values in array1 with values from array2 comparing keys and discarding keys that doesn't exist in array1. @param array $array1 @param array $array2 @param bool $recursive @return array
[ "Replaces", "values", "in", "array1", "with", "values", "from", "array2", "comparing", "keys", "and", "discarding", "keys", "that", "doesn", "t", "exist", "in", "array1", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Arr.php#L172-L185
34,873
starweb/starlit-utils
src/Arr.php
Arr.sortByArray
public static function sortByArray(array $sortArray, array $mapArray): array { $sortedArray = []; foreach ((array) $mapArray as $id) { if (array_key_exists($id, $sortArray)) { $sortedArray[] = $sortArray[$id]; } } return $sortedArray; }
php
public static function sortByArray(array $sortArray, array $mapArray): array { $sortedArray = []; foreach ((array) $mapArray as $id) { if (array_key_exists($id, $sortArray)) { $sortedArray[] = $sortArray[$id]; } } return $sortedArray; }
[ "public", "static", "function", "sortByArray", "(", "array", "$", "sortArray", ",", "array", "$", "mapArray", ")", ":", "array", "{", "$", "sortedArray", "=", "[", "]", ";", "foreach", "(", "(", "array", ")", "$", "mapArray", "as", "$", "id", ")", "{...
Sort by array. @param array $sortArray @param array $mapArray @return array
[ "Sort", "by", "array", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Arr.php#L194-L204
34,874
gocom/rah_cache
src/Rah/Cache.php
Rah_Cache.controller
public function controller($atts) { extract(lAtts(array( 'ignore' => 0, ), $atts)); if ($ignore) { $this->request->file = null; } }
php
public function controller($atts) { extract(lAtts(array( 'ignore' => 0, ), $atts)); if ($ignore) { $this->request->file = null; } }
[ "public", "function", "controller", "(", "$", "atts", ")", "{", "extract", "(", "lAtts", "(", "array", "(", "'ignore'", "=>", "0", ",", ")", ",", "$", "atts", ")", ")", ";", "if", "(", "$", "ignore", ")", "{", "$", "this", "->", "request", "->", ...
A tag to control caching on a page basis. @param array $atts @return string
[ "A", "tag", "to", "control", "caching", "on", "a", "page", "basis", "." ]
a7b98a265d57d76339b7f9f4beacdccaa2be33e8
https://github.com/gocom/rah_cache/blob/a7b98a265d57d76339b7f9f4beacdccaa2be33e8/src/Rah/Cache.php#L72-L81
34,875
gocom/rah_cache
src/Rah/Cache.php
Rah_Cache.getHeaders
protected function getHeaders() { if (function_exists('headers_list') && $headers = headers_list()) { foreach ((array) $headers as $header) { if (strpos($header, ':')) { $header = explode(':', strtolower($header), 2); $this->headers[trim($h...
php
protected function getHeaders() { if (function_exists('headers_list') && $headers = headers_list()) { foreach ((array) $headers as $header) { if (strpos($header, ':')) { $header = explode(':', strtolower($header), 2); $this->headers[trim($h...
[ "protected", "function", "getHeaders", "(", ")", "{", "if", "(", "function_exists", "(", "'headers_list'", ")", "&&", "$", "headers", "=", "headers_list", "(", ")", ")", "{", "foreach", "(", "(", "array", ")", "$", "headers", "as", "$", "header", ")", ...
Gets sent response headers.
[ "Gets", "sent", "response", "headers", "." ]
a7b98a265d57d76339b7f9f4beacdccaa2be33e8
https://github.com/gocom/rah_cache/blob/a7b98a265d57d76339b7f9f4beacdccaa2be33e8/src/Rah/Cache.php#L87-L97
34,876
gocom/rah_cache
src/Rah/Cache.php
Rah_Cache.store
public function store() { if (empty($this->request->file) || get_pref('production_status') != 'live') { return; } foreach ($this->config->skipPaths as $path) { if (strpos($this->request->uri, $path) === 0) { return; } } $t...
php
public function store() { if (empty($this->request->file) || get_pref('production_status') != 'live') { return; } foreach ($this->config->skipPaths as $path) { if (strpos($this->request->uri, $path) === 0) { return; } } $t...
[ "public", "function", "store", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "request", "->", "file", ")", "||", "get_pref", "(", "'production_status'", ")", "!=", "'live'", ")", "{", "return", ";", "}", "foreach", "(", "$", "this", "->"...
Writes the page to the cache directory.
[ "Writes", "the", "page", "to", "the", "cache", "directory", "." ]
a7b98a265d57d76339b7f9f4beacdccaa2be33e8
https://github.com/gocom/rah_cache/blob/a7b98a265d57d76339b7f9f4beacdccaa2be33e8/src/Rah/Cache.php#L102-L147
34,877
gocom/rah_cache
src/Rah/Cache.php
Rah_Cache.updateLastmod
public function updateLastmod() { if ($this->config->directory) { $lastmod = $this->config->directory . '/_lastmod.rah'; if (!is_file($lastmod) || file_get_contents($lastmod) !== get_pref('lastmod', false, true)) { file_put_contents($lastmod, get_pref('lastmod', '', ...
php
public function updateLastmod() { if ($this->config->directory) { $lastmod = $this->config->directory . '/_lastmod.rah'; if (!is_file($lastmod) || file_get_contents($lastmod) !== get_pref('lastmod', false, true)) { file_put_contents($lastmod, get_pref('lastmod', '', ...
[ "public", "function", "updateLastmod", "(", ")", "{", "if", "(", "$", "this", "->", "config", "->", "directory", ")", "{", "$", "lastmod", "=", "$", "this", "->", "config", "->", "directory", ".", "'/_lastmod.rah'", ";", "if", "(", "!", "is_file", "(",...
Update last modification timestamp.
[ "Update", "last", "modification", "timestamp", "." ]
a7b98a265d57d76339b7f9f4beacdccaa2be33e8
https://github.com/gocom/rah_cache/blob/a7b98a265d57d76339b7f9f4beacdccaa2be33e8/src/Rah/Cache.php#L152-L161
34,878
gocom/rah_cache
src/Rah/Cache/Handler.php
Rah_Cache_Handler.encoding
public function encoding() { if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']) || headers_sent()) { return false; } $accept_encoding = $_SERVER['HTTP_ACCEPT_ENCODING']; if (strpos($accept_encoding, 'x-gzip') !== false) { return 'x-gzip'; } if (st...
php
public function encoding() { if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']) || headers_sent()) { return false; } $accept_encoding = $_SERVER['HTTP_ACCEPT_ENCODING']; if (strpos($accept_encoding, 'x-gzip') !== false) { return 'x-gzip'; } if (st...
[ "public", "function", "encoding", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "_SERVER", "[", "'HTTP_ACCEPT_ENCODING'", "]", ")", "||", "headers_sent", "(", ")", ")", "{", "return", "false", ";", "}", "$", "accept_encoding", "=", "$", "_SERVER", ...
Check accepted encoding headers. @return bool
[ "Check", "accepted", "encoding", "headers", "." ]
a7b98a265d57d76339b7f9f4beacdccaa2be33e8
https://github.com/gocom/rah_cache/blob/a7b98a265d57d76339b7f9f4beacdccaa2be33e8/src/Rah/Cache/Handler.php#L119-L136
34,879
starweb/starlit-utils
src/Str.php
Str.random
public static function random(int $charCount, string $characters = 'abcdefghijklmnopqrstuvqxyz0123456789'): string { $randomString = ''; for ($i = 0; $i < $charCount; $i++) { $pos = mt_rand(0, strlen($characters) - 1); $randomString .= $characters[$pos]; } re...
php
public static function random(int $charCount, string $characters = 'abcdefghijklmnopqrstuvqxyz0123456789'): string { $randomString = ''; for ($i = 0; $i < $charCount; $i++) { $pos = mt_rand(0, strlen($characters) - 1); $randomString .= $characters[$pos]; } re...
[ "public", "static", "function", "random", "(", "int", "$", "charCount", ",", "string", "$", "characters", "=", "'abcdefghijklmnopqrstuvqxyz0123456789'", ")", ":", "string", "{", "$", "randomString", "=", "''", ";", "for", "(", "$", "i", "=", "0", ";", "$",...
Get a random string generated from provided values. @param int $charCount @param string $characters @return string
[ "Get", "a", "random", "string", "generated", "from", "provided", "values", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Str.php#L62-L71
34,880
starweb/starlit-utils
src/Str.php
Str.truncate
public static function truncate(string $string, int $maxLength, string $indicator = '...'): string { if (mb_strlen($string) > $maxLength) { $string = mb_substr($string, 0, $maxLength - mb_strlen($indicator)) . $indicator; } return $string; }
php
public static function truncate(string $string, int $maxLength, string $indicator = '...'): string { if (mb_strlen($string) > $maxLength) { $string = mb_substr($string, 0, $maxLength - mb_strlen($indicator)) . $indicator; } return $string; }
[ "public", "static", "function", "truncate", "(", "string", "$", "string", ",", "int", "$", "maxLength", ",", "string", "$", "indicator", "=", "'...'", ")", ":", "string", "{", "if", "(", "mb_strlen", "(", "$", "string", ")", ">", "$", "maxLength", ")",...
Get shortened string. @param string $string @param int $maxLength @param string $indicator @return string
[ "Get", "shortened", "string", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Str.php#L81-L88
34,881
starweb/starlit-utils
src/Str.php
Str.endsWith
public static function endsWith(string $string, string $search): bool { return (substr($string, -strlen($search)) === $search); }
php
public static function endsWith(string $string, string $search): bool { return (substr($string, -strlen($search)) === $search); }
[ "public", "static", "function", "endsWith", "(", "string", "$", "string", ",", "string", "$", "search", ")", ":", "bool", "{", "return", "(", "substr", "(", "$", "string", ",", "-", "strlen", "(", "$", "search", ")", ")", "===", "$", "search", ")", ...
Check if a string ends with another substring. @param string $string @param string $search @return bool
[ "Check", "if", "a", "string", "ends", "with", "another", "substring", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Str.php#L109-L112
34,882
starweb/starlit-utils
src/Str.php
Str.stripLeft
public static function stripLeft(string $string, string $strip): string { if (self::startsWith($string, $strip)) { return substr($string, strlen($strip)); } return $string; }
php
public static function stripLeft(string $string, string $strip): string { if (self::startsWith($string, $strip)) { return substr($string, strlen($strip)); } return $string; }
[ "public", "static", "function", "stripLeft", "(", "string", "$", "string", ",", "string", "$", "strip", ")", ":", "string", "{", "if", "(", "self", "::", "startsWith", "(", "$", "string", ",", "$", "strip", ")", ")", "{", "return", "substr", "(", "$"...
Remove left part of string and return the new string. @param string $string @param string $strip @return string
[ "Remove", "left", "part", "of", "string", "and", "return", "the", "new", "string", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Str.php#L121-L128
34,883
starweb/starlit-utils
src/Str.php
Str.stripRight
public static function stripRight(string $string, string $strip): string { if (self::endsWith($string, $strip)) { return substr($string, 0, -strlen($strip)); } return $string; }
php
public static function stripRight(string $string, string $strip): string { if (self::endsWith($string, $strip)) { return substr($string, 0, -strlen($strip)); } return $string; }
[ "public", "static", "function", "stripRight", "(", "string", "$", "string", ",", "string", "$", "strip", ")", ":", "string", "{", "if", "(", "self", "::", "endsWith", "(", "$", "string", ",", "$", "strip", ")", ")", "{", "return", "substr", "(", "$",...
Remove right part of string and return the new string. @param string $string @param string $strip @return string
[ "Remove", "right", "part", "of", "string", "and", "return", "the", "new", "string", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Str.php#L137-L144
34,884
starweb/starlit-utils
src/Str.php
Str.toNumber
public static function toNumber(string $string, bool $allowDecimal = false, bool $allowNegative = false): string { $string = trim($string); $decimalPart = ''; if (($firstPos = strpos($string, '.')) !== false) { $integerPart = substr($string, 0, $firstPos); if ($allow...
php
public static function toNumber(string $string, bool $allowDecimal = false, bool $allowNegative = false): string { $string = trim($string); $decimalPart = ''; if (($firstPos = strpos($string, '.')) !== false) { $integerPart = substr($string, 0, $firstPos); if ($allow...
[ "public", "static", "function", "toNumber", "(", "string", "$", "string", ",", "bool", "$", "allowDecimal", "=", "false", ",", "bool", "$", "allowNegative", "=", "false", ")", ":", "string", "{", "$", "string", "=", "trim", "(", "$", "string", ")", ";"...
Filter out all non numeric characters and return a clean numeric string. @param string $string @param bool $allowDecimal @param bool $allowNegative @return string
[ "Filter", "out", "all", "non", "numeric", "characters", "and", "return", "a", "clean", "numeric", "string", "." ]
01e9220e8821d5b454707bfd39d24c12c08979f2
https://github.com/starweb/starlit-utils/blob/01e9220e8821d5b454707bfd39d24c12c08979f2/src/Str.php#L190-L223
34,885
PhpGt/Build
src/Build.php
Build.check
public function check(array &$errors = null):int { $count = 0; foreach($this->taskList as $pathMatch => $task) { $absolutePathMatch = implode(DIRECTORY_SEPARATOR, [ getcwd(), $pathMatch, ]); $fileList = Glob::glob($absolutePathMatch); if(!empty($fileList)) { $task->check($errors); } ...
php
public function check(array &$errors = null):int { $count = 0; foreach($this->taskList as $pathMatch => $task) { $absolutePathMatch = implode(DIRECTORY_SEPARATOR, [ getcwd(), $pathMatch, ]); $fileList = Glob::glob($absolutePathMatch); if(!empty($fileList)) { $task->check($errors); } ...
[ "public", "function", "check", "(", "array", "&", "$", "errors", "=", "null", ")", ":", "int", "{", "$", "count", "=", "0", ";", "foreach", "(", "$", "this", "->", "taskList", "as", "$", "pathMatch", "=>", "$", "task", ")", "{", "$", "absolutePathM...
For each task, ensure all requirements are met.
[ "For", "each", "task", "ensure", "all", "requirements", "are", "met", "." ]
9ed467dd99c85c7017afe3ee7419f18290d73bb4
https://github.com/PhpGt/Build/blob/9ed467dd99c85c7017afe3ee7419f18290d73bb4/src/Build.php#L22-L39
34,886
PhpGt/Build
src/Build.php
Build.build
public function build(array &$errors = null):array { $updatedTasks = []; foreach($this->taskList as $pathMatch => $task) { if($task->build($errors)) { $updatedTasks []= $task; } } return $updatedTasks; }
php
public function build(array &$errors = null):array { $updatedTasks = []; foreach($this->taskList as $pathMatch => $task) { if($task->build($errors)) { $updatedTasks []= $task; } } return $updatedTasks; }
[ "public", "function", "build", "(", "array", "&", "$", "errors", "=", "null", ")", ":", "array", "{", "$", "updatedTasks", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "taskList", "as", "$", "pathMatch", "=>", "$", "task", ")", "{", "if",...
Executes the commands associated with each build task. @return Task[] List of tasks built (some may not need building due to having no changes).
[ "Executes", "the", "commands", "associated", "with", "each", "build", "task", "." ]
9ed467dd99c85c7017afe3ee7419f18290d73bb4
https://github.com/PhpGt/Build/blob/9ed467dd99c85c7017afe3ee7419f18290d73bb4/src/Build.php#L46-L55
34,887
heyday/silverstripe-colorpalette
src/fields/GroupedColorPaletteField.php
GroupedColorPaletteField.performReadonlyTransformation
public function performReadonlyTransformation() { // Source and values are DataObject sets. $field = $this->castedCopy(GroupedColorPaletteField_Readonly::class); $field->setSource($this->getSource()); $field->setReadonly(true); return $field; }
php
public function performReadonlyTransformation() { // Source and values are DataObject sets. $field = $this->castedCopy(GroupedColorPaletteField_Readonly::class); $field->setSource($this->getSource()); $field->setReadonly(true); return $field; }
[ "public", "function", "performReadonlyTransformation", "(", ")", "{", "// Source and values are DataObject sets.", "$", "field", "=", "$", "this", "->", "castedCopy", "(", "GroupedColorPaletteField_Readonly", "::", "class", ")", ";", "$", "field", "->", "setSource", "...
Gets a readonly version of the field @return GroupedColorPaletteField_Readonly
[ "Gets", "a", "readonly", "version", "of", "the", "field" ]
1a10ecce6bff9db78e124b310316aab17e368b2f
https://github.com/heyday/silverstripe-colorpalette/blob/1a10ecce6bff9db78e124b310316aab17e368b2f/src/fields/GroupedColorPaletteField.php#L94-L102
34,888
heyday/silverstripe-colorpalette
src/fields/GroupedColorPaletteField_Readonly.php
GroupedColorPaletteField_Readonly.getSelectedGroup
public function getSelectedGroup() { $source = $this->getSource(); if ($source) { foreach ($source as $groupName => $values) { if (is_array($values)) { if (array_key_exists($this->value, $values)) { return $groupName; ...
php
public function getSelectedGroup() { $source = $this->getSource(); if ($source) { foreach ($source as $groupName => $values) { if (is_array($values)) { if (array_key_exists($this->value, $values)) { return $groupName; ...
[ "public", "function", "getSelectedGroup", "(", ")", "{", "$", "source", "=", "$", "this", "->", "getSource", "(", ")", ";", "if", "(", "$", "source", ")", "{", "foreach", "(", "$", "source", "as", "$", "groupName", "=>", "$", "values", ")", "{", "i...
Gets the label of the group that the color appears in @return string
[ "Gets", "the", "label", "of", "the", "group", "that", "the", "color", "appears", "in" ]
1a10ecce6bff9db78e124b310316aab17e368b2f
https://github.com/heyday/silverstripe-colorpalette/blob/1a10ecce6bff9db78e124b310316aab17e368b2f/src/fields/GroupedColorPaletteField_Readonly.php#L28-L43
34,889
appstract/laravel-multisite
src/MultisiteServiceProvider.php
MultisiteServiceProvider.registerComposers
protected function registerComposers() { View::composer( '*', \Appstract\Multisite\Composers\CurrentSiteComposer::class ); View::composer( Config::get('multisite.views.overwriteable'), \Appstract\Multisite\Composers\OverwriteViewComposer::clas...
php
protected function registerComposers() { View::composer( '*', \Appstract\Multisite\Composers\CurrentSiteComposer::class ); View::composer( Config::get('multisite.views.overwriteable'), \Appstract\Multisite\Composers\OverwriteViewComposer::clas...
[ "protected", "function", "registerComposers", "(", ")", "{", "View", "::", "composer", "(", "'*'", ",", "\\", "Appstract", "\\", "Multisite", "\\", "Composers", "\\", "CurrentSiteComposer", "::", "class", ")", ";", "View", "::", "composer", "(", "Config", ":...
Register view composers. @return void
[ "Register", "view", "composers", "." ]
a371aae503ae3508bec5c1b9fd196958277b6073
https://github.com/appstract/laravel-multisite/blob/a371aae503ae3508bec5c1b9fd196958277b6073/src/MultisiteServiceProvider.php#L69-L80
34,890
appstract/laravel-multisite
src/Composers/OverwriteViewComposer.php
OverwriteViewComposer.getNewPath
protected function getNewPath() { return $this->getAbsolutesitesFolder().DIRECTORY_SEPARATOR.$this->currentSite->slug.DIRECTORY_SEPARATOR.$this->currentPath; }
php
protected function getNewPath() { return $this->getAbsolutesitesFolder().DIRECTORY_SEPARATOR.$this->currentSite->slug.DIRECTORY_SEPARATOR.$this->currentPath; }
[ "protected", "function", "getNewPath", "(", ")", "{", "return", "$", "this", "->", "getAbsolutesitesFolder", "(", ")", ".", "DIRECTORY_SEPARATOR", ".", "$", "this", "->", "currentSite", "->", "slug", ".", "DIRECTORY_SEPARATOR", ".", "$", "this", "->", "current...
Get the new path. @return string
[ "Get", "the", "new", "path", "." ]
a371aae503ae3508bec5c1b9fd196958277b6073
https://github.com/appstract/laravel-multisite/blob/a371aae503ae3508bec5c1b9fd196958277b6073/src/Composers/OverwriteViewComposer.php#L61-L64
34,891
appstract/laravel-multisite
src/Composers/OverwriteViewComposer.php
OverwriteViewComposer.getNewView
protected function getNewView() { if ($this->currentSite) { return str_replace( ['.blade.php'], [''], $this->sitesFolder.'.'.$this->currentSite->slug.'.'.$this->currentPath ); } return $this->currentPath; }
php
protected function getNewView() { if ($this->currentSite) { return str_replace( ['.blade.php'], [''], $this->sitesFolder.'.'.$this->currentSite->slug.'.'.$this->currentPath ); } return $this->currentPath; }
[ "protected", "function", "getNewView", "(", ")", "{", "if", "(", "$", "this", "->", "currentSite", ")", "{", "return", "str_replace", "(", "[", "'.blade.php'", "]", ",", "[", "''", "]", ",", "$", "this", "->", "sitesFolder", ".", "'.'", ".", "$", "th...
Get the new view. @return string
[ "Get", "the", "new", "view", "." ]
a371aae503ae3508bec5c1b9fd196958277b6073
https://github.com/appstract/laravel-multisite/blob/a371aae503ae3508bec5c1b9fd196958277b6073/src/Composers/OverwriteViewComposer.php#L71-L82
34,892
mike182uk/cart
src/CartItem.php
CartItem.getId
public function getId() { // keys to ignore in the hashing process $ignoreKeys = ['quantity']; // data to use for the hashing process $hashData = $this->data; foreach ($ignoreKeys as $key) { unset($hashData[$key]); } $hash = sha1(serialize($hashD...
php
public function getId() { // keys to ignore in the hashing process $ignoreKeys = ['quantity']; // data to use for the hashing process $hashData = $this->data; foreach ($ignoreKeys as $key) { unset($hashData[$key]); } $hash = sha1(serialize($hashD...
[ "public", "function", "getId", "(", ")", "{", "// keys to ignore in the hashing process", "$", "ignoreKeys", "=", "[", "'quantity'", "]", ";", "// data to use for the hashing process", "$", "hashData", "=", "$", "this", "->", "data", ";", "foreach", "(", "$", "ign...
Get the cart item id. @return string
[ "Get", "the", "cart", "item", "id", "." ]
88dadd4b419826336b9a60296264c085d969f77a
https://github.com/mike182uk/cart/blob/88dadd4b419826336b9a60296264c085d969f77a/src/CartItem.php#L45-L59
34,893
mike182uk/cart
src/CartItem.php
CartItem.set
public function set($key, $value) { switch ($key) { case 'quantity': $this->setCheckTypeInteger($value, $key); break; case 'price': case 'tax': $this->setCheckIsNumeric($value, $key); $value = (float) $value; ...
php
public function set($key, $value) { switch ($key) { case 'quantity': $this->setCheckTypeInteger($value, $key); break; case 'price': case 'tax': $this->setCheckIsNumeric($value, $key); $value = (float) $value; ...
[ "public", "function", "set", "(", "$", "key", ",", "$", "value", ")", "{", "switch", "(", "$", "key", ")", "{", "case", "'quantity'", ":", "$", "this", "->", "setCheckTypeInteger", "(", "$", "value", ",", "$", "key", ")", ";", "break", ";", "case",...
Set a piece of data on the cart item. @param string $key @param mixed $value @return string
[ "Set", "a", "piece", "of", "data", "on", "the", "cart", "item", "." ]
88dadd4b419826336b9a60296264c085d969f77a
https://github.com/mike182uk/cart/blob/88dadd4b419826336b9a60296264c085d969f77a/src/CartItem.php#L86-L102
34,894
mike182uk/cart
src/Cart.php
Cart.remove
public function remove($itemId) { $items = &$this->items; foreach ($items as $position => $item) { if ($itemId === $item->id) { unset($items[$position]); } } }
php
public function remove($itemId) { $items = &$this->items; foreach ($items as $position => $item) { if ($itemId === $item->id) { unset($items[$position]); } } }
[ "public", "function", "remove", "(", "$", "itemId", ")", "{", "$", "items", "=", "&", "$", "this", "->", "items", ";", "foreach", "(", "$", "items", "as", "$", "position", "=>", "$", "item", ")", "{", "if", "(", "$", "itemId", "===", "$", "item",...
Remove an item from the cart. @param string $itemId
[ "Remove", "an", "item", "from", "the", "cart", "." ]
88dadd4b419826336b9a60296264c085d969f77a
https://github.com/mike182uk/cart/blob/88dadd4b419826336b9a60296264c085d969f77a/src/Cart.php#L96-L105
34,895
mike182uk/cart
src/Cart.php
Cart.update
public function update($itemId, $key, $value) { $item = $this->find($itemId); if (!$item) { throw new \InvalidArgumentException(sprintf('Item [%s] does not exist in cart.', $itemId)); } $item->$key = $value; return $item->id; }
php
public function update($itemId, $key, $value) { $item = $this->find($itemId); if (!$item) { throw new \InvalidArgumentException(sprintf('Item [%s] does not exist in cart.', $itemId)); } $item->$key = $value; return $item->id; }
[ "public", "function", "update", "(", "$", "itemId", ",", "$", "key", ",", "$", "value", ")", "{", "$", "item", "=", "$", "this", "->", "find", "(", "$", "itemId", ")", ";", "if", "(", "!", "$", "item", ")", "{", "throw", "new", "\\", "InvalidAr...
Update an item in the cart. @param string $itemId @param string $key @param mixed $value @return string @throws \InvalidArgumentException
[ "Update", "an", "item", "in", "the", "cart", "." ]
88dadd4b419826336b9a60296264c085d969f77a
https://github.com/mike182uk/cart/blob/88dadd4b419826336b9a60296264c085d969f77a/src/Cart.php#L118-L129
34,896
mike182uk/cart
src/Cart.php
Cart.find
public function find($itemId) { foreach ($this->items as $item) { if ($itemId === $item->id) { return $item; } } return; }
php
public function find($itemId) { foreach ($this->items as $item) { if ($itemId === $item->id) { return $item; } } return; }
[ "public", "function", "find", "(", "$", "itemId", ")", "{", "foreach", "(", "$", "this", "->", "items", "as", "$", "item", ")", "{", "if", "(", "$", "itemId", "===", "$", "item", "->", "id", ")", "{", "return", "$", "item", ";", "}", "}", "retu...
Find an item in the cart. @param string $itemId @return CartItem|null
[ "Find", "an", "item", "in", "the", "cart", "." ]
88dadd4b419826336b9a60296264c085d969f77a
https://github.com/mike182uk/cart/blob/88dadd4b419826336b9a60296264c085d969f77a/src/Cart.php#L162-L171
34,897
mike182uk/cart
src/Cart.php
Cart.total
public function total() { return (float) array_sum( array_map(function (CartItem $item) { return $item->getTotalPrice(); }, $this->items) ); }
php
public function total() { return (float) array_sum( array_map(function (CartItem $item) { return $item->getTotalPrice(); }, $this->items) ); }
[ "public", "function", "total", "(", ")", "{", "return", "(", "float", ")", "array_sum", "(", "array_map", "(", "function", "(", "CartItem", "$", "item", ")", "{", "return", "$", "item", "->", "getTotalPrice", "(", ")", ";", "}", ",", "$", "this", "->...
Get the cart total including tax. @return float
[ "Get", "the", "cart", "total", "including", "tax", "." ]
88dadd4b419826336b9a60296264c085d969f77a
https://github.com/mike182uk/cart/blob/88dadd4b419826336b9a60296264c085d969f77a/src/Cart.php#L202-L209
34,898
mike182uk/cart
src/Cart.php
Cart.totalExcludingTax
public function totalExcludingTax() { return (float) array_sum( array_map(function (CartItem $item) { return $item->getTotalPriceExcludingTax(); }, $this->items) ); }
php
public function totalExcludingTax() { return (float) array_sum( array_map(function (CartItem $item) { return $item->getTotalPriceExcludingTax(); }, $this->items) ); }
[ "public", "function", "totalExcludingTax", "(", ")", "{", "return", "(", "float", ")", "array_sum", "(", "array_map", "(", "function", "(", "CartItem", "$", "item", ")", "{", "return", "$", "item", "->", "getTotalPriceExcludingTax", "(", ")", ";", "}", ","...
Get the cart total excluding tax. @return float
[ "Get", "the", "cart", "total", "excluding", "tax", "." ]
88dadd4b419826336b9a60296264c085d969f77a
https://github.com/mike182uk/cart/blob/88dadd4b419826336b9a60296264c085d969f77a/src/Cart.php#L216-L223
34,899
mike182uk/cart
src/Cart.php
Cart.tax
public function tax() { return (float) array_sum( array_map(function (CartItem $item) { return $item->getTotalTax(); }, $this->items) ); }
php
public function tax() { return (float) array_sum( array_map(function (CartItem $item) { return $item->getTotalTax(); }, $this->items) ); }
[ "public", "function", "tax", "(", ")", "{", "return", "(", "float", ")", "array_sum", "(", "array_map", "(", "function", "(", "CartItem", "$", "item", ")", "{", "return", "$", "item", "->", "getTotalTax", "(", ")", ";", "}", ",", "$", "this", "->", ...
Get the cart tax. @return float
[ "Get", "the", "cart", "tax", "." ]
88dadd4b419826336b9a60296264c085d969f77a
https://github.com/mike182uk/cart/blob/88dadd4b419826336b9a60296264c085d969f77a/src/Cart.php#L230-L237