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
225,900
puli/cli
src/Handler/UrlCommandHandler.php
UrlCommandHandler.handle
public function handle(Args $args, IO $io) { foreach ($args->getArgument('path') as $path) { if (!Glob::isDynamic($path)) { $this->printUrl($path, $io); continue; } foreach ($this->repo->find($path) as $resource) { $this->...
php
public function handle(Args $args, IO $io) { foreach ($args->getArgument('path') as $path) { if (!Glob::isDynamic($path)) { $this->printUrl($path, $io); continue; } foreach ($this->repo->find($path) as $resource) { $this->...
[ "public", "function", "handle", "(", "Args", "$", "args", ",", "IO", "$", "io", ")", "{", "foreach", "(", "$", "args", "->", "getArgument", "(", "'path'", ")", "as", "$", "path", ")", "{", "if", "(", "!", "Glob", "::", "isDynamic", "(", "$", "pat...
Handles the "url" command. @param Args $args The console arguments. @param IO $io The I/O. @return int The status code.
[ "Handles", "the", "url", "command", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/UrlCommandHandler.php#L65-L80
225,901
puli/cli
src/Handler/UrlCommandHandler.php
UrlCommandHandler.printUrl
private function printUrl($path, IO $io) { $path = Path::makeAbsolute($path, $this->currentPath); $io->writeLine($this->urlGenerator->generateUrl($path)); }
php
private function printUrl($path, IO $io) { $path = Path::makeAbsolute($path, $this->currentPath); $io->writeLine($this->urlGenerator->generateUrl($path)); }
[ "private", "function", "printUrl", "(", "$", "path", ",", "IO", "$", "io", ")", "{", "$", "path", "=", "Path", "::", "makeAbsolute", "(", "$", "path", ",", "$", "this", "->", "currentPath", ")", ";", "$", "io", "->", "writeLine", "(", "$", "this", ...
Prints the URL of a Puli path. @param string $path A Puli path. @param IO $io The I/O.
[ "Prints", "the", "URL", "of", "a", "Puli", "path", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/UrlCommandHandler.php#L88-L92
225,902
ccottet/ldap
Core/DiffTracker.php
DiffTracker.logAddition
public function logAddition($value) { if ($this->isOverridden()) { return; } if (isset($this->deleted[$value])) { unset($this->deleted[$value]); $this->replaced[$value] = $value; return; } if (! isset($this->replaced[$value])) {...
php
public function logAddition($value) { if ($this->isOverridden()) { return; } if (isset($this->deleted[$value])) { unset($this->deleted[$value]); $this->replaced[$value] = $value; return; } if (! isset($this->replaced[$value])) {...
[ "public", "function", "logAddition", "(", "$", "value", ")", "{", "if", "(", "$", "this", "->", "isOverridden", "(", ")", ")", "{", "return", ";", "}", "if", "(", "isset", "(", "$", "this", "->", "deleted", "[", "$", "value", "]", ")", ")", "{", ...
Logs an addition in the diff tracker @param string $value Added value @return void
[ "Logs", "an", "addition", "in", "the", "diff", "tracker" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/DiffTracker.php#L52-L65
225,903
ccottet/ldap
Core/DiffTracker.php
DiffTracker.logDeletion
public function logDeletion($value) { if ($this->isOverridden()) { return; } if (isset($this->added[$value])) { unset($this->added[$value]); $this->ignored[$value] = $value; return; } if (isset($this->replaced[$value])) { ...
php
public function logDeletion($value) { if ($this->isOverridden()) { return; } if (isset($this->added[$value])) { unset($this->added[$value]); $this->ignored[$value] = $value; return; } if (isset($this->replaced[$value])) { ...
[ "public", "function", "logDeletion", "(", "$", "value", ")", "{", "if", "(", "$", "this", "->", "isOverridden", "(", ")", ")", "{", "return", ";", "}", "if", "(", "isset", "(", "$", "this", "->", "added", "[", "$", "value", "]", ")", ")", "{", ...
Logs a deletion in the diff tracker @param string $value Added value @return void
[ "Logs", "a", "deletion", "in", "the", "diff", "tracker" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/DiffTracker.php#L74-L90
225,904
ccottet/ldap
Core/DiffTracker.php
DiffTracker.logReplacement
public function logReplacement($value) { if ($this->isOverridden()) { return; } if (isset($this->added[$value])) { unset($this->added[$value]); } if (isset($this->deleted[$value])) { unset($this->deleted[$value]); } $this->r...
php
public function logReplacement($value) { if ($this->isOverridden()) { return; } if (isset($this->added[$value])) { unset($this->added[$value]); } if (isset($this->deleted[$value])) { unset($this->deleted[$value]); } $this->r...
[ "public", "function", "logReplacement", "(", "$", "value", ")", "{", "if", "(", "$", "this", "->", "isOverridden", "(", ")", ")", "{", "return", ";", "}", "if", "(", "isset", "(", "$", "this", "->", "added", "[", "$", "value", "]", ")", ")", "{",...
Logs a replacement in the diff tracker @param string $value Replaced value @return void
[ "Logs", "a", "replacement", "in", "the", "diff", "tracker" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/DiffTracker.php#L99-L111
225,905
ccottet/ldap
Core/SearchResult.php
SearchResult.setSearch
public function setSearch(SearchInterface $search) { if (null !== $this->search) { $this->search->free(); } $this->search = $search; $this->rewind(); }
php
public function setSearch(SearchInterface $search) { if (null !== $this->search) { $this->search->free(); } $this->search = $search; $this->rewind(); }
[ "public", "function", "setSearch", "(", "SearchInterface", "$", "search", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "search", ")", "{", "$", "this", "->", "search", "->", "free", "(", ")", ";", "}", "$", "this", "->", "search", "=", "$...
Setter for search @param SearchInterface $search Backend search result set @return void
[ "Setter", "for", "search" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/SearchResult.php#L36-L43
225,906
ccottet/ldap
Platform/Native/Connection.php
Connection.getOption
public function getOption($option) { $value = null; if (! (@ldap_get_option($this->connection, $option, $value))) { $code = @ldap_errno($this->connection); throw new OptionException( sprintf( 'Could not retrieve option %s value: Ldap Error ...
php
public function getOption($option) { $value = null; if (! (@ldap_get_option($this->connection, $option, $value))) { $code = @ldap_errno($this->connection); throw new OptionException( sprintf( 'Could not retrieve option %s value: Ldap Error ...
[ "public", "function", "getOption", "(", "$", "option", ")", "{", "$", "value", "=", "null", ";", "if", "(", "!", "(", "@", "ldap_get_option", "(", "$", "this", "->", "connection", ",", "$", "option", ",", "$", "value", ")", ")", ")", "{", "$", "c...
Gets current value set for an option @param int $option Ldap option name @return mixed value set for the option @throws OptionException if option cannot be retrieved
[ "Gets", "current", "value", "set", "for", "an", "option" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Platform/Native/Connection.php#L80-L94
225,907
ccottet/ldap
Platform/Native/Connection.php
Connection.bind
public function bind($rdn = null, $password = null) { $isAnonymous = false; if ((null === $rdn) || (null === $password)) { if ((null !== $rdn) || (null !== $password)) { throw new BindException( 'For an anonymous binding, both rdn & passwords have to b...
php
public function bind($rdn = null, $password = null) { $isAnonymous = false; if ((null === $rdn) || (null === $password)) { if ((null !== $rdn) || (null !== $password)) { throw new BindException( 'For an anonymous binding, both rdn & passwords have to b...
[ "public", "function", "bind", "(", "$", "rdn", "=", "null", ",", "$", "password", "=", "null", ")", "{", "$", "isAnonymous", "=", "false", ";", "if", "(", "(", "null", "===", "$", "rdn", ")", "||", "(", "null", "===", "$", "password", ")", ")", ...
Binds to the LDAP directory with specified RDN and password @param string $rdn Rdn to use for binding (Default: null) @param string $password Plain or hashed password for binding (Default: null) @return void @throws BindException if binding fails
[ "Binds", "to", "the", "LDAP", "directory", "with", "specified", "RDN", "and", "password" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Platform/Native/Connection.php#L106-L129
225,908
ccottet/ldap
Platform/Native/Connection.php
Connection.addEntry
public function addEntry($dn, $data) { $data = $this->normalizeData($data); if (! (@ldap_add($this->connection, $dn, $data))) { $code = @ldap_errno($this->connection); throw new PersistenceException( sprintf( 'Could not add entry %s: Ldap ...
php
public function addEntry($dn, $data) { $data = $this->normalizeData($data); if (! (@ldap_add($this->connection, $dn, $data))) { $code = @ldap_errno($this->connection); throw new PersistenceException( sprintf( 'Could not add entry %s: Ldap ...
[ "public", "function", "addEntry", "(", "$", "dn", ",", "$", "data", ")", "{", "$", "data", "=", "$", "this", "->", "normalizeData", "(", "$", "data", ")", ";", "if", "(", "!", "(", "@", "ldap_add", "(", "$", "this", "->", "connection", ",", "$", ...
Adds a Ldap entry @param string $dn Distinguished name to register entry for @param array $data Ldap attributes to save along with the entry @return void @throws PersistenceException if entry could not be added
[ "Adds", "a", "Ldap", "entry" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Platform/Native/Connection.php#L164-L179
225,909
ccottet/ldap
Platform/Native/Connection.php
Connection.deleteEntry
public function deleteEntry($dn) { if (! (@ldap_delete($this->connection, $dn))) { $code = @ldap_errno($this->connection); throw new PersistenceException( sprintf( 'Could not delete entry %s: Ldap Error Code=%s - %s', $dn, ...
php
public function deleteEntry($dn) { if (! (@ldap_delete($this->connection, $dn))) { $code = @ldap_errno($this->connection); throw new PersistenceException( sprintf( 'Could not delete entry %s: Ldap Error Code=%s - %s', $dn, ...
[ "public", "function", "deleteEntry", "(", "$", "dn", ")", "{", "if", "(", "!", "(", "@", "ldap_delete", "(", "$", "this", "->", "connection", ",", "$", "dn", ")", ")", ")", "{", "$", "code", "=", "@", "ldap_errno", "(", "$", "this", "->", "connec...
Deletes an existing Ldap entry @param string $dn Distinguished name of the entry to delete @return void @throws PersistenceException if entry could not be deleted
[ "Deletes", "an", "existing", "Ldap", "entry" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Platform/Native/Connection.php#L190-L203
225,910
ccottet/ldap
Platform/Native/Connection.php
Connection.search
public function search($scope, $baseDn, $filter, $attributes = null) { switch ($scope) { case SearchInterface::SCOPE_BASE: $function = 'ldap_read'; break; case SearchInterface::SCOPE_ONE: $function = 'ldap_list'; break; ...
php
public function search($scope, $baseDn, $filter, $attributes = null) { switch ($scope) { case SearchInterface::SCOPE_BASE: $function = 'ldap_read'; break; case SearchInterface::SCOPE_ONE: $function = 'ldap_list'; break; ...
[ "public", "function", "search", "(", "$", "scope", ",", "$", "baseDn", ",", "$", "filter", ",", "$", "attributes", "=", "null", ")", "{", "switch", "(", "$", "scope", ")", "{", "case", "SearchInterface", "::", "SCOPE_BASE", ":", "$", "function", "=", ...
Searches for entries in the directory @param int $scope Search scope (ALL, ONE or BASE) @param string $baseDn Base distinguished name to look below @param string $filter Filter for the search @param array $attributes Names of attributes to retrieve (Default: All) @return SearchInterface Search re...
[ "Searches", "for", "entries", "in", "the", "directory" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Platform/Native/Connection.php#L340-L392
225,911
ccottet/ldap
Platform/Native/Connection.php
Connection.normalizeData
protected function normalizeData($data) { foreach ($data as $attribute => $info) { if (is_array($info)) { if (count($info) == 1) { $data[$attribute] = $info[0]; continue; } } } return $data; }
php
protected function normalizeData($data) { foreach ($data as $attribute => $info) { if (is_array($info)) { if (count($info) == 1) { $data[$attribute] = $info[0]; continue; } } } return $data; }
[ "protected", "function", "normalizeData", "(", "$", "data", ")", "{", "foreach", "(", "$", "data", "as", "$", "attribute", "=>", "$", "info", ")", "{", "if", "(", "is_array", "(", "$", "info", ")", ")", "{", "if", "(", "count", "(", "$", "info", ...
Normalizes data for Ldap storage @param array $data Ldap data to store @return array Normalized data
[ "Normalizes", "data", "for", "Ldap", "storage" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Platform/Native/Connection.php#L401-L412
225,912
ccottet/ldap
Core/Manager.php
Manager.connect
public function connect() { $this->isBound = false; $this->connection = $this->driver->connect( $this->configuration['hostname'], $this->configuration['port'], $this->configuration['withSSL'], $this->configuration['withTLS'] ); foreach...
php
public function connect() { $this->isBound = false; $this->connection = $this->driver->connect( $this->configuration['hostname'], $this->configuration['port'], $this->configuration['withSSL'], $this->configuration['withTLS'] ); foreach...
[ "public", "function", "connect", "(", ")", "{", "$", "this", "->", "isBound", "=", "false", ";", "$", "this", "->", "connection", "=", "$", "this", "->", "driver", "->", "connect", "(", "$", "this", "->", "configuration", "[", "'hostname'", "]", ",", ...
Connects to the Ldap store @return void @throws Toyota\Component\Ldap\Exception\ConnectionException if connection fails @throws Toyota\Component\Ldap\Exception\OptionException if connection configuration fails
[ "Connects", "to", "the", "Ldap", "store" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Manager.php#L74-L87
225,913
ccottet/ldap
Core/Manager.php
Manager.bind
public function bind($name = null, $password = null) { if (strlen(trim($name)) > 0) { $password = (null === $password)?'':$password; $this->connection->bind($name, $password); $this->isBound = true; return; } if ($this->configuration['bind_ano...
php
public function bind($name = null, $password = null) { if (strlen(trim($name)) > 0) { $password = (null === $password)?'':$password; $this->connection->bind($name, $password); $this->isBound = true; return; } if ($this->configuration['bind_ano...
[ "public", "function", "bind", "(", "$", "name", "=", "null", ",", "$", "password", "=", "null", ")", "{", "if", "(", "strlen", "(", "trim", "(", "$", "name", ")", ")", ">", "0", ")", "{", "$", "password", "=", "(", "null", "===", "$", "password...
Binds to the Ldap connection @param string $name Bind rdn (Default: null) @param string $password Bind password (Default: null) @return void @throws Toyota\Component\Ldap\Exception\BindException if binding fails
[ "Binds", "to", "the", "Ldap", "connection" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Manager.php#L99-L119
225,914
ccottet/ldap
Core/Manager.php
Manager.configure
protected function configure(array $params) { $required = array('hostname', 'base_dn'); $missing = array(); foreach ($required as $key) { if (! array_key_exists($key, $params)) { $missing[] = $key; } } if (count($missing) > 0) { ...
php
protected function configure(array $params) { $required = array('hostname', 'base_dn'); $missing = array(); foreach ($required as $key) { if (! array_key_exists($key, $params)) { $missing[] = $key; } } if (count($missing) > 0) { ...
[ "protected", "function", "configure", "(", "array", "$", "params", ")", "{", "$", "required", "=", "array", "(", "'hostname'", ",", "'base_dn'", ")", ";", "$", "missing", "=", "array", "(", ")", ";", "foreach", "(", "$", "required", "as", "$", "key", ...
Complete and validates given parameters with default settings @param array $params Parameters to be cleaned @return array Cleaned parameters @throws \InvalidArgumentException
[ "Complete", "and", "validates", "given", "parameters", "with", "default", "settings" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Manager.php#L130-L200
225,915
ccottet/ldap
Core/Manager.php
Manager.getNode
public function getNode($dn, $attributes = null, $filter = null) { $this->validateBinding(); $attributes = (is_array($attributes))?$attributes:null; $filter = (null === $filter)?'(objectclass=*)':$filter; try { $search = $this->connection->search( Search...
php
public function getNode($dn, $attributes = null, $filter = null) { $this->validateBinding(); $attributes = (is_array($attributes))?$attributes:null; $filter = (null === $filter)?'(objectclass=*)':$filter; try { $search = $this->connection->search( Search...
[ "public", "function", "getNode", "(", "$", "dn", ",", "$", "attributes", "=", "null", ",", "$", "filter", "=", "null", ")", "{", "$", "this", "->", "validateBinding", "(", ")", ";", "$", "attributes", "=", "(", "is_array", "(", "$", "attributes", ")"...
Retrieve a node knowing its dn @param string $dn Distinguished name of the node to look for @param array $attributes Filter attributes to be retrieved (Optional) @param string $filter Ldap filter according to RFC4515 (Optional) @return Node @throws NodeNotFoundException if node cannot be retrieved
[ "Retrieve", "a", "node", "knowing", "its", "dn" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Manager.php#L213-L239
225,916
ccottet/ldap
Core/Manager.php
Manager.search
public function search( $baseDn = null, $filter = null, $inDepth = true, $attributes = null ) { $this->validateBinding(); $result = new SearchResult(); $baseDn = (null === $baseDn)?$this->configuration['base_dn']:$baseDn; $filter = (null === $filter)...
php
public function search( $baseDn = null, $filter = null, $inDepth = true, $attributes = null ) { $this->validateBinding(); $result = new SearchResult(); $baseDn = (null === $baseDn)?$this->configuration['base_dn']:$baseDn; $filter = (null === $filter)...
[ "public", "function", "search", "(", "$", "baseDn", "=", "null", ",", "$", "filter", "=", "null", ",", "$", "inDepth", "=", "true", ",", "$", "attributes", "=", "null", ")", "{", "$", "this", "->", "validateBinding", "(", ")", ";", "$", "result", "...
Execites a search on the ldap @param string $baseDn Base distinguished name to search in (Default = configured dn) @param string $filter Ldap filter according to RFC4515 (Default = null) @param boolean $inDepth Whether to search through all subtree depth (Default = true) @param array $attributes Filter ...
[ "Execites", "a", "search", "on", "the", "ldap" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Manager.php#L251-L274
225,917
ccottet/ldap
Core/Manager.php
Manager.save
public function save(Node $node) { $this->validateBinding(); if (strlen(trim($node->getDn())) == 0) { throw new PersistenceException('Cannot save: dn missing for the entry'); } if (! $node->isHydrated()) { try { $origin = $this->getNode($node-...
php
public function save(Node $node) { $this->validateBinding(); if (strlen(trim($node->getDn())) == 0) { throw new PersistenceException('Cannot save: dn missing for the entry'); } if (! $node->isHydrated()) { try { $origin = $this->getNode($node-...
[ "public", "function", "save", "(", "Node", "$", "node", ")", "{", "$", "this", "->", "validateBinding", "(", ")", ";", "if", "(", "strlen", "(", "trim", "(", "$", "node", "->", "getDn", "(", ")", ")", ")", "==", "0", ")", "{", "throw", "new", "...
Saves a node to the Ldap store @param Node $node Node to be saved @return boolean True if node got created, false if it was updated @throws PersistenceException If saving operation fails writing to the Ldap
[ "Saves", "a", "node", "to", "the", "Ldap", "store" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Manager.php#L299-L329
225,918
ccottet/ldap
Core/Manager.php
Manager.getChildrenNodes
public function getChildrenNodes(Node $node) { $result = $this->search($node->getDn(), null, false); $nodes = array(); foreach ($result as $node) { $nodes[] = $node; } return $nodes; }
php
public function getChildrenNodes(Node $node) { $result = $this->search($node->getDn(), null, false); $nodes = array(); foreach ($result as $node) { $nodes[] = $node; } return $nodes; }
[ "public", "function", "getChildrenNodes", "(", "Node", "$", "node", ")", "{", "$", "result", "=", "$", "this", "->", "search", "(", "$", "node", "->", "getDn", "(", ")", ",", "null", ",", "false", ")", ";", "$", "nodes", "=", "array", "(", ")", "...
Retrieves immediate children for the given node @param Node $node Node to retrieve children for @return array(Node) a set of Nodes
[ "Retrieves", "immediate", "children", "for", "the", "given", "node" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Manager.php#L338-L348
225,919
ccottet/ldap
Core/Manager.php
Manager.delete
public function delete(Node $node, $isRecursive = false) { if (! $node->isHydrated()) { $node = $this->getNode($node->getDn()); } $children = $this->getChildrenNodes($node); if (count($children) > 0) { if (! $isRecursive) { throw new DeleteExce...
php
public function delete(Node $node, $isRecursive = false) { if (! $node->isHydrated()) { $node = $this->getNode($node->getDn()); } $children = $this->getChildrenNodes($node); if (count($children) > 0) { if (! $isRecursive) { throw new DeleteExce...
[ "public", "function", "delete", "(", "Node", "$", "node", ",", "$", "isRecursive", "=", "false", ")", "{", "if", "(", "!", "$", "node", "->", "isHydrated", "(", ")", ")", "{", "$", "node", "=", "$", "this", "->", "getNode", "(", "$", "node", "->"...
Deletes a node from the Ldap store @param Node $node Node to delete @param boolean $isRecursive Whether to delete node with its children (Default: false) @return void @throws DeletionException If node to delete has some children and recursion disabled
[ "Deletes", "a", "node", "from", "the", "Ldap", "store" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Manager.php#L360-L378
225,920
sokil/php-upload
src/Handler.php
Handler.getTransport
private function getTransport() { if ($this->transport) { return $this->transport; } $transportClassName = '\\Sokil\\Upload\\Transport\\' . $this->options['transport'] . 'Transport'; $this->transport = new $transportClassName( $this->options['fieldName'], ...
php
private function getTransport() { if ($this->transport) { return $this->transport; } $transportClassName = '\\Sokil\\Upload\\Transport\\' . $this->options['transport'] . 'Transport'; $this->transport = new $transportClassName( $this->options['fieldName'], ...
[ "private", "function", "getTransport", "(", ")", "{", "if", "(", "$", "this", "->", "transport", ")", "{", "return", "$", "this", "->", "transport", ";", "}", "$", "transportClassName", "=", "'\\\\Sokil\\\\Upload\\\\Transport\\\\'", ".", "$", "this", "->", "...
Get uploaded file instance @return \Sokil\Upload\Transport\AbstractTransport @throws \Exception
[ "Get", "uploaded", "file", "instance" ]
3e0d7d91866781e9a19ab4d2ec3c443f0ca1666a
https://github.com/sokil/php-upload/blob/3e0d7d91866781e9a19ab4d2ec3c443f0ca1666a/src/Handler.php#L86-L101
225,921
sokil/php-upload
src/Handler.php
Handler.moveLocal
public function moveLocal($targetDir = null, $targetFilename = null) { // source file $sourceFile = $this->getTransport()->getFile(); // target base name $targetBasename = $this->buildTargetBasename($sourceFile, $targetFilename); // target path if (!$targetDir) { ...
php
public function moveLocal($targetDir = null, $targetFilename = null) { // source file $sourceFile = $this->getTransport()->getFile(); // target base name $targetBasename = $this->buildTargetBasename($sourceFile, $targetFilename); // target path if (!$targetDir) { ...
[ "public", "function", "moveLocal", "(", "$", "targetDir", "=", "null", ",", "$", "targetFilename", "=", "null", ")", "{", "// source file", "$", "sourceFile", "=", "$", "this", "->", "getTransport", "(", ")", "->", "getFile", "(", ")", ";", "// target base...
Move file to local filesystem @param string $targetDir File system to store file. If omitted - store in php's upload_tmp_dir @param string $targetFilename New file name. If omitted - use original filename @return \Sokil\Upload\File uploaded file
[ "Move", "file", "to", "local", "filesystem" ]
3e0d7d91866781e9a19ab4d2ec3c443f0ca1666a
https://github.com/sokil/php-upload/blob/3e0d7d91866781e9a19ab4d2ec3c443f0ca1666a/src/Handler.php#L150-L175
225,922
sokil/php-upload
src/Handler.php
Handler.move
public function move(Filesystem $filesystem = null, $targetFilename = null, $overwrite = true) { // source file $sourceFile = $this->getTransport()->getFile(); // target base name $targetBasename = $this->buildTargetBasename($sourceFile, $targetFilename); // move fi...
php
public function move(Filesystem $filesystem = null, $targetFilename = null, $overwrite = true) { // source file $sourceFile = $this->getTransport()->getFile(); // target base name $targetBasename = $this->buildTargetBasename($sourceFile, $targetFilename); // move fi...
[ "public", "function", "move", "(", "Filesystem", "$", "filesystem", "=", "null", ",", "$", "targetFilename", "=", "null", ",", "$", "overwrite", "=", "true", ")", "{", "// source file", "$", "sourceFile", "=", "$", "this", "->", "getTransport", "(", ")", ...
Move file to external filesystem @param Filesystem $filesystem File system to store file. If omitted - store in php's upload_tmp_dir @param string $targetFilename New file name. If omitted - use original filename @return \Gaufrette\File
[ "Move", "file", "to", "external", "filesystem" ]
3e0d7d91866781e9a19ab4d2ec3c443f0ca1666a
https://github.com/sokil/php-upload/blob/3e0d7d91866781e9a19ab4d2ec3c443f0ca1666a/src/Handler.php#L184-L203
225,923
puli/cli
src/Handler/MapCommandHandler.php
MapCommandHandler.handleAdd
public function handleAdd(Args $args) { $flags = $args->isOptionSet('force') ? RepositoryManager::OVERRIDE | RepositoryManager::IGNORE_FILE_NOT_FOUND : 0; $repositoryPath = Path::makeAbsolute($args->getArgument('path'), $this->currentPath); $pathReferences = $args->ge...
php
public function handleAdd(Args $args) { $flags = $args->isOptionSet('force') ? RepositoryManager::OVERRIDE | RepositoryManager::IGNORE_FILE_NOT_FOUND : 0; $repositoryPath = Path::makeAbsolute($args->getArgument('path'), $this->currentPath); $pathReferences = $args->ge...
[ "public", "function", "handleAdd", "(", "Args", "$", "args", ")", "{", "$", "flags", "=", "$", "args", "->", "isOptionSet", "(", "'force'", ")", "?", "RepositoryManager", "::", "OVERRIDE", "|", "RepositoryManager", "::", "IGNORE_FILE_NOT_FOUND", ":", "0", ";...
Handles the "puli map" command. @param Args $args The console arguments @return int The status code
[ "Handles", "the", "puli", "map", "command", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/MapCommandHandler.php#L157-L168
225,924
puli/cli
src/Handler/MapCommandHandler.php
MapCommandHandler.printMappingTable
private function printMappingTable(IO $io, array $mappings, $indentation = 0, $enabled = true) { $table = new Table(PuliTableStyle::borderless()); $table->setHeaderRow(array('Puli Path', 'Real Path(s)')); $pathTag = $enabled ? 'c1' : 'bad'; foreach ($mappings as $mapping) { ...
php
private function printMappingTable(IO $io, array $mappings, $indentation = 0, $enabled = true) { $table = new Table(PuliTableStyle::borderless()); $table->setHeaderRow(array('Puli Path', 'Real Path(s)')); $pathTag = $enabled ? 'c1' : 'bad'; foreach ($mappings as $mapping) { ...
[ "private", "function", "printMappingTable", "(", "IO", "$", "io", ",", "array", "$", "mappings", ",", "$", "indentation", "=", "0", ",", "$", "enabled", "=", "true", ")", "{", "$", "table", "=", "new", "Table", "(", "PuliTableStyle", "::", "borderless", ...
Prints a list of path mappings. @param IO $io The I/O @param PathMapping[] $mappings The path mappings @param int $indentation The number of spaces to indent the output @param bool $enabled Whether the path mappings are enabled. If not, the output is printed in red
[ "Prints", "a", "list", "of", "path", "mappings", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/MapCommandHandler.php#L245-L279
225,925
puli/cli
src/Handler/MapCommandHandler.php
MapCommandHandler.printConflictTable
private function printConflictTable(IO $io, array $mappings, $indentation = 0) { /** @var PathConflict[] $conflicts */ $conflicts = array(); $shortPrefix = str_repeat(' ', $indentation); $prefix = str_repeat(' ', $indentation + 4); $printNewline = false; foreach ($ma...
php
private function printConflictTable(IO $io, array $mappings, $indentation = 0) { /** @var PathConflict[] $conflicts */ $conflicts = array(); $shortPrefix = str_repeat(' ', $indentation); $prefix = str_repeat(' ', $indentation + 4); $printNewline = false; foreach ($ma...
[ "private", "function", "printConflictTable", "(", "IO", "$", "io", ",", "array", "$", "mappings", ",", "$", "indentation", "=", "0", ")", "{", "/** @var PathConflict[] $conflicts */", "$", "conflicts", "=", "array", "(", ")", ";", "$", "shortPrefix", "=", "s...
Prints a list of conflicting path mappings. @param IO $io The I/O @param PathMapping[] $mappings The path mappings @param int $indentation The number of spaces to indent the output
[ "Prints", "a", "list", "of", "conflicting", "path", "mappings", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/MapCommandHandler.php#L289-L330
225,926
puli/cli
src/Handler/MapCommandHandler.php
MapCommandHandler.getPathMappingStates
private function getPathMappingStates(Args $args) { $states = array( PathMappingState::ENABLED => 'enabled', PathMappingState::NOT_FOUND => 'not-found', PathMappingState::CONFLICT => 'conflict', ); $states = array_filter($states, function ($option) use ($...
php
private function getPathMappingStates(Args $args) { $states = array( PathMappingState::ENABLED => 'enabled', PathMappingState::NOT_FOUND => 'not-found', PathMappingState::CONFLICT => 'conflict', ); $states = array_filter($states, function ($option) use ($...
[ "private", "function", "getPathMappingStates", "(", "Args", "$", "args", ")", "{", "$", "states", "=", "array", "(", "PathMappingState", "::", "ENABLED", "=>", "'enabled'", ",", "PathMappingState", "::", "NOT_FOUND", "=>", "'not-found'", ",", "PathMappingState", ...
Returns the path mapping states selected in the console arguments. @param Args $args The console arguments @return int[] The selected {@link PathMappingState} constants
[ "Returns", "the", "path", "mapping", "states", "selected", "in", "the", "console", "arguments", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/MapCommandHandler.php#L339-L352
225,927
puli/cli
src/Handler/MapCommandHandler.php
MapCommandHandler.printPathMappingStateHeader
private function printPathMappingStateHeader(IO $io, $pathMappingState) { switch ($pathMappingState) { case PathMappingState::ENABLED: $io->writeLine('The following path mappings are currently enabled:'); $io->writeLine(''); return; ca...
php
private function printPathMappingStateHeader(IO $io, $pathMappingState) { switch ($pathMappingState) { case PathMappingState::ENABLED: $io->writeLine('The following path mappings are currently enabled:'); $io->writeLine(''); return; ca...
[ "private", "function", "printPathMappingStateHeader", "(", "IO", "$", "io", ",", "$", "pathMappingState", ")", "{", "switch", "(", "$", "pathMappingState", ")", "{", "case", "PathMappingState", "::", "ENABLED", ":", "$", "io", "->", "writeLine", "(", "'The fol...
Prints the header for a path mapping state. @param IO $io The I/O @param int $pathMappingState The {@link PathMappingState} constant
[ "Prints", "the", "header", "for", "a", "path", "mapping", "state", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/MapCommandHandler.php#L360-L380
225,928
puli/cli
src/Handler/LsCommandHandler.php
LsCommandHandler.formatName
private function formatName(PuliResource $resource) { $name = $resource->getName(); if ($resource->hasChildren()) { return '<c1>'.$name.'</c1>'; } return $name; }
php
private function formatName(PuliResource $resource) { $name = $resource->getName(); if ($resource->hasChildren()) { return '<c1>'.$name.'</c1>'; } return $name; }
[ "private", "function", "formatName", "(", "PuliResource", "$", "resource", ")", "{", "$", "name", "=", "$", "resource", "->", "getName", "(", ")", ";", "if", "(", "$", "resource", "->", "hasChildren", "(", ")", ")", "{", "return", "'<c1>'", ".", "$", ...
Formats the name of the resource. Resources with children are colored. @param PuliResource $resource The resource. @return string|null The formatted name.
[ "Formats", "the", "name", "of", "the", "resource", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/LsCommandHandler.php#L162-L171
225,929
puli/cli
src/Handler/LsCommandHandler.php
LsCommandHandler.formatSize
private function formatSize($size) { $suffixes = array('', 'K', 'M', 'G', 'T', 'P'); reset($suffixes); $suffix = current($suffixes); while ($size > 1023) { next($suffixes); if (null === key($suffixes)) { break; } $si...
php
private function formatSize($size) { $suffixes = array('', 'K', 'M', 'G', 'T', 'P'); reset($suffixes); $suffix = current($suffixes); while ($size > 1023) { next($suffixes); if (null === key($suffixes)) { break; } $si...
[ "private", "function", "formatSize", "(", "$", "size", ")", "{", "$", "suffixes", "=", "array", "(", "''", ",", "'K'", ",", "'M'", ",", "'G'", ",", "'T'", ",", "'P'", ")", ";", "reset", "(", "$", "suffixes", ")", ";", "$", "suffix", "=", "current...
Formats the given size. @param int $size The size in bytes. @return string
[ "Formats", "the", "given", "size", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/LsCommandHandler.php#L180-L203
225,930
tyxla/carbon-breadcrumbs
admin/class-carbon-breadcrumb-admin-settings.php
Carbon_Breadcrumb_Admin_Settings.get_field_data
public static function get_field_data() { return array( 'glue' => array( 'type' => 'text', 'title' => __( 'Glue', 'carbon_breadcrumbs' ), 'default' => ' > ', 'help' => __( 'This is displayed between the breadcrumb items.', 'carbon_breadcrumbs' ), ), 'link_before' =>...
php
public static function get_field_data() { return array( 'glue' => array( 'type' => 'text', 'title' => __( 'Glue', 'carbon_breadcrumbs' ), 'default' => ' > ', 'help' => __( 'This is displayed between the breadcrumb items.', 'carbon_breadcrumbs' ), ), 'link_before' =>...
[ "public", "static", "function", "get_field_data", "(", ")", "{", "return", "array", "(", "'glue'", "=>", "array", "(", "'type'", "=>", "'text'", ",", "'title'", "=>", "__", "(", "'Glue'", ",", "'carbon_breadcrumbs'", ")", ",", "'default'", "=>", "' > '", "...
Get field data. Defines and describes the fields that will be registered. @access public @static @return array $fields The fields and their data.
[ "Get", "field", "data", ".", "Defines", "and", "describes", "the", "fields", "that", "will", "be", "registered", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/admin/class-carbon-breadcrumb-admin-settings.php#L44-L113
225,931
tyxla/carbon-breadcrumbs
admin/class-carbon-breadcrumb-admin-settings.php
Carbon_Breadcrumb_Admin_Settings.admin_menu
public function admin_menu() { // Register settings page. add_options_page( self::get_page_title(), self::get_page_title(), 'manage_options', self::get_page_name(), array( $this, 'settings_page' ) ); // Register settings section. add_settings_section( self::get_page_name(), __( 'General...
php
public function admin_menu() { // Register settings page. add_options_page( self::get_page_title(), self::get_page_title(), 'manage_options', self::get_page_name(), array( $this, 'settings_page' ) ); // Register settings section. add_settings_section( self::get_page_name(), __( 'General...
[ "public", "function", "admin_menu", "(", ")", "{", "// Register settings page.", "add_options_page", "(", "self", "::", "get_page_title", "(", ")", ",", "self", "::", "get_page_title", "(", ")", ",", "'manage_options'", ",", "self", "::", "get_page_name", "(", "...
Register the settings page & default section. @access public
[ "Register", "the", "settings", "page", "&", "default", "section", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/admin/class-carbon-breadcrumb-admin-settings.php#L144-L163
225,932
tyxla/carbon-breadcrumbs
admin/class-carbon-breadcrumb-admin-settings.php
Carbon_Breadcrumb_Admin_Settings.register_settings
public function register_settings() { // Register fields. $field_data = self::get_field_data(); foreach ( $field_data as $field_id => $field ) { $this->fields[] = Carbon_Breadcrumb_Admin_Settings_Field::factory( $field['type'], 'carbon_breadcrumbs_' . $field_id, $field['title'], self::get_page_name() ); } }
php
public function register_settings() { // Register fields. $field_data = self::get_field_data(); foreach ( $field_data as $field_id => $field ) { $this->fields[] = Carbon_Breadcrumb_Admin_Settings_Field::factory( $field['type'], 'carbon_breadcrumbs_' . $field_id, $field['title'], self::get_page_name() ); } }
[ "public", "function", "register_settings", "(", ")", "{", "// Register fields.", "$", "field_data", "=", "self", "::", "get_field_data", "(", ")", ";", "foreach", "(", "$", "field_data", "as", "$", "field_id", "=>", "$", "field", ")", "{", "$", "this", "->...
Register the settings sections and fields. @access public
[ "Register", "the", "settings", "sections", "and", "fields", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/admin/class-carbon-breadcrumb-admin-settings.php#L170-L176
225,933
tyxla/carbon-breadcrumbs
admin/class-carbon-breadcrumb-admin-settings.php
Carbon_Breadcrumb_Admin_Settings.settings_page
public function settings_page() { ?> <div class="wrap"> <h2><?php echo esc_html( self::get_page_title() ); ?></h2> </div> <form method="POST" action="options.php"> <?php settings_fields( self::get_page_name() ); do_settings_sections( self::get_page_name() ); submit_button(); ?> </form> <?...
php
public function settings_page() { ?> <div class="wrap"> <h2><?php echo esc_html( self::get_page_title() ); ?></h2> </div> <form method="POST" action="options.php"> <?php settings_fields( self::get_page_name() ); do_settings_sections( self::get_page_name() ); submit_button(); ?> </form> <?...
[ "public", "function", "settings_page", "(", ")", "{", "?>\n\t\t<div class=\"wrap\">\n\t\t\t<h2><?php", "echo", "esc_html", "(", "self", "::", "get_page_title", "(", ")", ")", ";", "?></h2>\n\t\t</div>\n\n\t\t<form method=\"POST\" action=\"options.php\">\n\t\t\t<?php", "settings_f...
Content of the settings page. @access public
[ "Content", "of", "the", "settings", "page", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/admin/class-carbon-breadcrumb-admin-settings.php#L183-L197
225,934
andersondanilo/modelform
src/FormSet.php
FormSet.getModelByPrimaryKey
public function getModelByPrimaryKey($id) { foreach($this->models as $model) { $primaryKey = $model->getKeyName(); if($model->$primaryKey == $id) return $model; } }
php
public function getModelByPrimaryKey($id) { foreach($this->models as $model) { $primaryKey = $model->getKeyName(); if($model->$primaryKey == $id) return $model; } }
[ "public", "function", "getModelByPrimaryKey", "(", "$", "id", ")", "{", "foreach", "(", "$", "this", "->", "models", "as", "$", "model", ")", "{", "$", "primaryKey", "=", "$", "model", "->", "getKeyName", "(", ")", ";", "if", "(", "$", "model", "->",...
Return a model of formset by id
[ "Return", "a", "model", "of", "formset", "by", "id" ]
4c735326e2837cd6590b6b4d69f62c072de19bd8
https://github.com/andersondanilo/modelform/blob/4c735326e2837cd6590b6b4d69f62c072de19bd8/src/FormSet.php#L185-L193
225,935
BKWLD/upchuck
src/Observer.php
Observer.onSaving
public function onSaving($event, $payload) { // Destructure params list($model) = $payload; // Check that the model supports uploads through Upchuck if (!$this->supportsUploads($model) || !($attributes = $model->getUploadAttributes())) return; // Loop through the a...
php
public function onSaving($event, $payload) { // Destructure params list($model) = $payload; // Check that the model supports uploads through Upchuck if (!$this->supportsUploads($model) || !($attributes = $model->getUploadAttributes())) return; // Loop through the a...
[ "public", "function", "onSaving", "(", "$", "event", ",", "$", "payload", ")", "{", "// Destructure params", "list", "(", "$", "model", ")", "=", "$", "payload", ";", "// Check that the model supports uploads through Upchuck", "if", "(", "!", "$", "this", "->", ...
A model is saving, check for files being uploaded @param string $event @param array $payload containg: - Illuminate\Database\Eloquent\Model @return void
[ "A", "model", "is", "saving", "check", "for", "files", "being", "uploaded" ]
2d2202b1bc4a86a0a91ceb319521a263b0c88f54
https://github.com/BKWLD/upchuck/blob/2d2202b1bc4a86a0a91ceb319521a263b0c88f54/src/Observer.php#L42-L72
225,936
BKWLD/upchuck
src/Observer.php
Observer.onDeleted
public function onDeleted($event, $payload) { // Destructure params list($model) = $payload; // If the model is soft deleted and the config states to NOT delete if // soft deleted, abort here. if ($this->keepsFilesOnDelete($model)) return; // Check that the model suppo...
php
public function onDeleted($event, $payload) { // Destructure params list($model) = $payload; // If the model is soft deleted and the config states to NOT delete if // soft deleted, abort here. if ($this->keepsFilesOnDelete($model)) return; // Check that the model suppo...
[ "public", "function", "onDeleted", "(", "$", "event", ",", "$", "payload", ")", "{", "// Destructure params", "list", "(", "$", "model", ")", "=", "$", "payload", ";", "// If the model is soft deleted and the config states to NOT delete if", "// soft deleted, abort here."...
A model has been deleted, trash all of it's files @param string $event @param array $payload containg: - Illuminate\Database\Eloquent\Model @return void
[ "A", "model", "has", "been", "deleted", "trash", "all", "of", "it", "s", "files" ]
2d2202b1bc4a86a0a91ceb319521a263b0c88f54
https://github.com/BKWLD/upchuck/blob/2d2202b1bc4a86a0a91ceb319521a263b0c88f54/src/Observer.php#L82-L103
225,937
heyday/silverstripe-responsive-images
code/ResponsiveImageExtension.php
ResponsiveImageExtension.createResponsiveSet
protected function createResponsiveSet($config, $defaultArgs, $set) { Requirements::javascript('heyday/silverstripe-responsive-images:javascript/picturefill/picturefill.min.js'); if (!isset($config['arguments']) || !is_array($config['arguments'])) { throw new Exception("Responsive set $...
php
protected function createResponsiveSet($config, $defaultArgs, $set) { Requirements::javascript('heyday/silverstripe-responsive-images:javascript/picturefill/picturefill.min.js'); if (!isset($config['arguments']) || !is_array($config['arguments'])) { throw new Exception("Responsive set $...
[ "protected", "function", "createResponsiveSet", "(", "$", "config", ",", "$", "defaultArgs", ",", "$", "set", ")", "{", "Requirements", "::", "javascript", "(", "'heyday/silverstripe-responsive-images:javascript/picturefill/picturefill.min.js'", ")", ";", "if", "(", "!"...
Requires the necessary JS and sends the required HTML structure to the template for a responsive image set. @param array $config The configuration of the responsive image set @param array $defaultArgs The arguments passed to the responsive image method call, e.g. $MyImage.ResponsiveSet(800x600) @param string $set The ...
[ "Requires", "the", "necessary", "JS", "and", "sends", "the", "required", "HTML", "structure", "to", "the", "template", "for", "a", "responsive", "image", "set", "." ]
c5d1b396b4e0f97c740d1ebeb3dfc8843ce4e911
https://github.com/heyday/silverstripe-responsive-images/blob/c5d1b396b4e0f97c740d1ebeb3dfc8843ce4e911/code/ResponsiveImageExtension.php#L89-L140
225,938
xmeltrut/WordSearch
src/Generator.php
Generator.generate
public function generate() { $this->initialise(); $this->populate(); $this->fill(); return new Puzzle($this->grid, $this->wordList); }
php
public function generate() { $this->initialise(); $this->populate(); $this->fill(); return new Puzzle($this->grid, $this->wordList); }
[ "public", "function", "generate", "(", ")", "{", "$", "this", "->", "initialise", "(", ")", ";", "$", "this", "->", "populate", "(", ")", ";", "$", "this", "->", "fill", "(", ")", ";", "return", "new", "Puzzle", "(", "$", "this", "->", "grid", ",...
Generate the puzzle. @return Puzzle
[ "Generate", "the", "puzzle", "." ]
a6dd7c96b78045a3d172e3c5b97e9909b32a9fba
https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/Generator.php#L82-L89
225,939
xmeltrut/WordSearch
src/Generator.php
Generator.initialise
private function initialise() { for ($i = 0; $i < $this->size; $i++) { for ($j = 0; $j < $this->size; $j++) { $this->grid[$i][$j] = null; } $this->rowsAvailable[] = $i; $this->columnsAvailable[] = $i; } }
php
private function initialise() { for ($i = 0; $i < $this->size; $i++) { for ($j = 0; $j < $this->size; $j++) { $this->grid[$i][$j] = null; } $this->rowsAvailable[] = $i; $this->columnsAvailable[] = $i; } }
[ "private", "function", "initialise", "(", ")", "{", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<", "$", "this", "->", "size", ";", "$", "i", "++", ")", "{", "for", "(", "$", "j", "=", "0", ";", "$", "j", "<", "$", "this", "->", "size...
Initialise the grid. @return void
[ "Initialise", "the", "grid", "." ]
a6dd7c96b78045a3d172e3c5b97e9909b32a9fba
https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/Generator.php#L96-L106
225,940
xmeltrut/WordSearch
src/Generator.php
Generator.populate
private function populate() { foreach ($this->words as $word) { $rowOrColumn = rand(1, 2); if ($rowOrColumn == 1) { shuffle($this->rowsAvailable); foreach ($this->rowsAvailable as $key => $row) { $maxStart = ($this->size - Utils::...
php
private function populate() { foreach ($this->words as $word) { $rowOrColumn = rand(1, 2); if ($rowOrColumn == 1) { shuffle($this->rowsAvailable); foreach ($this->rowsAvailable as $key => $row) { $maxStart = ($this->size - Utils::...
[ "private", "function", "populate", "(", ")", "{", "foreach", "(", "$", "this", "->", "words", "as", "$", "word", ")", "{", "$", "rowOrColumn", "=", "rand", "(", "1", ",", "2", ")", ";", "if", "(", "$", "rowOrColumn", "==", "1", ")", "{", "shuffle...
Populate the grid with the words. @return void
[ "Populate", "the", "grid", "with", "the", "words", "." ]
a6dd7c96b78045a3d172e3c5b97e9909b32a9fba
https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/Generator.php#L113-L148
225,941
xmeltrut/WordSearch
src/Generator.php
Generator.insertWordIntoRow
private function insertWordIntoRow($word, $row, $col) { $this->wordList->add($word, ($row + 1), (1 + $col)); $wordArray = Utils::stringToArray($word); foreach ($wordArray as $letter) { $this->grid[$row][$col] = $letter; $col++; } }
php
private function insertWordIntoRow($word, $row, $col) { $this->wordList->add($word, ($row + 1), (1 + $col)); $wordArray = Utils::stringToArray($word); foreach ($wordArray as $letter) { $this->grid[$row][$col] = $letter; $col++; } }
[ "private", "function", "insertWordIntoRow", "(", "$", "word", ",", "$", "row", ",", "$", "col", ")", "{", "$", "this", "->", "wordList", "->", "add", "(", "$", "word", ",", "(", "$", "row", "+", "1", ")", ",", "(", "1", "+", "$", "col", ")", ...
Insert a word into a row. @param string $word Word. @param integer $row Row index. @param integer $col Column index.
[ "Insert", "a", "word", "into", "a", "row", "." ]
a6dd7c96b78045a3d172e3c5b97e9909b32a9fba
https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/Generator.php#L180-L190
225,942
xmeltrut/WordSearch
src/Generator.php
Generator.tryWordInColumn
private function tryWordInColumn($word, $col, $row) { $wordArray = Utils::stringToArray($word); foreach ($wordArray as $letter) { if ($this->grid[$row][$col] !== null && $this->grid[$row][$col] !== $letter ) { return false; } ...
php
private function tryWordInColumn($word, $col, $row) { $wordArray = Utils::stringToArray($word); foreach ($wordArray as $letter) { if ($this->grid[$row][$col] !== null && $this->grid[$row][$col] !== $letter ) { return false; } ...
[ "private", "function", "tryWordInColumn", "(", "$", "word", ",", "$", "col", ",", "$", "row", ")", "{", "$", "wordArray", "=", "Utils", "::", "stringToArray", "(", "$", "word", ")", ";", "foreach", "(", "$", "wordArray", "as", "$", "letter", ")", "{"...
Try to fit a word into a column. @param string $word Word. @param integer $col Column index. @param integer $row Row index.
[ "Try", "to", "fit", "a", "word", "into", "a", "column", "." ]
a6dd7c96b78045a3d172e3c5b97e9909b32a9fba
https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/Generator.php#L199-L213
225,943
xmeltrut/WordSearch
src/Generator.php
Generator.fill
private function fill() { foreach ($this->grid as $r => $row) { foreach ($row as $c => $cell) { if ($cell === null) { $this->grid[$r][$c] = $this->alphabet->randomLetter(); } } } // fill them }
php
private function fill() { foreach ($this->grid as $r => $row) { foreach ($row as $c => $cell) { if ($cell === null) { $this->grid[$r][$c] = $this->alphabet->randomLetter(); } } } // fill them }
[ "private", "function", "fill", "(", ")", "{", "foreach", "(", "$", "this", "->", "grid", "as", "$", "r", "=>", "$", "row", ")", "{", "foreach", "(", "$", "row", "as", "$", "c", "=>", "$", "cell", ")", "{", "if", "(", "$", "cell", "===", "null...
Fill any empty slots. @return void
[ "Fill", "any", "empty", "slots", "." ]
a6dd7c96b78045a3d172e3c5b97e9909b32a9fba
https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/Generator.php#L239-L249
225,944
xmeltrut/WordSearch
src/Factory.php
Factory.create
public static function create(array $words, $size = 15, $lang = 'en') { $alphabet = ($lang == 'fi') ? new Alphabet\Finnish : null; $generator = new Generator($words, $size, $alphabet); return $generator->generate(); }
php
public static function create(array $words, $size = 15, $lang = 'en') { $alphabet = ($lang == 'fi') ? new Alphabet\Finnish : null; $generator = new Generator($words, $size, $alphabet); return $generator->generate(); }
[ "public", "static", "function", "create", "(", "array", "$", "words", ",", "$", "size", "=", "15", ",", "$", "lang", "=", "'en'", ")", "{", "$", "alphabet", "=", "(", "$", "lang", "==", "'fi'", ")", "?", "new", "Alphabet", "\\", "Finnish", ":", "...
Create a puzzle. @param array $words List of words. @param integer $size Grid size. @param string $lang Language. @return Puzzle
[ "Create", "a", "puzzle", "." ]
a6dd7c96b78045a3d172e3c5b97e9909b32a9fba
https://github.com/xmeltrut/WordSearch/blob/a6dd7c96b78045a3d172e3c5b97e9909b32a9fba/src/Factory.php#L15-L20
225,945
ccottet/ldap
Platform/Native/Search.php
Search.next
public function next() { if ($this->isEndReached) { return null; } if (null === $this->previous) { $this->previous = @ldap_first_entry($this->connection, $this->resultSet); } else { $this->previous = @ldap_next_entry($this->connection, $this->previ...
php
public function next() { if ($this->isEndReached) { return null; } if (null === $this->previous) { $this->previous = @ldap_first_entry($this->connection, $this->resultSet); } else { $this->previous = @ldap_next_entry($this->connection, $this->previ...
[ "public", "function", "next", "(", ")", "{", "if", "(", "$", "this", "->", "isEndReached", ")", "{", "return", "null", ";", "}", "if", "(", "null", "===", "$", "this", "->", "previous", ")", "{", "$", "this", "->", "previous", "=", "@", "ldap_first...
Retrieves next available entry from the search result set @return EntryInterface next entry if available, null otherwise
[ "Retrieves", "next", "available", "entry", "from", "the", "search", "result", "set" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Platform/Native/Search.php#L53-L69
225,946
okvpn/datadog-symfony
src/Services/SkipCaptureService.php
SkipCaptureService.shouldExceptionCaptureBeSkipped
public function shouldExceptionCaptureBeSkipped(\Throwable $exception): bool { if (in_array(get_class($exception), $this->skipCapture, true)) { return true; } if ($this->skipHash && in_array($this->hashService->hash($exception), $this->skipHash, true)) { return true; ...
php
public function shouldExceptionCaptureBeSkipped(\Throwable $exception): bool { if (in_array(get_class($exception), $this->skipCapture, true)) { return true; } if ($this->skipHash && in_array($this->hashService->hash($exception), $this->skipHash, true)) { return true; ...
[ "public", "function", "shouldExceptionCaptureBeSkipped", "(", "\\", "Throwable", "$", "exception", ")", ":", "bool", "{", "if", "(", "in_array", "(", "get_class", "(", "$", "exception", ")", ",", "$", "this", "->", "skipCapture", ",", "true", ")", ")", "{"...
Check that exception should be skip @param \Throwable $exception @return bool
[ "Check", "that", "exception", "should", "be", "skip" ]
310eb65b648db692fa877dfb5de6005bf4b9b640
https://github.com/okvpn/datadog-symfony/blob/310eb65b648db692fa877dfb5de6005bf4b9b640/src/Services/SkipCaptureService.php#L47-L71
225,947
okvpn/datadog-symfony
src/Services/SkipCaptureService.php
SkipCaptureService.shouldMessageCaptureBeSkipped
public function shouldMessageCaptureBeSkipped(string $message): bool { if (function_exists('fnmatch')) { foreach ($this->skipWildcard as $wildcard) { if (fnmatch($wildcard, $message)) { return true; } } } if (in_arra...
php
public function shouldMessageCaptureBeSkipped(string $message): bool { if (function_exists('fnmatch')) { foreach ($this->skipWildcard as $wildcard) { if (fnmatch($wildcard, $message)) { return true; } } } if (in_arra...
[ "public", "function", "shouldMessageCaptureBeSkipped", "(", "string", "$", "message", ")", ":", "bool", "{", "if", "(", "function_exists", "(", "'fnmatch'", ")", ")", "{", "foreach", "(", "$", "this", "->", "skipWildcard", "as", "$", "wildcard", ")", "{", ...
Check that message or command should be skip @param string $message @return bool
[ "Check", "that", "message", "or", "command", "should", "be", "skip" ]
310eb65b648db692fa877dfb5de6005bf4b9b640
https://github.com/okvpn/datadog-symfony/blob/310eb65b648db692fa877dfb5de6005bf4b9b640/src/Services/SkipCaptureService.php#L79-L96
225,948
puli/cli
src/Handler/FindCommandHandler.php
FindCommandHandler.handle
public function handle(Args $args, IO $io) { $criteria = array(); if ($args->isOptionSet('path')) { $criteria['path'] = $args->getOption('path'); $criteria['language'] = $args->getOption('language'); } if ($args->isOptionSet('name')) { if (isset(...
php
public function handle(Args $args, IO $io) { $criteria = array(); if ($args->isOptionSet('path')) { $criteria['path'] = $args->getOption('path'); $criteria['language'] = $args->getOption('language'); } if ($args->isOptionSet('name')) { if (isset(...
[ "public", "function", "handle", "(", "Args", "$", "args", ",", "IO", "$", "io", ")", "{", "$", "criteria", "=", "array", "(", ")", ";", "if", "(", "$", "args", "->", "isOptionSet", "(", "'path'", ")", ")", "{", "$", "criteria", "[", "'path'", "]"...
Handles the "find" command. @param Args $args The console arguments. @param IO $io The I/O. @return int The status code.
[ "Handles", "the", "find", "command", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/FindCommandHandler.php#L64-L95
225,949
puli/cli
src/Handler/FindCommandHandler.php
FindCommandHandler.listMatches
private function listMatches(IO $io, array $criteria) { if (isset($criteria['path']) && isset($criteria['bindingType'])) { $matches = array_intersect_key( $this->findByPath($criteria['path'], $criteria['language']), $this->findByBindingType($criteria['bindingType'...
php
private function listMatches(IO $io, array $criteria) { if (isset($criteria['path']) && isset($criteria['bindingType'])) { $matches = array_intersect_key( $this->findByPath($criteria['path'], $criteria['language']), $this->findByBindingType($criteria['bindingType'...
[ "private", "function", "listMatches", "(", "IO", "$", "io", ",", "array", "$", "criteria", ")", "{", "if", "(", "isset", "(", "$", "criteria", "[", "'path'", "]", ")", "&&", "isset", "(", "$", "criteria", "[", "'bindingType'", "]", ")", ")", "{", "...
Lists the matches for the given search criteria. @param IO $io The I/O. @param array $criteria The array with the optional keys "pattern", "shortClass" and "bindingType". @return int The status code.
[ "Lists", "the", "matches", "for", "the", "given", "search", "criteria", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/FindCommandHandler.php#L106-L132
225,950
puli/cli
src/Handler/FindCommandHandler.php
FindCommandHandler.findByPath
private function findByPath($query, $language = 'glob') { $matches = array(); $query = '/'.ltrim($query, '/'); foreach ($this->repo->find($query, $language) as $resource) { $matches[$resource->getPath()] = StringUtil::getShortClassName(get_class($resource)); } r...
php
private function findByPath($query, $language = 'glob') { $matches = array(); $query = '/'.ltrim($query, '/'); foreach ($this->repo->find($query, $language) as $resource) { $matches[$resource->getPath()] = StringUtil::getShortClassName(get_class($resource)); } r...
[ "private", "function", "findByPath", "(", "$", "query", ",", "$", "language", "=", "'glob'", ")", "{", "$", "matches", "=", "array", "(", ")", ";", "$", "query", "=", "'/'", ".", "ltrim", "(", "$", "query", ",", "'/'", ")", ";", "foreach", "(", "...
Finds the resources for a given path pattern. @param string $query The resource query. @param string $language The language of the query. @return string[] An array of short resource class names indexed by the resource path.
[ "Finds", "the", "resources", "for", "a", "given", "path", "pattern", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/FindCommandHandler.php#L143-L153
225,951
puli/cli
src/Handler/FindCommandHandler.php
FindCommandHandler.findByBindingType
private function findByBindingType($typeName) { $matches = array(); $expr = Expr::isInstanceOf('Puli\Discovery\Binding\ResourceBinding'); foreach ($this->discovery->findBindings($typeName, $expr) as $binding) { /** @var ResourceBinding $binding */ foreach ($binding-...
php
private function findByBindingType($typeName) { $matches = array(); $expr = Expr::isInstanceOf('Puli\Discovery\Binding\ResourceBinding'); foreach ($this->discovery->findBindings($typeName, $expr) as $binding) { /** @var ResourceBinding $binding */ foreach ($binding-...
[ "private", "function", "findByBindingType", "(", "$", "typeName", ")", "{", "$", "matches", "=", "array", "(", ")", ";", "$", "expr", "=", "Expr", "::", "isInstanceOf", "(", "'Puli\\Discovery\\Binding\\ResourceBinding'", ")", ";", "foreach", "(", "$", "this", ...
Finds the resources for a given binding type. @param string $typeName The type name. @return string[] An array of short resource class names indexed by the resource path.
[ "Finds", "the", "resources", "for", "a", "given", "binding", "type", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/FindCommandHandler.php#L163-L179
225,952
puli/cli
src/Handler/FindCommandHandler.php
FindCommandHandler.printTable
private function printTable(IO $io, array $matches) { $table = new Table(TableStyle::borderless()); foreach ($matches as $path => $shortClass) { $table->addRow(array($shortClass, sprintf('<c1>%s</c1>', $path))); } $table->render($io); }
php
private function printTable(IO $io, array $matches) { $table = new Table(TableStyle::borderless()); foreach ($matches as $path => $shortClass) { $table->addRow(array($shortClass, sprintf('<c1>%s</c1>', $path))); } $table->render($io); }
[ "private", "function", "printTable", "(", "IO", "$", "io", ",", "array", "$", "matches", ")", "{", "$", "table", "=", "new", "Table", "(", "TableStyle", "::", "borderless", "(", ")", ")", ";", "foreach", "(", "$", "matches", "as", "$", "path", "=>", ...
Prints the given resources. @param IO $io The I/O. @param string[] $matches An array of short resource class names indexed by the resource path.
[ "Prints", "the", "given", "resources", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/FindCommandHandler.php#L188-L197
225,953
ccottet/ldap
Core/Node.php
Node.hydrateFromEntry
public function hydrateFromEntry(EntryInterface $entry) { $this->dn = $entry->getDn(); $this->attributes = array(); foreach ($entry->getAttributes() as $name => $data) { $attr = new NodeAttribute($name); $attr->add($data); $this->mergeAttribute($attr); ...
php
public function hydrateFromEntry(EntryInterface $entry) { $this->dn = $entry->getDn(); $this->attributes = array(); foreach ($entry->getAttributes() as $name => $data) { $attr = new NodeAttribute($name); $attr->add($data); $this->mergeAttribute($attr); ...
[ "public", "function", "hydrateFromEntry", "(", "EntryInterface", "$", "entry", ")", "{", "$", "this", "->", "dn", "=", "$", "entry", "->", "getDn", "(", ")", ";", "$", "this", "->", "attributes", "=", "array", "(", ")", ";", "foreach", "(", "$", "ent...
Hydrate from a LDAP entry @param EntryInterface $entry Entry to use for loading @return void
[ "Hydrate", "from", "a", "LDAP", "entry" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Node.php#L51-L64
225,954
ccottet/ldap
Core/Node.php
Node.setDn
public function setDn($dn, $force = false) { if (($this->isHydrated) && (! $force)) { throw new \InvalidArgumentException('Dn cannot be updated manually'); } $this->dn = $dn; }
php
public function setDn($dn, $force = false) { if (($this->isHydrated) && (! $force)) { throw new \InvalidArgumentException('Dn cannot be updated manually'); } $this->dn = $dn; }
[ "public", "function", "setDn", "(", "$", "dn", ",", "$", "force", "=", "false", ")", "{", "if", "(", "(", "$", "this", "->", "isHydrated", ")", "&&", "(", "!", "$", "force", ")", ")", "{", "throw", "new", "\\", "InvalidArgumentException", "(", "'Dn...
Setter for distinguished name @param string $dn Distinguished name @param boolean $force Whether to force dn change (Default: false) @return void @throws InvalidArgumentException If entry is bound
[ "Setter", "for", "distinguished", "name" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Node.php#L86-L92
225,955
ccottet/ldap
Core/Node.php
Node.removeAttribute
public function removeAttribute($name) { if (! $this->has($name)) { return false; } unset($this->attributes[$name]); $this->tracker->logDeletion($name); return true; }
php
public function removeAttribute($name) { if (! $this->has($name)) { return false; } unset($this->attributes[$name]); $this->tracker->logDeletion($name); return true; }
[ "public", "function", "removeAttribute", "(", "$", "name", ")", "{", "if", "(", "!", "$", "this", "->", "has", "(", "$", "name", ")", ")", "{", "return", "false", ";", "}", "unset", "(", "$", "this", "->", "attributes", "[", "$", "name", "]", ")"...
Removes an attribute from the node store @param string $name Attribute name @return boolean true on success
[ "Removes", "an", "attribute", "from", "the", "node", "store" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Node.php#L144-L152
225,956
ccottet/ldap
Core/Node.php
Node.get
public function get($name, $create = false) { if (! $this->has($name)) { if (! $create) { return null; } $this->mergeAttribute(new NodeAttribute($name)); } return $this->attributes[$name]; }
php
public function get($name, $create = false) { if (! $this->has($name)) { if (! $create) { return null; } $this->mergeAttribute(new NodeAttribute($name)); } return $this->attributes[$name]; }
[ "public", "function", "get", "(", "$", "name", ",", "$", "create", "=", "false", ")", "{", "if", "(", "!", "$", "this", "->", "has", "(", "$", "name", ")", ")", "{", "if", "(", "!", "$", "create", ")", "{", "return", "null", ";", "}", "$", ...
Retrieves an attribute from its name @param string $name Name of the attribute to look for @param boolean $create Whether to create a new instance if it is not set (Default: false) @return NodeAttribute or null if it does not exist and $create is false
[ "Retrieves", "an", "attribute", "from", "its", "name" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Node.php#L162-L171
225,957
ccottet/ldap
Core/Node.php
Node.getDiffAdditions
public function getDiffAdditions() { $data = $this->getValueDiffData('getDiffAdditions'); foreach ($this->tracker->getAdditions() as $name) { $data[$name] = $this->get($name)->getValues(); } return $data; }
php
public function getDiffAdditions() { $data = $this->getValueDiffData('getDiffAdditions'); foreach ($this->tracker->getAdditions() as $name) { $data[$name] = $this->get($name)->getValues(); } return $data; }
[ "public", "function", "getDiffAdditions", "(", ")", "{", "$", "data", "=", "$", "this", "->", "getValueDiffData", "(", "'getDiffAdditions'", ")", ";", "foreach", "(", "$", "this", "->", "tracker", "->", "getAdditions", "(", ")", "as", "$", "name", ")", "...
Retrieves diff additions for the attribute @return array Added values
[ "Retrieves", "diff", "additions", "for", "the", "attribute" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Node.php#L190-L197
225,958
ccottet/ldap
Core/Node.php
Node.getDiffDeletions
public function getDiffDeletions() { $data = $this->getValueDiffData('getDiffDeletions'); foreach ($this->tracker->getDeletions() as $name) { $data[$name] = array(); } return $data; }
php
public function getDiffDeletions() { $data = $this->getValueDiffData('getDiffDeletions'); foreach ($this->tracker->getDeletions() as $name) { $data[$name] = array(); } return $data; }
[ "public", "function", "getDiffDeletions", "(", ")", "{", "$", "data", "=", "$", "this", "->", "getValueDiffData", "(", "'getDiffDeletions'", ")", ";", "foreach", "(", "$", "this", "->", "tracker", "->", "getDeletions", "(", ")", "as", "$", "name", ")", "...
Retrieves diff deletions for the attribute @return array Deleted values
[ "Retrieves", "diff", "deletions", "for", "the", "attribute" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Node.php#L204-L211
225,959
ccottet/ldap
Core/Node.php
Node.getValueDiffData
protected function getValueDiffData($method) { $data = array(); foreach ($this->getSafeAttributes() as $attribute) { $buffer = call_user_func(array($attribute, $method)); if (count($buffer) > 0) { $data[$attribute->getName()] = $buffer; } }...
php
protected function getValueDiffData($method) { $data = array(); foreach ($this->getSafeAttributes() as $attribute) { $buffer = call_user_func(array($attribute, $method)); if (count($buffer) > 0) { $data[$attribute->getName()] = $buffer; } }...
[ "protected", "function", "getValueDiffData", "(", "$", "method", ")", "{", "$", "data", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "getSafeAttributes", "(", ")", "as", "$", "attribute", ")", "{", "$", "buffer", "=", "call_user_func",...
Retrieve attribute value level diff information @param string $method Name of the diff method to use on the attribute @return array Diff data
[ "Retrieve", "attribute", "value", "level", "diff", "information" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Node.php#L220-L230
225,960
ccottet/ldap
Core/Node.php
Node.getDiffReplacements
public function getDiffReplacements() { $data = array(); foreach ($this->getSafeAttributes() as $attribute) { if ($attribute->isReplaced()) { $data[$attribute->getName()] = $attribute->getValues(); } } foreach ($this->tracker->getReplacements()...
php
public function getDiffReplacements() { $data = array(); foreach ($this->getSafeAttributes() as $attribute) { if ($attribute->isReplaced()) { $data[$attribute->getName()] = $attribute->getValues(); } } foreach ($this->tracker->getReplacements()...
[ "public", "function", "getDiffReplacements", "(", ")", "{", "$", "data", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "getSafeAttributes", "(", ")", "as", "$", "attribute", ")", "{", "if", "(", "$", "attribute", "->", "isReplaced", "...
Retrieves diff replacements for the attribute @return array Replaced values
[ "Retrieves", "diff", "replacements", "for", "the", "attribute" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Node.php#L259-L271
225,961
ccottet/ldap
Core/Node.php
Node.snapshot
public function snapshot($isHydrated = true) { $this->tracker->reset(); foreach ($this->attributes as $attribute) { $attribute->snapshot(); } if ($isHydrated) { $this->isHydrated = true; } }
php
public function snapshot($isHydrated = true) { $this->tracker->reset(); foreach ($this->attributes as $attribute) { $attribute->snapshot(); } if ($isHydrated) { $this->isHydrated = true; } }
[ "public", "function", "snapshot", "(", "$", "isHydrated", "=", "true", ")", "{", "$", "this", "->", "tracker", "->", "reset", "(", ")", ";", "foreach", "(", "$", "this", "->", "attributes", "as", "$", "attribute", ")", "{", "$", "attribute", "->", "s...
Snapshot resets diff tracking @param boolean $isHydrated Whether snapshot is due to hydration (Default: true) @return void
[ "Snapshot", "resets", "diff", "tracking" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Node.php#L280-L289
225,962
ccottet/ldap
Core/Node.php
Node.getRawAttributes
public function getRawAttributes() { $data = array(); foreach ($this->attributes as $name => $attribute) { $data[$name] = $attribute->getValues(); } return $data; }
php
public function getRawAttributes() { $data = array(); foreach ($this->attributes as $name => $attribute) { $data[$name] = $attribute->getValues(); } return $data; }
[ "public", "function", "getRawAttributes", "(", ")", "{", "$", "data", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "attributes", "as", "$", "name", "=>", "$", "attribute", ")", "{", "$", "data", "[", "$", "name", "]", "=", "$", ...
Retrieves attribute data in a raw format for persistence operations @return array Raw data of attributes
[ "Retrieves", "attribute", "data", "in", "a", "raw", "format", "for", "persistence", "operations" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Node.php#L306-L313
225,963
ccottet/ldap
Core/Node.php
Node.rebaseDiff
public function rebaseDiff(Node $node) { $changes = array_merge( $node->getDiffAdditions(), $node->getDiffDeletions(), $node->getDiffReplacements() ); if (count($changes) > 0) { throw new RebaseException( sprintf( ...
php
public function rebaseDiff(Node $node) { $changes = array_merge( $node->getDiffAdditions(), $node->getDiffDeletions(), $node->getDiffReplacements() ); if (count($changes) > 0) { throw new RebaseException( sprintf( ...
[ "public", "function", "rebaseDiff", "(", "Node", "$", "node", ")", "{", "$", "changes", "=", "array_merge", "(", "$", "node", "->", "getDiffAdditions", "(", ")", ",", "$", "node", "->", "getDiffDeletions", "(", ")", ",", "$", "node", "->", "getDiffReplac...
Rebase diff based on source node as an origin @param Node $node Node to use as a source for origin @return void @throws RebaseException If source of origin node has uncommitted changes
[ "Rebase", "diff", "based", "on", "source", "node", "as", "an", "origin" ]
0759f17996fbb434ee5155dc527b95d8059c6d41
https://github.com/ccottet/ldap/blob/0759f17996fbb434ee5155dc527b95d8059c6d41/Core/Node.php#L324-L361
225,964
web3p/rlp
src/RLP.php
RLP.decode
public function decode(string $input) { // if (!is_string($input)) { // throw new InvalidArgumentException('Input must be string when call decode.'); // } $input = $this->toBuffer($input); $decoded = $this->decodeData($input); return $decoded['data']; ...
php
public function decode(string $input) { // if (!is_string($input)) { // throw new InvalidArgumentException('Input must be string when call decode.'); // } $input = $this->toBuffer($input); $decoded = $this->decodeData($input); return $decoded['data']; ...
[ "public", "function", "decode", "(", "string", "$", "input", ")", "{", "// if (!is_string($input)) {\r", "// throw new InvalidArgumentException('Input must be string when call decode.');\r", "// }\r", "$", "input", "=", "$", "this", "->", "toBuffer", "(", "$", "input", ...
decode Maybe use bignumber future. @param string $input @return array
[ "decode", "Maybe", "use", "bignumber", "future", "." ]
76f2a6a1800e2756bf2eb9b41bd4f2f91ce05c37
https://github.com/web3p/rlp/blob/76f2a6a1800e2756bf2eb9b41bd4f2f91ce05c37/src/RLP.php#L55-L64
225,965
web3p/rlp
src/RLP.php
RLP.toBuffer
protected function toBuffer($input) { if (is_string($input)) { if (strpos($input, '0x') === 0) { // hex string // $input = str_replace('0x', '', $input); return new Buffer($input, 'hex'); } return new Buffer(str_spli...
php
protected function toBuffer($input) { if (is_string($input)) { if (strpos($input, '0x') === 0) { // hex string // $input = str_replace('0x', '', $input); return new Buffer($input, 'hex'); } return new Buffer(str_spli...
[ "protected", "function", "toBuffer", "(", "$", "input", ")", "{", "if", "(", "is_string", "(", "$", "input", ")", ")", "{", "if", "(", "strpos", "(", "$", "input", ",", "'0x'", ")", "===", "0", ")", "{", "// hex string\r", "// $input = str_replace('0x', ...
toBuffer Format input to buffer. @param mixed $input @return \Web3p\RLP\Buffer
[ "toBuffer", "Format", "input", "to", "buffer", "." ]
76f2a6a1800e2756bf2eb9b41bd4f2f91ce05c37
https://github.com/web3p/rlp/blob/76f2a6a1800e2756bf2eb9b41bd4f2f91ce05c37/src/RLP.php#L245-L272
225,966
puli/cli
src/Handler/UpgradeCommandHandler.php
UpgradeCommandHandler.handle
public function handle(Args $args, IO $io) { $moduleFile = $this->moduleFileManager->getModuleFile(); $originVersion = $moduleFile->getVersion(); $targetVersion = $args->getArgument('version'); if (version_compare($originVersion, $targetVersion, '=')) { $io->writeLine(sp...
php
public function handle(Args $args, IO $io) { $moduleFile = $this->moduleFileManager->getModuleFile(); $originVersion = $moduleFile->getVersion(); $targetVersion = $args->getArgument('version'); if (version_compare($originVersion, $targetVersion, '=')) { $io->writeLine(sp...
[ "public", "function", "handle", "(", "Args", "$", "args", ",", "IO", "$", "io", ")", "{", "$", "moduleFile", "=", "$", "this", "->", "moduleFileManager", "->", "getModuleFile", "(", ")", ";", "$", "originVersion", "=", "$", "moduleFile", "->", "getVersio...
Handles the "upgrade" command. @param Args $args The console arguments @param IO $io The I/O @return int The status code
[ "Handles", "the", "upgrade", "command", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/UpgradeCommandHandler.php#L51-L72
225,967
tyxla/carbon-breadcrumbs
core/class-carbon-breadcrumb-item-renderer.php
Carbon_Breadcrumb_Item_Renderer.render
public function render() { $item_output = ''; $item = $this->get_item(); $index = $this->get_index(); $trail = $this->get_trail(); $trail_renderer = $this->get_trail_renderer(); // Link before and opening <a>. $item_output .= $this->render_link_before(); // Title along w...
php
public function render() { $item_output = ''; $item = $this->get_item(); $index = $this->get_index(); $trail = $this->get_trail(); $trail_renderer = $this->get_trail_renderer(); // Link before and opening <a>. $item_output .= $this->render_link_before(); // Title along w...
[ "public", "function", "render", "(", ")", "{", "$", "item_output", "=", "''", ";", "$", "item", "=", "$", "this", "->", "get_item", "(", ")", ";", "$", "index", "=", "$", "this", "->", "get_index", "(", ")", ";", "$", "trail", "=", "$", "this", ...
Render the item. @access public @return string $item_output The HTML of this item.
[ "Render", "the", "item", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-item-renderer.php#L73-L91
225,968
tyxla/carbon-breadcrumbs
core/class-carbon-breadcrumb-item-renderer.php
Carbon_Breadcrumb_Item_Renderer.get_item_link
public function get_item_link() { $item = $this->get_item(); $item_link = apply_filters( 'carbon_breadcrumbs_item_link', $item->get_link(), $item ); return $item_link; }
php
public function get_item_link() { $item = $this->get_item(); $item_link = apply_filters( 'carbon_breadcrumbs_item_link', $item->get_link(), $item ); return $item_link; }
[ "public", "function", "get_item_link", "(", ")", "{", "$", "item", "=", "$", "this", "->", "get_item", "(", ")", ";", "$", "item_link", "=", "apply_filters", "(", "'carbon_breadcrumbs_item_link'", ",", "$", "item", "->", "get_link", "(", ")", ",", "$", "...
Retrieve the item link URL. @access public @return string $item_link The link URL of this item.
[ "Retrieve", "the", "item", "link", "URL", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-item-renderer.php#L100-L104
225,969
tyxla/carbon-breadcrumbs
core/class-carbon-breadcrumb-item-renderer.php
Carbon_Breadcrumb_Item_Renderer.render_link_before
public function render_link_before() { $trail_renderer = $this->get_trail_renderer(); $item_link = $this->get_item_link(); // HTML before link opening tag. $output = $trail_renderer->get_link_before(); // Link can be optional or disabled. if ( $item_link && $this->is_link_enabled() ) { $output .= ...
php
public function render_link_before() { $trail_renderer = $this->get_trail_renderer(); $item_link = $this->get_item_link(); // HTML before link opening tag. $output = $trail_renderer->get_link_before(); // Link can be optional or disabled. if ( $item_link && $this->is_link_enabled() ) { $output .= ...
[ "public", "function", "render_link_before", "(", ")", "{", "$", "trail_renderer", "=", "$", "this", "->", "get_trail_renderer", "(", ")", ";", "$", "item_link", "=", "$", "this", "->", "get_item_link", "(", ")", ";", "// HTML before link opening tag.", "$", "o...
Render the item link opening tag and its "before" wrapper. @access public @return string $output The output HTML.
[ "Render", "the", "item", "link", "opening", "tag", "and", "its", "before", "wrapper", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-item-renderer.php#L113-L126
225,970
tyxla/carbon-breadcrumbs
core/class-carbon-breadcrumb-item-renderer.php
Carbon_Breadcrumb_Item_Renderer.render_link_after
public function render_link_after() { $trail_renderer = $this->get_trail_renderer(); $item_link = $this->get_item_link(); $output = ''; // Link can be optional or disabled. if ( $item_link && $this->is_link_enabled() ) { $output .= '</a>'; } // HTML after link closing tag. $output .= $...
php
public function render_link_after() { $trail_renderer = $this->get_trail_renderer(); $item_link = $this->get_item_link(); $output = ''; // Link can be optional or disabled. if ( $item_link && $this->is_link_enabled() ) { $output .= '</a>'; } // HTML after link closing tag. $output .= $...
[ "public", "function", "render_link_after", "(", ")", "{", "$", "trail_renderer", "=", "$", "this", "->", "get_trail_renderer", "(", ")", ";", "$", "item_link", "=", "$", "this", "->", "get_item_link", "(", ")", ";", "$", "output", "=", "''", ";", "// Lin...
Render the item link closing tag and its "after" wrapper. @access public @return string $output The output HTML.
[ "Render", "the", "item", "link", "closing", "tag", "and", "its", "after", "wrapper", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-item-renderer.php#L135-L149
225,971
tyxla/carbon-breadcrumbs
core/class-carbon-breadcrumb-item-renderer.php
Carbon_Breadcrumb_Item_Renderer.render_title
public function render_title() { $item = $this->get_item(); $trail_renderer = $this->get_trail_renderer(); // HTML before title. $output = $trail_renderer->get_title_before(); // Breadcrumb item title. $output .= apply_filters( 'carbon_breadcrumbs_item_title', $item->get_title(), $item ); // ...
php
public function render_title() { $item = $this->get_item(); $trail_renderer = $this->get_trail_renderer(); // HTML before title. $output = $trail_renderer->get_title_before(); // Breadcrumb item title. $output .= apply_filters( 'carbon_breadcrumbs_item_title', $item->get_title(), $item ); // ...
[ "public", "function", "render_title", "(", ")", "{", "$", "item", "=", "$", "this", "->", "get_item", "(", ")", ";", "$", "trail_renderer", "=", "$", "this", "->", "get_trail_renderer", "(", ")", ";", "// HTML before title.", "$", "output", "=", "$", "tr...
Render the item title, along with its before & after wrappers. @access public @return string $output The output HTML.
[ "Render", "the", "item", "title", "along", "with", "its", "before", "&", "after", "wrappers", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-item-renderer.php#L158-L172
225,972
tyxla/carbon-breadcrumbs
core/class-carbon-breadcrumb-item-renderer.php
Carbon_Breadcrumb_Item_Renderer.get_item_attributes_html
public function get_item_attributes_html() { $item = $this->get_item(); // Get the item attributes. $item_attributes = apply_filters( 'carbon_breadcrumbs_item_attributes', $item->get_attributes(), $item ); // Prepare the item attributes. $attributes_html = ''; foreach ( $item_attributes as $attr => $attr_...
php
public function get_item_attributes_html() { $item = $this->get_item(); // Get the item attributes. $item_attributes = apply_filters( 'carbon_breadcrumbs_item_attributes', $item->get_attributes(), $item ); // Prepare the item attributes. $attributes_html = ''; foreach ( $item_attributes as $attr => $attr_...
[ "public", "function", "get_item_attributes_html", "(", ")", "{", "$", "item", "=", "$", "this", "->", "get_item", "(", ")", ";", "// Get the item attributes.", "$", "item_attributes", "=", "apply_filters", "(", "'carbon_breadcrumbs_item_attributes'", ",", "$", "item...
Retrieve the attributes of the item link. @access public @return string $attributes_html The HTML of the item attributes.
[ "Retrieve", "the", "attributes", "of", "the", "item", "link", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-item-renderer.php#L181-L194
225,973
tyxla/carbon-breadcrumbs
core/class-carbon-breadcrumb-item-renderer.php
Carbon_Breadcrumb_Item_Renderer.is_link_enabled
public function is_link_enabled() { $trail = $this->get_trail(); $trail_renderer = $this->get_trail_renderer(); $total_items = $trail->get_total_items(); $index = $this->get_index(); return $trail_renderer->get_last_item_link() || $index < $total_items; }
php
public function is_link_enabled() { $trail = $this->get_trail(); $trail_renderer = $this->get_trail_renderer(); $total_items = $trail->get_total_items(); $index = $this->get_index(); return $trail_renderer->get_last_item_link() || $index < $total_items; }
[ "public", "function", "is_link_enabled", "(", ")", "{", "$", "trail", "=", "$", "this", "->", "get_trail", "(", ")", ";", "$", "trail_renderer", "=", "$", "this", "->", "get_trail_renderer", "(", ")", ";", "$", "total_items", "=", "$", "trail", "->", "...
Whether the link of this item is enabled. @access public @return bool
[ "Whether", "the", "link", "of", "this", "item", "is", "enabled", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-item-renderer.php#L203-L210
225,974
growthexponent/laravel-html-dom-parser
src/LaravelHtmlDomParser/CurlProxy.php
CurlProxy.get
public function get($url, $proxy = null) { $referer = "http://example.com/"; $agent = "My PHP Script"; $aHTTP['http']['proxy'] = 'tcp://'.$proxy[0].':'.$proxy[1]; // The proxy ip and port number $aHTTP['http']['request_fulluri'] = true; // use the full URI in the Request. ...
php
public function get($url, $proxy = null) { $referer = "http://example.com/"; $agent = "My PHP Script"; $aHTTP['http']['proxy'] = 'tcp://'.$proxy[0].':'.$proxy[1]; // The proxy ip and port number $aHTTP['http']['request_fulluri'] = true; // use the full URI in the Request. ...
[ "public", "function", "get", "(", "$", "url", ",", "$", "proxy", "=", "null", ")", "{", "$", "referer", "=", "\"http://example.com/\"", ";", "$", "agent", "=", "\"My PHP Script\"", ";", "$", "aHTTP", "[", "'http'", "]", "[", "'proxy'", "]", "=", "'tcp:...
A simple curl implementation to get the content of the url via a proxy server. @param string $url @param array $proxy // server[0] and port[1] @return string @throws CurlException
[ "A", "simple", "curl", "implementation", "to", "get", "the", "content", "of", "the", "url", "via", "a", "proxy", "server", "." ]
36c84d704f2360b214f457a5e3a0930a19bd7b57
https://github.com/growthexponent/laravel-html-dom-parser/blob/36c84d704f2360b214f457a5e3a0930a19bd7b57/src/LaravelHtmlDomParser/CurlProxy.php#L25-L65
225,975
tyxla/carbon-breadcrumbs
core/class-carbon-breadcrumb-item.php
Carbon_Breadcrumb_Item.factory
public static function factory( $type = 'custom', $priority = 1000 ) { $class = self::verify_class_name( __CLASS__ . '_' . $type, 'Unexisting breadcrumb item type: "' . $type . '".' ); $item = new $class( $priority ); $item->set_type( $type ); return $item; }
php
public static function factory( $type = 'custom', $priority = 1000 ) { $class = self::verify_class_name( __CLASS__ . '_' . $type, 'Unexisting breadcrumb item type: "' . $type . '".' ); $item = new $class( $priority ); $item->set_type( $type ); return $item; }
[ "public", "static", "function", "factory", "(", "$", "type", "=", "'custom'", ",", "$", "priority", "=", "1000", ")", "{", "$", "class", "=", "self", "::", "verify_class_name", "(", "__CLASS__", ".", "'_'", ".", "$", "type", ",", "'Unexisting breadcrumb it...
Build a new breadcrumb item of the selected type. @static @access public @param string $type Type of the breadcrumb item. @param int $priority Priority of this breadcrumb item. @return Carbon_Breadcrumb_Item $item The new breadcrumb item.
[ "Build", "a", "new", "breadcrumb", "item", "of", "the", "selected", "type", "." ]
0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185
https://github.com/tyxla/carbon-breadcrumbs/blob/0af5b5dd5b9848fd3e7db7fd0513d4f1faeaf185/core/class-carbon-breadcrumb-item.php#L75-L82
225,976
puli/cli
src/Util/ArgsUtil.php
ArgsUtil.getModuleNames
public static function getModuleNames(Args $args, ModuleList $modules) { // Display all modules if "all" is set if ($args->isOptionSet('all')) { return $modules->getModuleNames(); } $moduleNames = array(); if ($args->isOptionSet('root')) { $moduleNam...
php
public static function getModuleNames(Args $args, ModuleList $modules) { // Display all modules if "all" is set if ($args->isOptionSet('all')) { return $modules->getModuleNames(); } $moduleNames = array(); if ($args->isOptionSet('root')) { $moduleNam...
[ "public", "static", "function", "getModuleNames", "(", "Args", "$", "args", ",", "ModuleList", "$", "modules", ")", "{", "// Display all modules if \"all\" is set", "if", "(", "$", "args", "->", "isOptionSet", "(", "'all'", ")", ")", "{", "return", "$", "modul...
Returns the modules selected in the console arguments. @param Args $args The console arguments @param ModuleList $modules The available modules @return string[] The module names
[ "Returns", "the", "modules", "selected", "in", "the", "console", "arguments", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Util/ArgsUtil.php#L34-L52
225,977
puli/cli
src/Util/ArgsUtil.php
ArgsUtil.getModuleNamesWithoutRoot
public static function getModuleNamesWithoutRoot(Args $args, ModuleList $modules) { // Display all modules if "all" is set if ($args->isOptionSet('all')) { return $modules->getInstalledModuleNames(); } $moduleNames = array(); foreach ($args->getOption('module') ...
php
public static function getModuleNamesWithoutRoot(Args $args, ModuleList $modules) { // Display all modules if "all" is set if ($args->isOptionSet('all')) { return $modules->getInstalledModuleNames(); } $moduleNames = array(); foreach ($args->getOption('module') ...
[ "public", "static", "function", "getModuleNamesWithoutRoot", "(", "Args", "$", "args", ",", "ModuleList", "$", "modules", ")", "{", "// Display all modules if \"all\" is set", "if", "(", "$", "args", "->", "isOptionSet", "(", "'all'", ")", ")", "{", "return", "$...
Returns the non-root modules selected in the console arguments. @param Args $args The console arguments @param ModuleList $modules The available modules @return string[] The module names
[ "Returns", "the", "non", "-", "root", "modules", "selected", "in", "the", "console", "arguments", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Util/ArgsUtil.php#L62-L76
225,978
puli/cli
src/Handler/BindCommandHandler.php
BindCommandHandler.getBindingStates
private function getBindingStates(Args $args) { $states = array( BindingState::ENABLED => 'enabled', BindingState::DISABLED => 'disabled', BindingState::TYPE_NOT_FOUND => 'type-not-found', BindingState::TYPE_NOT_ENABLED => 'type-not-enabled', Bindi...
php
private function getBindingStates(Args $args) { $states = array( BindingState::ENABLED => 'enabled', BindingState::DISABLED => 'disabled', BindingState::TYPE_NOT_FOUND => 'type-not-found', BindingState::TYPE_NOT_ENABLED => 'type-not-enabled', Bindi...
[ "private", "function", "getBindingStates", "(", "Args", "$", "args", ")", "{", "$", "states", "=", "array", "(", "BindingState", "::", "ENABLED", "=>", "'enabled'", ",", "BindingState", "::", "DISABLED", "=>", "'disabled'", ",", "BindingState", "::", "TYPE_NOT...
Returns the binding states selected in the console arguments. @param Args $args The console arguments @return int[] The selected {@link BindingState} constants
[ "Returns", "the", "binding", "states", "selected", "in", "the", "console", "arguments", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/BindCommandHandler.php#L289-L304
225,979
puli/cli
src/Handler/BindCommandHandler.php
BindCommandHandler.printBindingTable
private function printBindingTable(IO $io, array $descriptors, $indentation = 0, $enabled = true) { $table = new Table(PuliTableStyle::borderless()); $table->setHeaderRow(array('UUID', 'Glob', 'Type')); $paramTag = $enabled ? 'c1' : 'bad'; $artifactTag = $enabled ? 'c1' : 'bad'; ...
php
private function printBindingTable(IO $io, array $descriptors, $indentation = 0, $enabled = true) { $table = new Table(PuliTableStyle::borderless()); $table->setHeaderRow(array('UUID', 'Glob', 'Type')); $paramTag = $enabled ? 'c1' : 'bad'; $artifactTag = $enabled ? 'c1' : 'bad'; ...
[ "private", "function", "printBindingTable", "(", "IO", "$", "io", ",", "array", "$", "descriptors", ",", "$", "indentation", "=", "0", ",", "$", "enabled", "=", "true", ")", "{", "$", "table", "=", "new", "Table", "(", "PuliTableStyle", "::", "borderless...
Prints a list of binding descriptors. @param IO $io The I/O @param BindingDescriptor[] $descriptors The binding descriptors @param int $indentation The number of spaces to indent @param bool $enabled Whether the binding descriptors are enabled. If not, the o...
[ "Prints", "a", "list", "of", "binding", "descriptors", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/BindCommandHandler.php#L316-L370
225,980
puli/cli
src/Handler/BindCommandHandler.php
BindCommandHandler.printBindingStateHeader
private function printBindingStateHeader(IO $io, $bindingState) { switch ($bindingState) { case BindingState::ENABLED: $io->writeLine('The following bindings are currently enabled:'); $io->writeLine(''); return; case BindingState::DISA...
php
private function printBindingStateHeader(IO $io, $bindingState) { switch ($bindingState) { case BindingState::ENABLED: $io->writeLine('The following bindings are currently enabled:'); $io->writeLine(''); return; case BindingState::DISA...
[ "private", "function", "printBindingStateHeader", "(", "IO", "$", "io", ",", "$", "bindingState", ")", "{", "switch", "(", "$", "bindingState", ")", "{", "case", "BindingState", "::", "ENABLED", ":", "$", "io", "->", "writeLine", "(", "'The following bindings ...
Prints the header for a binding state. @param IO $io The I/O @param int $bindingState The {@link BindingState} constant
[ "Prints", "the", "header", "for", "a", "binding", "state", "." ]
bbd704e8755650f7ab7bb07a7d5ef15fb0d70794
https://github.com/puli/cli/blob/bbd704e8755650f7ab7bb07a7d5ef15fb0d70794/src/Handler/BindCommandHandler.php#L378-L411
225,981
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.resetPath
public function resetPath($path = '') { $this->blob = (new Blob($this->package))->setPath($path); // Ensure that user folder exists on first load $userFolder = Str::normalizePath(config('cripfilesys.user_folder')); if ($this->blob->path == $userFolder) { $this->makeDirec...
php
public function resetPath($path = '') { $this->blob = (new Blob($this->package))->setPath($path); // Ensure that user folder exists on first load $userFolder = Str::normalizePath(config('cripfilesys.user_folder')); if ($this->blob->path == $userFolder) { $this->makeDirec...
[ "public", "function", "resetPath", "(", "$", "path", "=", "''", ")", "{", "$", "this", "->", "blob", "=", "(", "new", "Blob", "(", "$", "this", "->", "package", ")", ")", "->", "setPath", "(", "$", "path", ")", ";", "// Ensure that user folder exists o...
Reset current blob instance to the new path. @param string $path
[ "Reset", "current", "blob", "instance", "to", "the", "new", "path", "." ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L50-L59
225,982
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.upload
public function upload(UploadedFile $uploadedFile) { if ($this->blob === null) { throw new \Exception('Blob path is not set yet.'); } $this->makeDirectory(); $path = $this->blob->path; $ext = $uploadedFile->getClientOriginalExtension(); $name = Slug::mak...
php
public function upload(UploadedFile $uploadedFile) { if ($this->blob === null) { throw new \Exception('Blob path is not set yet.'); } $this->makeDirectory(); $path = $this->blob->path; $ext = $uploadedFile->getClientOriginalExtension(); $name = Slug::mak...
[ "public", "function", "upload", "(", "UploadedFile", "$", "uploadedFile", ")", "{", "if", "(", "$", "this", "->", "blob", "===", "null", ")", "{", "throw", "new", "\\", "Exception", "(", "'Blob path is not set yet.'", ")", ";", "}", "$", "this", "->", "m...
Write the contents of a file on storage. @param UploadedFile $uploadedFile @return array|File|Folder @throws \Exception
[ "Write", "the", "contents", "of", "a", "file", "on", "storage", "." ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L67-L94
225,983
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.rename
public function rename($name) { $name = Str::slug($name); if ($this->isFile()) { return $this->renameFile($name, $this->getMetaData()->getExtension()); } return $this->renameFolder($name); }
php
public function rename($name) { $name = Str::slug($name); if ($this->isFile()) { return $this->renameFile($name, $this->getMetaData()->getExtension()); } return $this->renameFolder($name); }
[ "public", "function", "rename", "(", "$", "name", ")", "{", "$", "name", "=", "Str", "::", "slug", "(", "$", "name", ")", ";", "if", "(", "$", "this", "->", "isFile", "(", ")", ")", "{", "return", "$", "this", "->", "renameFile", "(", "$", "nam...
Rename blob. @param string $name @return File|Folder
[ "Rename", "blob", "." ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L101-L109
225,984
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.delete
public function delete() { $meta = $this->getMetaData(); if ($meta->isImage() || !$meta->isFile()) { $service = new ThumbService($this->package); $service->delete($meta->getPath(), !$meta->isFile()); } if ($meta->isFile()) { return $this->storage...
php
public function delete() { $meta = $this->getMetaData(); if ($meta->isImage() || !$meta->isFile()) { $service = new ThumbService($this->package); $service->delete($meta->getPath(), !$meta->isFile()); } if ($meta->isFile()) { return $this->storage...
[ "public", "function", "delete", "(", ")", "{", "$", "meta", "=", "$", "this", "->", "getMetaData", "(", ")", ";", "if", "(", "$", "meta", "->", "isImage", "(", ")", "||", "!", "$", "meta", "->", "isFile", "(", ")", ")", "{", "$", "service", "="...
Delete blob from storage. @return bool
[ "Delete", "blob", "from", "storage", "." ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L115-L129
225,985
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.folderContent
public function folderContent() { $result = []; $path = $this->ensureUserPath($this->blob->path); $list = collect($this->storage->getDriver()->listContents($path)) ->pluck('path'); $exclude = (new ThumbService($this->package))->getSizes()->all(); $isExcluded = f...
php
public function folderContent() { $result = []; $path = $this->ensureUserPath($this->blob->path); $list = collect($this->storage->getDriver()->listContents($path)) ->pluck('path'); $exclude = (new ThumbService($this->package))->getSizes()->all(); $isExcluded = f...
[ "public", "function", "folderContent", "(", ")", "{", "$", "result", "=", "[", "]", ";", "$", "path", "=", "$", "this", "->", "ensureUserPath", "(", "$", "this", "->", "blob", "->", "path", ")", ";", "$", "list", "=", "collect", "(", "$", "this", ...
Fetch folder content of the storage directory. @return array
[ "Fetch", "folder", "content", "of", "the", "storage", "directory", "." ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L168-L198
225,986
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.blobExists
public function blobExists() { if ($this->blob->path . '' === '') { return true; } return $this->storage->exists($this->blob->path); }
php
public function blobExists() { if ($this->blob->path . '' === '') { return true; } return $this->storage->exists($this->blob->path); }
[ "public", "function", "blobExists", "(", ")", "{", "if", "(", "$", "this", "->", "blob", "->", "path", ".", "''", "===", "''", ")", "{", "return", "true", ";", "}", "return", "$", "this", "->", "storage", "->", "exists", "(", "$", "this", "->", "...
Determines is current blob path is existing in storage. @return bool
[ "Determines", "is", "current", "blob", "path", "is", "existing", "in", "storage", "." ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L215-L222
225,987
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.isFile
public function isFile() { if ($this->blobExists()) { $metadata = $this->storage->getMetaData($this->blob->path); return $metadata['type'] === 'file'; } return false; }
php
public function isFile() { if ($this->blobExists()) { $metadata = $this->storage->getMetaData($this->blob->path); return $metadata['type'] === 'file'; } return false; }
[ "public", "function", "isFile", "(", ")", "{", "if", "(", "$", "this", "->", "blobExists", "(", ")", ")", "{", "$", "metadata", "=", "$", "this", "->", "storage", "->", "getMetaData", "(", "$", "this", "->", "blob", "->", "path", ")", ";", "return"...
Determines is the current blob of file type. @return bool
[ "Determines", "is", "the", "current", "blob", "of", "file", "type", "." ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L228-L237
225,988
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.fileMimeType
public function fileMimeType() { try { $mimeType = $this->storage->mimeType($this->blob->path); } catch (\Exception $ex) { $ext = pathinfo($this->blob->path, PATHINFO_EXTENSION); $mimeType = BlobMetadata::guessMimeType($ext, !!$ext); } return $mim...
php
public function fileMimeType() { try { $mimeType = $this->storage->mimeType($this->blob->path); } catch (\Exception $ex) { $ext = pathinfo($this->blob->path, PATHINFO_EXTENSION); $mimeType = BlobMetadata::guessMimeType($ext, !!$ext); } return $mim...
[ "public", "function", "fileMimeType", "(", ")", "{", "try", "{", "$", "mimeType", "=", "$", "this", "->", "storage", "->", "mimeType", "(", "$", "this", "->", "blob", "->", "path", ")", ";", "}", "catch", "(", "\\", "Exception", "$", "ex", ")", "{"...
Get file mime type. @return string
[ "Get", "file", "mime", "type", "." ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L243-L253
225,989
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.isSafe
public function isSafe($ext, $mime) { $unsafeExtensions = $this->package->config('block.extensions'); $unsafeMimes = $this->package->config('block.mimetypes'); $mimeSearch = function ($mimeValue) use ($mime) { return preg_match($mimeValue, $mime); }; if (in_array...
php
public function isSafe($ext, $mime) { $unsafeExtensions = $this->package->config('block.extensions'); $unsafeMimes = $this->package->config('block.mimetypes'); $mimeSearch = function ($mimeValue) use ($mime) { return preg_match($mimeValue, $mime); }; if (in_array...
[ "public", "function", "isSafe", "(", "$", "ext", ",", "$", "mime", ")", "{", "$", "unsafeExtensions", "=", "$", "this", "->", "package", "->", "config", "(", "'block.extensions'", ")", ";", "$", "unsafeMimes", "=", "$", "this", "->", "package", "->", "...
Determines is the file safe for upload. @param string $ext @param string $mime @return bool
[ "Determines", "is", "the", "file", "safe", "for", "upload", "." ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L261-L278
225,990
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.getMetaData
public function getMetaData() { if (!$this->metadata) { $this->metadata = (new BlobMetadata())->init($this->blob->path); } return $this->metadata; }
php
public function getMetaData() { if (!$this->metadata) { $this->metadata = (new BlobMetadata())->init($this->blob->path); } return $this->metadata; }
[ "public", "function", "getMetaData", "(", ")", "{", "if", "(", "!", "$", "this", "->", "metadata", ")", "{", "$", "this", "->", "metadata", "=", "(", "new", "BlobMetadata", "(", ")", ")", "->", "init", "(", "$", "this", "->", "blob", "->", "path", ...
Get blob meta data object. @return BlobMetadata
[ "Get", "blob", "meta", "data", "object", "." ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L284-L291
225,991
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.fullDetails
public function fullDetails($reset = false) { return (new Blob($this->package)) ->setPath($this->blob->path) ->fullDetails($reset ? null : $this->getMetaData()); }
php
public function fullDetails($reset = false) { return (new Blob($this->package)) ->setPath($this->blob->path) ->fullDetails($reset ? null : $this->getMetaData()); }
[ "public", "function", "fullDetails", "(", "$", "reset", "=", "false", ")", "{", "return", "(", "new", "Blob", "(", "$", "this", "->", "package", ")", ")", "->", "setPath", "(", "$", "this", "->", "blob", "->", "path", ")", "->", "fullDetails", "(", ...
Get full details of the current blob. @param bool $reset @return File|Folder
[ "Get", "full", "details", "of", "the", "current", "blob", "." ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L298-L303
225,992
crip-laravel/filesys
src/Services/FilesysManager.php
FilesysManager.ensureUserPath
private function ensureUserPath(string $path): string { $userFolder = Str::normalizePath($this->package->config('user_folder')); if ($userFolder === '') { return $path; } if (starts_with($path, $userFolder)) { return $path; } return $userFold...
php
private function ensureUserPath(string $path): string { $userFolder = Str::normalizePath($this->package->config('user_folder')); if ($userFolder === '') { return $path; } if (starts_with($path, $userFolder)) { return $path; } return $userFold...
[ "private", "function", "ensureUserPath", "(", "string", "$", "path", ")", ":", "string", "{", "$", "userFolder", "=", "Str", "::", "normalizePath", "(", "$", "this", "->", "package", "->", "config", "(", "'user_folder'", ")", ")", ";", "if", "(", "$", ...
Ensure that path contains prefix of user path; @param string $path @return string
[ "Ensure", "that", "path", "contains", "prefix", "of", "user", "path", ";" ]
43c66929a5a16772dbb3bae4b5188bdc10b6f9ec
https://github.com/crip-laravel/filesys/blob/43c66929a5a16772dbb3bae4b5188bdc10b6f9ec/src/Services/FilesysManager.php#L369-L381
225,993
Techworker/ssml
src/Element/Custom.php
Custom.factory
public static function factory(string $name, array $attributes = []): Custom { $instance = new static(); $instance->name = $name; $instance->customAttributes = $attributes; return $instance; }
php
public static function factory(string $name, array $attributes = []): Custom { $instance = new static(); $instance->name = $name; $instance->customAttributes = $attributes; return $instance; }
[ "public", "static", "function", "factory", "(", "string", "$", "name", ",", "array", "$", "attributes", "=", "[", "]", ")", ":", "Custom", "{", "$", "instance", "=", "new", "static", "(", ")", ";", "$", "instance", "->", "name", "=", "$", "name", "...
Creates a custom element with the given name and attributes. @param string $name The name of the element. @param array $attributes The attributes [key => value] @return Custom
[ "Creates", "a", "custom", "element", "with", "the", "given", "name", "and", "attributes", "." ]
cafb979b777480baf7a01b5db2bf7c2cff837805
https://github.com/Techworker/ssml/blob/cafb979b777480baf7a01b5db2bf7c2cff837805/src/Element/Custom.php#L37-L44
225,994
jagilpe/encryption-bundle
Crypt/CryptographyProvider.php
CryptographyProvider.getCipherMethod
private function getCipherMethod($encType = CryptographyProviderInterface::PROPERTY_ENCRYPTION) { $method = $this->settings['cipher_method'][$encType]; $supportedMethods = openssl_get_cipher_methods(); if (!in_array($method, $supportedMethods)) { throw new EncryptionException('M...
php
private function getCipherMethod($encType = CryptographyProviderInterface::PROPERTY_ENCRYPTION) { $method = $this->settings['cipher_method'][$encType]; $supportedMethods = openssl_get_cipher_methods(); if (!in_array($method, $supportedMethods)) { throw new EncryptionException('M...
[ "private", "function", "getCipherMethod", "(", "$", "encType", "=", "CryptographyProviderInterface", "::", "PROPERTY_ENCRYPTION", ")", "{", "$", "method", "=", "$", "this", "->", "settings", "[", "'cipher_method'", "]", "[", "$", "encType", "]", ";", "$", "sup...
Returns the cipher method corresponding to a determined element type @param string $encType @return string @throws EncryptionException
[ "Returns", "the", "cipher", "method", "corresponding", "to", "a", "determined", "element", "type" ]
1e1ba13a3cc646b36e3407822f2e8339c5671f47
https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/CryptographyProvider.php#L134-L144
225,995
jagilpe/encryption-bundle
Crypt/CryptographyProvider.php
CryptographyProvider.getSymmetricKeyLength
private function getSymmetricKeyLength($encType = CryptographyProviderInterface::PROPERTY_ENCRYPTION) { $cipherMethod = $this->getCipherMethod($encType); switch ($cipherMethod) { case 'AES-128-CBC': $length = 16; break; case 'AES-192-CBC': ...
php
private function getSymmetricKeyLength($encType = CryptographyProviderInterface::PROPERTY_ENCRYPTION) { $cipherMethod = $this->getCipherMethod($encType); switch ($cipherMethod) { case 'AES-128-CBC': $length = 16; break; case 'AES-192-CBC': ...
[ "private", "function", "getSymmetricKeyLength", "(", "$", "encType", "=", "CryptographyProviderInterface", "::", "PROPERTY_ENCRYPTION", ")", "{", "$", "cipherMethod", "=", "$", "this", "->", "getCipherMethod", "(", "$", "encType", ")", ";", "switch", "(", "$", "...
Returns the key length for the desired encryption method @param string $encType @return integer
[ "Returns", "the", "key", "length", "for", "the", "desired", "encryption", "method" ]
1e1ba13a3cc646b36e3407822f2e8339c5671f47
https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/CryptographyProvider.php#L153-L173
225,996
jagilpe/encryption-bundle
Crypt/CryptographyProvider.php
CryptographyProvider.getEncryptionOptions
private function getEncryptionOptions($encType = CryptographyProviderInterface::PROPERTY_ENCRYPTION) { switch ($encType) { case CryptographyProviderInterface::PROPERTY_ENCRYPTION: case CryptographyProviderInterface::PRIVATE_KEY_ENCRYPTION: return 0; case C...
php
private function getEncryptionOptions($encType = CryptographyProviderInterface::PROPERTY_ENCRYPTION) { switch ($encType) { case CryptographyProviderInterface::PROPERTY_ENCRYPTION: case CryptographyProviderInterface::PRIVATE_KEY_ENCRYPTION: return 0; case C...
[ "private", "function", "getEncryptionOptions", "(", "$", "encType", "=", "CryptographyProviderInterface", "::", "PROPERTY_ENCRYPTION", ")", "{", "switch", "(", "$", "encType", ")", "{", "case", "CryptographyProviderInterface", "::", "PROPERTY_ENCRYPTION", ":", "case", ...
Returns the options for the encryption depending on the encryption type @param string $encType @return int @throws EncryptionException
[ "Returns", "the", "options", "for", "the", "encryption", "depending", "on", "the", "encryption", "type" ]
1e1ba13a3cc646b36e3407822f2e8339c5671f47
https://github.com/jagilpe/encryption-bundle/blob/1e1ba13a3cc646b36e3407822f2e8339c5671f47/Crypt/CryptographyProvider.php#L182-L193
225,997
CallFire/CallFire-PHP-SDK
src/CallFire/Api/Rest/AbstractClient.php
AbstractClient.response
public static function response($data, $type = self::FORMAT_XML) { if (is_string($data) && strlen($data) === 0) { return true; // Many operations return an empty string for success } switch ($type) { case static::FORMAT_XML: return AbstractResponse::fr...
php
public static function response($data, $type = self::FORMAT_XML) { if (is_string($data) && strlen($data) === 0) { return true; // Many operations return an empty string for success } switch ($type) { case static::FORMAT_XML: return AbstractResponse::fr...
[ "public", "static", "function", "response", "(", "$", "data", ",", "$", "type", "=", "self", "::", "FORMAT_XML", ")", "{", "if", "(", "is_string", "(", "$", "data", ")", "&&", "strlen", "(", "$", "data", ")", "===", "0", ")", "{", "return", "true",...
Parse a response into a response type @static @param string $data Response data to be parsed @param string $type = 'xml' Response format @return mixed Response object
[ "Parse", "a", "response", "into", "a", "response", "type" ]
7d6d3e1c59d4116e4fadaf57851a2fa127a13f65
https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/AbstractClient.php#L52-L64
225,998
CallFire/CallFire-PHP-SDK
src/CallFire/Api/Rest/AbstractClient.php
AbstractClient.get
public function get($uri, AbstractRequest $request = null) { $http = $this->getHttpClone(); if ($request) { $requestUri = $this->buildQuery($uri, $request->getQuery()); } else { $requestUri = $uri; } $http->setOption(CURLOPT_URL, $requestUri); ...
php
public function get($uri, AbstractRequest $request = null) { $http = $this->getHttpClone(); if ($request) { $requestUri = $this->buildQuery($uri, $request->getQuery()); } else { $requestUri = $uri; } $http->setOption(CURLOPT_URL, $requestUri); ...
[ "public", "function", "get", "(", "$", "uri", ",", "AbstractRequest", "$", "request", "=", "null", ")", "{", "$", "http", "=", "$", "this", "->", "getHttpClone", "(", ")", ";", "if", "(", "$", "request", ")", "{", "$", "requestUri", "=", "$", "this...
Execute a GET request against an API endpoint, optionally with a given Request object as parameters @param string $uri Endpoint URL @param AbstractRequest $request = null Request object for parameters @return string Response data
[ "Execute", "a", "GET", "request", "against", "an", "API", "endpoint", "optionally", "with", "a", "given", "Request", "object", "as", "parameters" ]
7d6d3e1c59d4116e4fadaf57851a2fa127a13f65
https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/AbstractClient.php#L74-L87
225,999
CallFire/CallFire-PHP-SDK
src/CallFire/Api/Rest/AbstractClient.php
AbstractClient.post
public function post($uri, AbstractRequest $request = null) { $http = $this->getHttpClone(); $http->setOption(CURLOPT_POST, true); $http->setOption(CURLOPT_URL, $uri); if ($request) { $http->setOption(CURLOPT_POSTFIELDS, $this->buildPostData($request->getQuery())); ...
php
public function post($uri, AbstractRequest $request = null) { $http = $this->getHttpClone(); $http->setOption(CURLOPT_POST, true); $http->setOption(CURLOPT_URL, $uri); if ($request) { $http->setOption(CURLOPT_POSTFIELDS, $this->buildPostData($request->getQuery())); ...
[ "public", "function", "post", "(", "$", "uri", ",", "AbstractRequest", "$", "request", "=", "null", ")", "{", "$", "http", "=", "$", "this", "->", "getHttpClone", "(", ")", ";", "$", "http", "->", "setOption", "(", "CURLOPT_POST", ",", "true", ")", "...
Execute a POST request against an API endpoint, optionally with a given Request object as parameters @param string $uri Endpoint URL @param AbstractRequest $request = null Request object for parameters @return string Response data
[ "Execute", "a", "POST", "request", "against", "an", "API", "endpoint", "optionally", "with", "a", "given", "Request", "object", "as", "parameters" ]
7d6d3e1c59d4116e4fadaf57851a2fa127a13f65
https://github.com/CallFire/CallFire-PHP-SDK/blob/7d6d3e1c59d4116e4fadaf57851a2fa127a13f65/src/CallFire/Api/Rest/AbstractClient.php#L97-L108