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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8,200 | sebastianmonzel/webfiles-framework-php | source/core/datasystem/file/system/MDirectory.php | MDirectory.createSubDirectoryIfNotExists | public function createSubDirectoryIfNotExists($p_sName)
{
$subdirectoryPath = $this->m_sPath . "/" . $p_sName;
$subdirectory = new MDirectory($subdirectoryPath);
if (!$subdirectory->exists()) {
mkdir($subdirectoryPath);
}
return $subdirectory;
... | php | public function createSubDirectoryIfNotExists($p_sName)
{
$subdirectoryPath = $this->m_sPath . "/" . $p_sName;
$subdirectory = new MDirectory($subdirectoryPath);
if (!$subdirectory->exists()) {
mkdir($subdirectoryPath);
}
return $subdirectory;
... | [
"public",
"function",
"createSubDirectoryIfNotExists",
"(",
"$",
"p_sName",
")",
"{",
"$",
"subdirectoryPath",
"=",
"$",
"this",
"->",
"m_sPath",
".",
"\"/\"",
".",
"$",
"p_sName",
";",
"$",
"subdirectory",
"=",
"new",
"MDirectory",
"(",
"$",
"subdirectoryPath... | Creates a subdirectory in the present directory.
@param $p_sName
@return MDirectory | [
"Creates",
"a",
"subdirectory",
"in",
"the",
"present",
"directory",
"."
] | 5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d | https://github.com/sebastianmonzel/webfiles-framework-php/blob/5ac1fc99e8e9946080e3ba877b2320cd6a3e5b5d/source/core/datasystem/file/system/MDirectory.php#L125-L137 |
8,201 | khalyomede/matcha | src/Style/Expect.php | Expect.equalTo | public function equalTo($expected): Expect {
$this->testsTheEqualityAgainstAValue = true;
$this->expected = $expected;
return $this;
} | php | public function equalTo($expected): Expect {
$this->testsTheEqualityAgainstAValue = true;
$this->expected = $expected;
return $this;
} | [
"public",
"function",
"equalTo",
"(",
"$",
"expected",
")",
":",
"Expect",
"{",
"$",
"this",
"->",
"testsTheEqualityAgainstAValue",
"=",
"true",
";",
"$",
"this",
"->",
"expected",
"=",
"$",
"expected",
";",
"return",
"$",
"this",
";",
"}"
] | Asserts that we are testing an equality
against a particular value. | [
"Asserts",
"that",
"we",
"are",
"testing",
"an",
"equality",
"against",
"a",
"particular",
"value",
"."
] | 4bdbe0e90e13fd458694f04a2e3aeef941af7cec | https://github.com/khalyomede/matcha/blob/4bdbe0e90e13fd458694f04a2e3aeef941af7cec/src/Style/Expect.php#L145-L150 |
8,202 | Celarius/nofuzz-framework | src/Database/Drivers/Pdo/Pgsql.php | Pgsql.getDsn | public function getDsn(): string
{
// pgsql:host=<hostname>;port=26257;dbname=bank;sslmode=disable
# Build the DSN
$_dsn = $this->getDriver().':' .
'host=' . $this->GetHost().';' .
'port=' . ($this->GetPort()!=0 ? $this->GetPort() . ':' : '26257' ) .
'dbname=' . $thi... | php | public function getDsn(): string
{
// pgsql:host=<hostname>;port=26257;dbname=bank;sslmode=disable
# Build the DSN
$_dsn = $this->getDriver().':' .
'host=' . $this->GetHost().';' .
'port=' . ($this->GetPort()!=0 ? $this->GetPort() . ':' : '26257' ) .
'dbname=' . $thi... | [
"public",
"function",
"getDsn",
"(",
")",
":",
"string",
"{",
"// pgsql:host=<hostname>;port=26257;dbname=bank;sslmode=disable",
"# Build the DSN",
"$",
"_dsn",
"=",
"$",
"this",
"->",
"getDriver",
"(",
")",
".",
"':'",
".",
"'host='",
".",
"$",
"this",
"->",
"G... | Get DSN - CockraochDb formatting
@return string [description] | [
"Get",
"DSN",
"-",
"CockraochDb",
"formatting"
] | 867c5150baa431e8f800624a26ba80e95eebd4e5 | https://github.com/Celarius/nofuzz-framework/blob/867c5150baa431e8f800624a26ba80e95eebd4e5/src/Database/Drivers/Pdo/Pgsql.php#L58-L73 |
8,203 | EarthlingInteractive/PHPCMIPREST | lib/EarthIT/CMIPREST/RESTer.php | EarthIT_CMIPREST_RESTer.validateSimpleAction | protected function validateSimpleAction( EarthIT_CMIPREST_RESTAction $act ) {
if( $act instanceof EarthIT_CMIPREST_RESTAction_ResourceAction ) {
$rc = $act->getResourceClass();
if( !$rc->hasRestService() ) {
throw new EarthIT_CMIPREST_ResourceNotExposedViaService($act, array('message'=>"'".$rc->getName()."'... | php | protected function validateSimpleAction( EarthIT_CMIPREST_RESTAction $act ) {
if( $act instanceof EarthIT_CMIPREST_RESTAction_ResourceAction ) {
$rc = $act->getResourceClass();
if( !$rc->hasRestService() ) {
throw new EarthIT_CMIPREST_ResourceNotExposedViaService($act, array('message'=>"'".$rc->getName()."'... | [
"protected",
"function",
"validateSimpleAction",
"(",
"EarthIT_CMIPREST_RESTAction",
"$",
"act",
")",
"{",
"if",
"(",
"$",
"act",
"instanceof",
"EarthIT_CMIPREST_RESTAction_ResourceAction",
")",
"{",
"$",
"rc",
"=",
"$",
"act",
"->",
"getResourceClass",
"(",
")",
... | Ensure that the given action is structurally valid so that
assumptions made while authorizing hold true.
Will throw an exception otherwise.
@overridable | [
"Ensure",
"that",
"the",
"given",
"action",
"is",
"structurally",
"valid",
"so",
"that",
"assumptions",
"made",
"while",
"authorizing",
"hold",
"true",
".",
"Will",
"throw",
"an",
"exception",
"otherwise",
"."
] | db0398ea4fc07fa62f2de9ba43f2f3137170d9f0 | https://github.com/EarthlingInteractive/PHPCMIPREST/blob/db0398ea4fc07fa62f2de9ba43f2f3137170d9f0/lib/EarthIT/CMIPREST/RESTer.php#L64-L78 |
8,204 | EarthlingInteractive/PHPCMIPREST | lib/EarthIT/CMIPREST/RESTer.php | EarthIT_CMIPREST_RESTer.assembleSimpleResult | protected function assembleSimpleResult($act, $rc, array $items, $ctx) {
$assembler = $act->getResultAssembler();
if( $assembler === null ) {
throw new Exception("No result assembler specified by ".get_class($act));
}
return $assembler->assembleResult(
new EarthIT_CMIPREST_StorageResult($rc, array('roo... | php | protected function assembleSimpleResult($act, $rc, array $items, $ctx) {
$assembler = $act->getResultAssembler();
if( $assembler === null ) {
throw new Exception("No result assembler specified by ".get_class($act));
}
return $assembler->assembleResult(
new EarthIT_CMIPREST_StorageResult($rc, array('roo... | [
"protected",
"function",
"assembleSimpleResult",
"(",
"$",
"act",
",",
"$",
"rc",
",",
"array",
"$",
"items",
",",
"$",
"ctx",
")",
"{",
"$",
"assembler",
"=",
"$",
"act",
"->",
"getResultAssembler",
"(",
")",
";",
"if",
"(",
"$",
"assembler",
"===",
... | Assemble results with no johns. i.e. a simple collection of one type of objects | [
"Assemble",
"results",
"with",
"no",
"johns",
".",
"i",
".",
"e",
".",
"a",
"simple",
"collection",
"of",
"one",
"type",
"of",
"objects"
] | db0398ea4fc07fa62f2de9ba43f2f3137170d9f0 | https://github.com/EarthlingInteractive/PHPCMIPREST/blob/db0398ea4fc07fa62f2de9ba43f2f3137170d9f0/lib/EarthIT/CMIPREST/RESTer.php#L144-L153 |
8,205 | HouseOfAgile/dacorp-extra-bundle | Controller/PictureController.php | PictureController.uploadFormAction | public function uploadFormAction(Request $request)
{
// create task object and form
$userId = ($this->getUser() != null) ? $this->getUser()->getId() : rand();
$partner = ($this->getUser() != null) ? $this->getUser()->getPartner() : null;
/* @var $picture Picture */
$smDatas ... | php | public function uploadFormAction(Request $request)
{
// create task object and form
$userId = ($this->getUser() != null) ? $this->getUser()->getId() : rand();
$partner = ($this->getUser() != null) ? $this->getUser()->getPartner() : null;
/* @var $picture Picture */
$smDatas ... | [
"public",
"function",
"uploadFormAction",
"(",
"Request",
"$",
"request",
")",
"{",
"// create task object and form",
"$",
"userId",
"=",
"(",
"$",
"this",
"->",
"getUser",
"(",
")",
"!=",
"null",
")",
"?",
"$",
"this",
"->",
"getUser",
"(",
")",
"->",
"... | Simple action for form Upload rendering
@param Request $request
@return array
@Template("DacorpExtraBundle:Form:pictureUploadForm.html.twig") | [
"Simple",
"action",
"for",
"form",
"Upload",
"rendering"
] | 99fe024791e7833058908a2e5544bde948031524 | https://github.com/HouseOfAgile/dacorp-extra-bundle/blob/99fe024791e7833058908a2e5544bde948031524/Controller/PictureController.php#L22-L43 |
8,206 | nirix/radium | src/EventDispatcher.php | EventDispatcher.addListener | public static function addListener($action, $callback)
{
// Make sure it's something callable
if (!is_callable($callback) && !is_array($callback)) {
throw new Exception("Invalid callback for [{$action}]");
}
if (!isset(static::$listeners[$action])) {
static::... | php | public static function addListener($action, $callback)
{
// Make sure it's something callable
if (!is_callable($callback) && !is_array($callback)) {
throw new Exception("Invalid callback for [{$action}]");
}
if (!isset(static::$listeners[$action])) {
static::... | [
"public",
"static",
"function",
"addListener",
"(",
"$",
"action",
",",
"$",
"callback",
")",
"{",
"// Make sure it's something callable",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callback",
")",
"&&",
"!",
"is_array",
"(",
"$",
"callback",
")",
")",
"{",
... | Add a listener to the action.
@param string $action
@param array|callable $callback | [
"Add",
"a",
"listener",
"to",
"the",
"action",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/EventDispatcher.php#L39-L51 |
8,207 | nirix/radium | src/EventDispatcher.php | EventDispatcher.dispatch | public static function dispatch($action, array $parameters = [])
{
if (isset(static::$listeners[$action])) {
foreach (static::$listeners[$action] as $callback) {
$response = call_user_func_array($callback, $parameters);
if ($response !== null) {
... | php | public static function dispatch($action, array $parameters = [])
{
if (isset(static::$listeners[$action])) {
foreach (static::$listeners[$action] as $callback) {
$response = call_user_func_array($callback, $parameters);
if ($response !== null) {
... | [
"public",
"static",
"function",
"dispatch",
"(",
"$",
"action",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"listeners",
"[",
"$",
"action",
"]",
")",
")",
"{",
"foreach",
"(",
"static",
"... | Dispatch the event name and pass the parameters to the callbacks.
@param string $action
@param array $parameters | [
"Dispatch",
"the",
"event",
"name",
"and",
"pass",
"the",
"parameters",
"to",
"the",
"callbacks",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/EventDispatcher.php#L59-L70 |
8,208 | SagittariusX/Beluga.Web | src/Beluga/Web/Http/Header.php | Header.SendContentType | public static function SendContentType( string $mimetype = 'text/html', string $charset = 'utf-8' )
{
if ( empty( $charset ) )
{
\header( 'Content-Type: ' . $mimetype );
}
else
{
\header( 'Content-Type: ' . $mimetype . '; charset=' . $charset );
}
} | php | public static function SendContentType( string $mimetype = 'text/html', string $charset = 'utf-8' )
{
if ( empty( $charset ) )
{
\header( 'Content-Type: ' . $mimetype );
}
else
{
\header( 'Content-Type: ' . $mimetype . '; charset=' . $charset );
}
} | [
"public",
"static",
"function",
"SendContentType",
"(",
"string",
"$",
"mimetype",
"=",
"'text/html'",
",",
"string",
"$",
"charset",
"=",
"'utf-8'",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"charset",
")",
")",
"{",
"\\",
"header",
"(",
"'Content-Type: '",... | Sends the defined Content-Type header with a optional chaset.
@param string $mimetype The MIME type.
@param string $charset The optional charset to send. (default='utf-8') | [
"Sends",
"the",
"defined",
"Content",
"-",
"Type",
"header",
"with",
"a",
"optional",
"chaset",
"."
] | 95d6094b2e536f5207291f6b3500028f34812b34 | https://github.com/SagittariusX/Beluga.Web/blob/95d6094b2e536f5207291f6b3500028f34812b34/src/Beluga/Web/Http/Header.php#L150-L162 |
8,209 | SagittariusX/Beluga.Web | src/Beluga/Web/Http/Header.php | Header.SendDownloadHeader | public static function SendDownloadHeader( string $file, int $filesize = null )
{
// Disable all caching mechanisms
\header( 'Expires: 0' );
\header( 'Cache-Control: private' );
\header( 'Pragma: cache' );
// The next header let the client download the file
\header( 'Content-Dis... | php | public static function SendDownloadHeader( string $file, int $filesize = null )
{
// Disable all caching mechanisms
\header( 'Expires: 0' );
\header( 'Cache-Control: private' );
\header( 'Pragma: cache' );
// The next header let the client download the file
\header( 'Content-Dis... | [
"public",
"static",
"function",
"SendDownloadHeader",
"(",
"string",
"$",
"file",
",",
"int",
"$",
"filesize",
"=",
"null",
")",
"{",
"// Disable all caching mechanisms",
"\\",
"header",
"(",
"'Expires: 0'",
")",
";",
"\\",
"header",
"(",
"'Cache-Control: private'... | Sends all HTTP headers required to sending a file download to current client.
Caching will be deactivated.
@param string $file Full path to download file. You can also use a file name, but if no file size is
defined the 'Content-Length' HTTP header is not send. (It means the client download
processbar can not sh... | [
"Sends",
"all",
"HTTP",
"headers",
"required",
"to",
"sending",
"a",
"file",
"download",
"to",
"current",
"client",
"."
] | 95d6094b2e536f5207291f6b3500028f34812b34 | https://github.com/SagittariusX/Beluga.Web/blob/95d6094b2e536f5207291f6b3500028f34812b34/src/Beluga/Web/Http/Header.php#L175-L201 |
8,210 | SagittariusX/Beluga.Web | src/Beluga/Web/Http/Header.php | Header.SendRedirect | public static function SendRedirect( $url, int $waitSeconds = 3, bool $exitHere = false )
{
\header( "refresh:{$waitSeconds};url={$url}" );
if ( $exitHere ) { exit; }
} | php | public static function SendRedirect( $url, int $waitSeconds = 3, bool $exitHere = false )
{
\header( "refresh:{$waitSeconds};url={$url}" );
if ( $exitHere ) { exit; }
} | [
"public",
"static",
"function",
"SendRedirect",
"(",
"$",
"url",
",",
"int",
"$",
"waitSeconds",
"=",
"3",
",",
"bool",
"$",
"exitHere",
"=",
"false",
")",
"{",
"\\",
"header",
"(",
"\"refresh:{$waitSeconds};url={$url}\"",
")",
";",
"if",
"(",
"$",
"exitHe... | Send a none standards conform refresh header. Most browser supports it, BUT THERE IS NO GUARANTEE that they
also handle it in newer releases!
@param string $url The redirection URL.
@param int $waitSeconds How many seconds should be waited before the redirect is executed? (default=3)
@param boolean $exitH... | [
"Send",
"a",
"none",
"standards",
"conform",
"refresh",
"header",
".",
"Most",
"browser",
"supports",
"it",
"BUT",
"THERE",
"IS",
"NO",
"GUARANTEE",
"that",
"they",
"also",
"handle",
"it",
"in",
"newer",
"releases!"
] | 95d6094b2e536f5207291f6b3500028f34812b34 | https://github.com/SagittariusX/Beluga.Web/blob/95d6094b2e536f5207291f6b3500028f34812b34/src/Beluga/Web/Http/Header.php#L211-L218 |
8,211 | SagittariusX/Beluga.Web | src/Beluga/Web/Http/Header.php | Header.SendLocation | public static function SendLocation( string $path, string $host = null, bool $exitHere = true )
{
if ( empty( $host ) || ! \is_string( $host ) )
{
if ( ! isset( $_SERVER[ 'HTTP_HOST' ] ) )
{
exit( 'Could not send a Location header if no host is defined!' );
}
... | php | public static function SendLocation( string $path, string $host = null, bool $exitHere = true )
{
if ( empty( $host ) || ! \is_string( $host ) )
{
if ( ! isset( $_SERVER[ 'HTTP_HOST' ] ) )
{
exit( 'Could not send a Location header if no host is defined!' );
}
... | [
"public",
"static",
"function",
"SendLocation",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"host",
"=",
"null",
",",
"bool",
"$",
"exitHere",
"=",
"true",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"host",
")",
"||",
"!",
"\\",
"is_string",
"(",
... | Sends a valid HTTP Location header for doing a redirect.
If you dont want to send some other HTTP headers after this header, DONT CHANGE the $exitHere parameter
to FALSE.
@param string $path e.g.: /test/probe.php (Must be a absolute URL path!)
@param string $host Optional host definition. If not defin... | [
"Sends",
"a",
"valid",
"HTTP",
"Location",
"header",
"for",
"doing",
"a",
"redirect",
"."
] | 95d6094b2e536f5207291f6b3500028f34812b34 | https://github.com/SagittariusX/Beluga.Web/blob/95d6094b2e536f5207291f6b3500028f34812b34/src/Beluga/Web/Http/Header.php#L230-L249 |
8,212 | SagittariusX/Beluga.Web | src/Beluga/Web/Http/Header.php | Header.SendMultipleChoice | public static function SendMultipleChoice( string $newLocation = null, bool $exitHere = false )
{
// Define the supported HTTP type
$pType = static::GetSupportedHttpVersion();
\header( "{$pType} 300 Multiple Choice" );
if ( !empty( $newLocation ) )
{
\header( "Location: {$ne... | php | public static function SendMultipleChoice( string $newLocation = null, bool $exitHere = false )
{
// Define the supported HTTP type
$pType = static::GetSupportedHttpVersion();
\header( "{$pType} 300 Multiple Choice" );
if ( !empty( $newLocation ) )
{
\header( "Location: {$ne... | [
"public",
"static",
"function",
"SendMultipleChoice",
"(",
"string",
"$",
"newLocation",
"=",
"null",
",",
"bool",
"$",
"exitHere",
"=",
"false",
")",
"{",
"// Define the supported HTTP type",
"$",
"pType",
"=",
"static",
"::",
"GetSupportedHttpVersion",
"(",
")",... | Sends a 300 Multiple Choice HTTP-Header.
The requested resource is available by different type. The answer should contains a list of the
accepted types. If $newLocation is set to a valid URL an location was send to the address of the server
preferred representation.
@param string $newLocation Optionally a absolute U... | [
"Sends",
"a",
"300",
"Multiple",
"Choice",
"HTTP",
"-",
"Header",
"."
] | 95d6094b2e536f5207291f6b3500028f34812b34 | https://github.com/SagittariusX/Beluga.Web/blob/95d6094b2e536f5207291f6b3500028f34812b34/src/Beluga/Web/Http/Header.php#L262-L281 |
8,213 | SagittariusX/Beluga.Web | src/Beluga/Web/Http/Header.php | Header.SendCacheControl | public static function SendCacheControl( bool $doCache = false, bool $mustRevalidate = true )
{
\header(
'Cache-Control: '
. ( $doCache ? 'cache' : 'no-cache' )
. ( $mustRevalidate ? ', must-revalidate' : '' )
);
} | php | public static function SendCacheControl( bool $doCache = false, bool $mustRevalidate = true )
{
\header(
'Cache-Control: '
. ( $doCache ? 'cache' : 'no-cache' )
. ( $mustRevalidate ? ', must-revalidate' : '' )
);
} | [
"public",
"static",
"function",
"SendCacheControl",
"(",
"bool",
"$",
"doCache",
"=",
"false",
",",
"bool",
"$",
"mustRevalidate",
"=",
"true",
")",
"{",
"\\",
"header",
"(",
"'Cache-Control: '",
".",
"(",
"$",
"doCache",
"?",
"'cache'",
":",
"'no-cache'",
... | Sends a "Cache-Control" HTTP header.
@param boolean $doCache Use caching?
@param boolean $mustRevalidate Should be checked on each request, if a used cache is valid? | [
"Sends",
"a",
"Cache",
"-",
"Control",
"HTTP",
"header",
"."
] | 95d6094b2e536f5207291f6b3500028f34812b34 | https://github.com/SagittariusX/Beluga.Web/blob/95d6094b2e536f5207291f6b3500028f34812b34/src/Beluga/Web/Http/Header.php#L422-L431 |
8,214 | SagittariusX/Beluga.Web | src/Beluga/Web/Http/Header.php | Header.SendExpires | public static function SendExpires( $expireStamp = null )
{
if ( \is_null( $expireStamp ) || empty( $expireStamp ) )
{
$expireStamp = \time();
}
if ( \is_int( $expireStamp ) )
{
\header( 'Expires: ' . \date( 'D, d M Y H:i:s O', $expireStamp ) );
}
else if... | php | public static function SendExpires( $expireStamp = null )
{
if ( \is_null( $expireStamp ) || empty( $expireStamp ) )
{
$expireStamp = \time();
}
if ( \is_int( $expireStamp ) )
{
\header( 'Expires: ' . \date( 'D, d M Y H:i:s O', $expireStamp ) );
}
else if... | [
"public",
"static",
"function",
"SendExpires",
"(",
"$",
"expireStamp",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"expireStamp",
")",
"||",
"empty",
"(",
"$",
"expireStamp",
")",
")",
"{",
"$",
"expireStamp",
"=",
"\\",
"time",
"(",
... | Sends a "Expires" HTTP header.
@param int|\DateTimeInterface|string $expireStamp Optional Timestamp | [
"Sends",
"a",
"Expires",
"HTTP",
"header",
"."
] | 95d6094b2e536f5207291f6b3500028f34812b34 | https://github.com/SagittariusX/Beluga.Web/blob/95d6094b2e536f5207291f6b3500028f34812b34/src/Beluga/Web/Http/Header.php#L438-L467 |
8,215 | jmpantoja/planb-utils | src/Utils/Options/Exception/UndefinedProfileException.php | UndefinedProfileException.forProfile | public static function forProfile(string $name, ?\Throwable $previous = null): self
{
$example = self::getExample($name);
$message = sprintf("Undefined profile: %s\n%s", $name, $example);
return new static($message, $previous);
} | php | public static function forProfile(string $name, ?\Throwable $previous = null): self
{
$example = self::getExample($name);
$message = sprintf("Undefined profile: %s\n%s", $name, $example);
return new static($message, $previous);
} | [
"public",
"static",
"function",
"forProfile",
"(",
"string",
"$",
"name",
",",
"?",
"\\",
"Throwable",
"$",
"previous",
"=",
"null",
")",
":",
"self",
"{",
"$",
"example",
"=",
"self",
"::",
"getExample",
"(",
"$",
"name",
")",
";",
"$",
"message",
"... | Crea una instancia, con un mensae que indica que el perfil indicado no existe
@param string $name
@param null|\Throwable $previous
@return \PlanB\Utils\Options\Exception\UndefinedProfileException | [
"Crea",
"una",
"instancia",
"con",
"un",
"mensae",
"que",
"indica",
"que",
"el",
"perfil",
"indicado",
"no",
"existe"
] | d17fbced4a285275928f8428ee56e269eb851690 | https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Utils/Options/Exception/UndefinedProfileException.php#L42-L49 |
8,216 | sgtlambda/jvwp | src/common/Post.php | Post.findByExactMeta | public static function findByExactMeta ($meta_key, $meta_value, $post_type = PostTypes::ANY)
{
return get_posts(array(
'post_type' => $post_type,
'meta_key' => $meta_key,
'meta_value' => $meta_value
));
} | php | public static function findByExactMeta ($meta_key, $meta_value, $post_type = PostTypes::ANY)
{
return get_posts(array(
'post_type' => $post_type,
'meta_key' => $meta_key,
'meta_value' => $meta_value
));
} | [
"public",
"static",
"function",
"findByExactMeta",
"(",
"$",
"meta_key",
",",
"$",
"meta_value",
",",
"$",
"post_type",
"=",
"PostTypes",
"::",
"ANY",
")",
"{",
"return",
"get_posts",
"(",
"array",
"(",
"'post_type'",
"=>",
"$",
"post_type",
",",
"'meta_key'... | Finds one or more pages by exactly matching the meta value
@param string $meta_key
@param string $meta_value
@param string $post_type
@return \WP_Post[] | [
"Finds",
"one",
"or",
"more",
"pages",
"by",
"exactly",
"matching",
"the",
"meta",
"value"
] | 85dba59281216ccb9cff580d26063d304350bbe0 | https://github.com/sgtlambda/jvwp/blob/85dba59281216ccb9cff580d26063d304350bbe0/src/common/Post.php#L25-L32 |
8,217 | judus/minimal-minimal | src/Apps/Maximal/MaximalApplication.php | MaximalApplication.container | public function container($name)
{
if (!isset($this->container[$name])) {
$this->container[$name] = IOC::resolve($name);
}
return $this->container[$name];
} | php | public function container($name)
{
if (!isset($this->container[$name])) {
$this->container[$name] = IOC::resolve($name);
}
return $this->container[$name];
} | [
"public",
"function",
"container",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"container",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"container",
"[",
"$",
"name",
"]",
"=",
"IOC",
"::",
"resolve",... | Gets an object from the container
Resolves it through IOC if that didn't happen yet
@param $name
@return mixed | [
"Gets",
"an",
"object",
"from",
"the",
"container",
"Resolves",
"it",
"through",
"IOC",
"if",
"that",
"didn",
"t",
"happen",
"yet"
] | 36db55c537175cead2ab412f166bf2574d0f9597 | https://github.com/judus/minimal-minimal/blob/36db55c537175cead2ab412f166bf2574d0f9597/src/Apps/Maximal/MaximalApplication.php#L112-L119 |
8,218 | judus/minimal-minimal | src/Apps/Maximal/MaximalApplication.php | MaximalApplication.load | public function load(array $files = null) : ApplicationInterface
{
$this->callLoad($files) || parent::load($files);
return $this;
} | php | public function load(array $files = null) : ApplicationInterface
{
$this->callLoad($files) || parent::load($files);
return $this;
} | [
"public",
"function",
"load",
"(",
"array",
"$",
"files",
"=",
"null",
")",
":",
"ApplicationInterface",
"{",
"$",
"this",
"->",
"callLoad",
"(",
"$",
"files",
")",
"||",
"parent",
"::",
"load",
"(",
"$",
"files",
")",
";",
"return",
"$",
"this",
";"... | Dispatch load event
@param array|null $files
@return ApplicationInterface | [
"Dispatch",
"load",
"event"
] | 36db55c537175cead2ab412f166bf2574d0f9597 | https://github.com/judus/minimal-minimal/blob/36db55c537175cead2ab412f166bf2574d0f9597/src/Apps/Maximal/MaximalApplication.php#L145-L150 |
8,219 | judus/minimal-minimal | src/Apps/Maximal/MaximalApplication.php | MaximalApplication.execute | public function execute(string $uri = null): ApplicationInterface
{
$this->callExecute($uri) || parent::execute($uri);
return $this;
} | php | public function execute(string $uri = null): ApplicationInterface
{
$this->callExecute($uri) || parent::execute($uri);
return $this;
} | [
"public",
"function",
"execute",
"(",
"string",
"$",
"uri",
"=",
"null",
")",
":",
"ApplicationInterface",
"{",
"$",
"this",
"->",
"callExecute",
"(",
"$",
"uri",
")",
"||",
"parent",
"::",
"execute",
"(",
"$",
"uri",
")",
";",
"return",
"$",
"this",
... | Dispatch execute event
@param string|null $uri
@return ApplicationInterface | [
"Dispatch",
"execute",
"event"
] | 36db55c537175cead2ab412f166bf2574d0f9597 | https://github.com/judus/minimal-minimal/blob/36db55c537175cead2ab412f166bf2574d0f9597/src/Apps/Maximal/MaximalApplication.php#L159-L164 |
8,220 | netcore/module-category | Http/Controllers/Admin/CategoryController.php | CategoryController.store | public function store(CategoryGroup $categoryGroup, CategoryRequest $request): JsonResponse
{
$category = $categoryGroup->categories()->create(
$request->only('icon')
);
foreach ($request->file('icons', []) as $key => $file) {
if ($categoryGroup->hasFileIcon($key) &&... | php | public function store(CategoryGroup $categoryGroup, CategoryRequest $request): JsonResponse
{
$category = $categoryGroup->categories()->create(
$request->only('icon')
);
foreach ($request->file('icons', []) as $key => $file) {
if ($categoryGroup->hasFileIcon($key) &&... | [
"public",
"function",
"store",
"(",
"CategoryGroup",
"$",
"categoryGroup",
",",
"CategoryRequest",
"$",
"request",
")",
":",
"JsonResponse",
"{",
"$",
"category",
"=",
"$",
"categoryGroup",
"->",
"categories",
"(",
")",
"->",
"create",
"(",
"$",
"request",
"... | Store category in the database.
@param \Modules\Category\Models\CategoryGroup $categoryGroup
@param \Modules\Category\Http\Requests\CategoryRequest $request
@return \Illuminate\Http\JsonResponse | [
"Store",
"category",
"in",
"the",
"database",
"."
] | 61a4fc2525774f8ddea730ad9f6f06644552adf7 | https://github.com/netcore/module-category/blob/61a4fc2525774f8ddea730ad9f6f06644552adf7/Http/Controllers/Admin/CategoryController.php#L51-L85 |
8,221 | netcore/module-category | Http/Controllers/Admin/CategoryController.php | CategoryController.update | public function update(CategoryRequest $request, CategoryGroup $categoryGroup, Category $category): JsonResponse
{
if ($category->category_group_id !== $categoryGroup->id) {
abort(404);
}
$category->update(
$request->only('icon')
);
foreach ($request... | php | public function update(CategoryRequest $request, CategoryGroup $categoryGroup, Category $category): JsonResponse
{
if ($category->category_group_id !== $categoryGroup->id) {
abort(404);
}
$category->update(
$request->only('icon')
);
foreach ($request... | [
"public",
"function",
"update",
"(",
"CategoryRequest",
"$",
"request",
",",
"CategoryGroup",
"$",
"categoryGroup",
",",
"Category",
"$",
"category",
")",
":",
"JsonResponse",
"{",
"if",
"(",
"$",
"category",
"->",
"category_group_id",
"!==",
"$",
"categoryGroup... | Update category in the database.
@param \Modules\Category\Http\Requests\CategoryRequest $request
@param \Modules\Category\Models\CategoryGroup $categoryGroup
@param \Modules\Category\Models\Category $category
@return \Illuminate\Http\JsonResponse | [
"Update",
"category",
"in",
"the",
"database",
"."
] | 61a4fc2525774f8ddea730ad9f6f06644552adf7 | https://github.com/netcore/module-category/blob/61a4fc2525774f8ddea730ad9f6f06644552adf7/Http/Controllers/Admin/CategoryController.php#L95-L129 |
8,222 | netcore/module-category | Http/Controllers/Admin/CategoryController.php | CategoryController.destroy | public function destroy(CategoryGroup $categoryGroup, Category $category): JsonResponse
{
$categories = $categoryGroup->categories()->descendantsAndSelf(
$category->id
);
foreach ($categories as $item) {
$item->delete();
};
$this->clearCache();
... | php | public function destroy(CategoryGroup $categoryGroup, Category $category): JsonResponse
{
$categories = $categoryGroup->categories()->descendantsAndSelf(
$category->id
);
foreach ($categories as $item) {
$item->delete();
};
$this->clearCache();
... | [
"public",
"function",
"destroy",
"(",
"CategoryGroup",
"$",
"categoryGroup",
",",
"Category",
"$",
"category",
")",
":",
"JsonResponse",
"{",
"$",
"categories",
"=",
"$",
"categoryGroup",
"->",
"categories",
"(",
")",
"->",
"descendantsAndSelf",
"(",
"$",
"cat... | Delete category and it's descendants.
@param \Modules\Category\Models\CategoryGroup $categoryGroup
@param \Modules\Category\Models\Category $category
@return \Illuminate\Http\JsonResponse | [
"Delete",
"category",
"and",
"it",
"s",
"descendants",
"."
] | 61a4fc2525774f8ddea730ad9f6f06644552adf7 | https://github.com/netcore/module-category/blob/61a4fc2525774f8ddea730ad9f6f06644552adf7/Http/Controllers/Admin/CategoryController.php#L138-L153 |
8,223 | netcore/module-category | Http/Controllers/Admin/CategoryController.php | CategoryController.updateOrder | public function updateOrder(Request $request): JsonResponse
{
Category::rebuildTree(
$request->input('tree')
);
$this->clearCache();
$movedNode = Category::findOrFail(
$request->input('moved')
);
dispatch(
new RegenerateCategoryF... | php | public function updateOrder(Request $request): JsonResponse
{
Category::rebuildTree(
$request->input('tree')
);
$this->clearCache();
$movedNode = Category::findOrFail(
$request->input('moved')
);
dispatch(
new RegenerateCategoryF... | [
"public",
"function",
"updateOrder",
"(",
"Request",
"$",
"request",
")",
":",
"JsonResponse",
"{",
"Category",
"::",
"rebuildTree",
"(",
"$",
"request",
"->",
"input",
"(",
"'tree'",
")",
")",
";",
"$",
"this",
"->",
"clearCache",
"(",
")",
";",
"$",
... | Rebuild categories tree.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\JsonResponse | [
"Rebuild",
"categories",
"tree",
"."
] | 61a4fc2525774f8ddea730ad9f6f06644552adf7 | https://github.com/netcore/module-category/blob/61a4fc2525774f8ddea730ad9f6f06644552adf7/Http/Controllers/Admin/CategoryController.php#L161-L180 |
8,224 | netcore/module-category | Http/Controllers/Admin/CategoryController.php | CategoryController.fetchCategories | public function fetchCategories(CategoryGroup $categoryGroup)
{
$isTreeOpened = config('netcore.module-category.tree.opened_by_default', false);
$suffixHelper = config('netcore.module-category.tree.name_suffix_helper_function', null);
$language = TransHelper::getLanguage();
$categor... | php | public function fetchCategories(CategoryGroup $categoryGroup)
{
$isTreeOpened = config('netcore.module-category.tree.opened_by_default', false);
$suffixHelper = config('netcore.module-category.tree.name_suffix_helper_function', null);
$language = TransHelper::getLanguage();
$categor... | [
"public",
"function",
"fetchCategories",
"(",
"CategoryGroup",
"$",
"categoryGroup",
")",
"{",
"$",
"isTreeOpened",
"=",
"config",
"(",
"'netcore.module-category.tree.opened_by_default'",
",",
"false",
")",
";",
"$",
"suffixHelper",
"=",
"config",
"(",
"'netcore.modul... | Get data for JsTree.
@param CategoryGroup $categoryGroup
@return \Illuminate\Database\Eloquent\Collection | [
"Get",
"data",
"for",
"JsTree",
"."
] | 61a4fc2525774f8ddea730ad9f6f06644552adf7 | https://github.com/netcore/module-category/blob/61a4fc2525774f8ddea730ad9f6f06644552adf7/Http/Controllers/Admin/CategoryController.php#L188-L236 |
8,225 | diatem-net/jin-webapp | src/WebApp/WebApp.php | WebApp.getPageFolder | public static function getPageFolder()
{
$folder = self::path() . self::$pageFolder;
return rtrim(realpath($folder), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
} | php | public static function getPageFolder()
{
$folder = self::path() . self::$pageFolder;
return rtrim(realpath($folder), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
} | [
"public",
"static",
"function",
"getPageFolder",
"(",
")",
"{",
"$",
"folder",
"=",
"self",
"::",
"path",
"(",
")",
".",
"self",
"::",
"$",
"pageFolder",
";",
"return",
"rtrim",
"(",
"realpath",
"(",
"$",
"folder",
")",
",",
"DIRECTORY_SEPARATOR",
")",
... | Get the page folder
@return string | [
"Get",
"the",
"page",
"folder"
] | 43e85f780c3841a536e3a5d41929523e5aacd272 | https://github.com/diatem-net/jin-webapp/blob/43e85f780c3841a536e3a5d41929523e5aacd272/src/WebApp/WebApp.php#L119-L123 |
8,226 | diatem-net/jin-webapp | src/WebApp/WebApp.php | WebApp.getCacheFolder | public static function getCacheFolder()
{
$folder = self::path() . self::$cacheFolder;
return rtrim(realpath($folder), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
} | php | public static function getCacheFolder()
{
$folder = self::path() . self::$cacheFolder;
return rtrim(realpath($folder), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
} | [
"public",
"static",
"function",
"getCacheFolder",
"(",
")",
"{",
"$",
"folder",
"=",
"self",
"::",
"path",
"(",
")",
".",
"self",
"::",
"$",
"cacheFolder",
";",
"return",
"rtrim",
"(",
"realpath",
"(",
"$",
"folder",
")",
",",
"DIRECTORY_SEPARATOR",
")",... | Get the cache folder
@return string | [
"Get",
"the",
"cache",
"folder"
] | 43e85f780c3841a536e3a5d41929523e5aacd272 | https://github.com/diatem-net/jin-webapp/blob/43e85f780c3841a536e3a5d41929523e5aacd272/src/WebApp/WebApp.php#L130-L134 |
8,227 | diatem-net/jin-webapp | src/WebApp/WebApp.php | WebApp.getTemplateFolder | public static function getTemplateFolder()
{
$folder = self::path() . self::$templateFolder;
return rtrim(realpath($folder), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
} | php | public static function getTemplateFolder()
{
$folder = self::path() . self::$templateFolder;
return rtrim(realpath($folder), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
} | [
"public",
"static",
"function",
"getTemplateFolder",
"(",
")",
"{",
"$",
"folder",
"=",
"self",
"::",
"path",
"(",
")",
".",
"self",
"::",
"$",
"templateFolder",
";",
"return",
"rtrim",
"(",
"realpath",
"(",
"$",
"folder",
")",
",",
"DIRECTORY_SEPARATOR",
... | Get the template folder
@return string | [
"Get",
"the",
"template",
"folder"
] | 43e85f780c3841a536e3a5d41929523e5aacd272 | https://github.com/diatem-net/jin-webapp/blob/43e85f780c3841a536e3a5d41929523e5aacd272/src/WebApp/WebApp.php#L151-L155 |
8,228 | crazedsanity/core | src/core/ToolBox.class.php | ToolBox.create_list | static public function create_list($string=NULL, $addThis=NULL, $delimiter=", ") {
if(count(func_get_args()) > 3) {
trigger_error(__METHOD__ .": argument 'useSqlQuotes' is deprecated and no longer utilized");
}
if(strlen($string)) {
$retVal = $string . $delimiter . $addThis;
}
else {
$retVal = $addTh... | php | static public function create_list($string=NULL, $addThis=NULL, $delimiter=", ") {
if(count(func_get_args()) > 3) {
trigger_error(__METHOD__ .": argument 'useSqlQuotes' is deprecated and no longer utilized");
}
if(strlen($string)) {
$retVal = $string . $delimiter . $addThis;
}
else {
$retVal = $addTh... | [
"static",
"public",
"function",
"create_list",
"(",
"$",
"string",
"=",
"NULL",
",",
"$",
"addThis",
"=",
"NULL",
",",
"$",
"delimiter",
"=",
"\", \"",
")",
"{",
"if",
"(",
"count",
"(",
"func_get_args",
"(",
")",
")",
">",
"3",
")",
"{",
"trigger_er... | Returns a list delimited by the given delimiter. Does the work of checking if the given variable has data
in it already, that needs to be added to, vs. setting the variable with the new content. | [
"Returns",
"a",
"list",
"delimited",
"by",
"the",
"given",
"delimiter",
".",
"Does",
"the",
"work",
"of",
"checking",
"if",
"the",
"given",
"variable",
"has",
"data",
"in",
"it",
"already",
"that",
"needs",
"to",
"be",
"added",
"to",
"vs",
".",
"setting"... | f3053467edc6d105ebdaca146325b79329aa1d63 | https://github.com/crazedsanity/core/blob/f3053467edc6d105ebdaca146325b79329aa1d63/src/core/ToolBox.class.php#L522-L534 |
8,229 | crazedsanity/core | src/core/ToolBox.class.php | ToolBox.debug_print | static public function debug_print($input=NULL, $printItForMe=NULL, $removeHR=NULL, $usePreTags=true) {
if(!is_numeric($removeHR)) {
$removeHR = ToolBox::$debugRemoveHr;
}
if(!is_numeric($printItForMe)) {
$printItForMe = ToolBox::$debugPrintOpt;
}
ob_start();
print_r($input);
$output = ob_get_co... | php | static public function debug_print($input=NULL, $printItForMe=NULL, $removeHR=NULL, $usePreTags=true) {
if(!is_numeric($removeHR)) {
$removeHR = ToolBox::$debugRemoveHr;
}
if(!is_numeric($printItForMe)) {
$printItForMe = ToolBox::$debugPrintOpt;
}
ob_start();
print_r($input);
$output = ob_get_co... | [
"static",
"public",
"function",
"debug_print",
"(",
"$",
"input",
"=",
"NULL",
",",
"$",
"printItForMe",
"=",
"NULL",
",",
"$",
"removeHR",
"=",
"NULL",
",",
"$",
"usePreTags",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"removeHR",
... | A way of printing out human-readable information, especially arrays & objects, either to a web browser or via
the command line.
@param $input (mixed,optional) data to print/return
@param $printItForMe (bool,optional) whether it should be printed or just returned.
@return (string) printed data.
@codeCoverageIgnore | [
"A",
"way",
"of",
"printing",
"out",
"human",
"-",
"readable",
"information",
"especially",
"arrays",
"&",
"objects",
"either",
"to",
"a",
"web",
"browser",
"or",
"via",
"the",
"command",
"line",
"."
] | f3053467edc6d105ebdaca146325b79329aa1d63 | https://github.com/crazedsanity/core/blob/f3053467edc6d105ebdaca146325b79329aa1d63/src/core/ToolBox.class.php#L550-L584 |
8,230 | crazedsanity/core | src/core/ToolBox.class.php | ToolBox.clean_url | static public function clean_url($url=NULL) {
//make sure we've still got something valid to work with.
if(strlen($url)) {
//if there's an "APPURL" constant, drop that from the url.
if(defined('APPURL') && strlen(constant('APPURL'))) {
$dropThis = preg_replace('/^\//', '', constant('APPURL'));
$dropTh... | php | static public function clean_url($url=NULL) {
//make sure we've still got something valid to work with.
if(strlen($url)) {
//if there's an "APPURL" constant, drop that from the url.
if(defined('APPURL') && strlen(constant('APPURL'))) {
$dropThis = preg_replace('/^\//', '', constant('APPURL'));
$dropTh... | [
"static",
"public",
"function",
"clean_url",
"(",
"$",
"url",
"=",
"NULL",
")",
"{",
"//make sure we've still got something valid to work with.",
"if",
"(",
"strlen",
"(",
"$",
"url",
")",
")",
"{",
"//if there's an \"APPURL\" constant, drop that from the url.",
"if",
"... | Removes all the crap from the url, so we can figure out what section we
need to load templates & includes for. | [
"Removes",
"all",
"the",
"crap",
"from",
"the",
"url",
"so",
"we",
"can",
"figure",
"out",
"what",
"section",
"we",
"need",
"to",
"load",
"templates",
"&",
"includes",
"for",
"."
] | f3053467edc6d105ebdaca146325b79329aa1d63 | https://github.com/crazedsanity/core/blob/f3053467edc6d105ebdaca146325b79329aa1d63/src/core/ToolBox.class.php#L819-L866 |
8,231 | aedart/overload | src/Traits/SetterInvokerTrait.php | SetterInvokerTrait.invokeSetter | protected function invokeSetter(ReflectionProperty $property, $value) : void
{
$methodName = $this->generateSetterName($property->getName());
if ($this->hasInternalMethod($methodName)) {
$this->$methodName($value);
return;
}
throw new UndefinedPropertyExcepti... | php | protected function invokeSetter(ReflectionProperty $property, $value) : void
{
$methodName = $this->generateSetterName($property->getName());
if ($this->hasInternalMethod($methodName)) {
$this->$methodName($value);
return;
}
throw new UndefinedPropertyExcepti... | [
"protected",
"function",
"invokeSetter",
"(",
"ReflectionProperty",
"$",
"property",
",",
"$",
"value",
")",
":",
"void",
"{",
"$",
"methodName",
"=",
"$",
"this",
"->",
"generateSetterName",
"(",
"$",
"property",
"->",
"getName",
"(",
")",
")",
";",
"if",... | Invoke the given property's setter-method
@param ReflectionProperty $property The property in question
@param mixed $value The property's value
@return void;
@throws UndefinedPropertyException If given property doesn't have a corresponding get | [
"Invoke",
"the",
"given",
"property",
"s",
"setter",
"-",
"method"
] | 530a5f71454e69c58107ae864d2aa473277dcdfd | https://github.com/aedart/overload/blob/530a5f71454e69c58107ae864d2aa473277dcdfd/src/Traits/SetterInvokerTrait.php#L72-L84 |
8,232 | mszewcz/php-light-framework | src/Html/Controlls/DateAndTime.php | DateAndTime.getYears | private static function getYears(): array
{
$years = [-1 => static::getConstant('TXT_DATETIME_YYYY', 'TXT_DATETIME_YYYY')];
for ($i = 1978; $i <= 2037; $i++) {
$years[$i] = $i;
}
return $years;
} | php | private static function getYears(): array
{
$years = [-1 => static::getConstant('TXT_DATETIME_YYYY', 'TXT_DATETIME_YYYY')];
for ($i = 1978; $i <= 2037; $i++) {
$years[$i] = $i;
}
return $years;
} | [
"private",
"static",
"function",
"getYears",
"(",
")",
":",
"array",
"{",
"$",
"years",
"=",
"[",
"-",
"1",
"=>",
"static",
"::",
"getConstant",
"(",
"'TXT_DATETIME_YYYY'",
",",
"'TXT_DATETIME_YYYY'",
")",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"1978",
"... | Returns years array
@return array | [
"Returns",
"years",
"array"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Html/Controlls/DateAndTime.php#L27-L34 |
8,233 | mszewcz/php-light-framework | src/Html/Controlls/DateAndTime.php | DateAndTime.getMonths | private static function getMonths(): array
{
$months = [-1 => static::getConstant('TXT_DATETIME_MMM', 'TXT_DATETIME_MMM')];
for ($i = 1; $i <= 12; $i++) {
$months[$i] = static::getConstant('TXT_DATETIME_MONTH_'.$i.'_SHORT', 'TXT_DATETIME_MONTH_'.$i.'_SHORT');
}
return $mo... | php | private static function getMonths(): array
{
$months = [-1 => static::getConstant('TXT_DATETIME_MMM', 'TXT_DATETIME_MMM')];
for ($i = 1; $i <= 12; $i++) {
$months[$i] = static::getConstant('TXT_DATETIME_MONTH_'.$i.'_SHORT', 'TXT_DATETIME_MONTH_'.$i.'_SHORT');
}
return $mo... | [
"private",
"static",
"function",
"getMonths",
"(",
")",
":",
"array",
"{",
"$",
"months",
"=",
"[",
"-",
"1",
"=>",
"static",
"::",
"getConstant",
"(",
"'TXT_DATETIME_MMM'",
",",
"'TXT_DATETIME_MMM'",
")",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"1",
";",... | Returns months array
@return array | [
"Returns",
"months",
"array"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Html/Controlls/DateAndTime.php#L41-L48 |
8,234 | mszewcz/php-light-framework | src/Html/Controlls/DateAndTime.php | DateAndTime.getDays | private static function getDays(int $maxDays = 31): array
{
$days = [-1 => static::getConstant('TXT_DATETIME_DD', 'TXT_DATETIME_DD')];
for ($i = 1; $i <= $maxDays; $i++) {
$days[$i] = \sprintf('%02s', $i);
}
return $days;
} | php | private static function getDays(int $maxDays = 31): array
{
$days = [-1 => static::getConstant('TXT_DATETIME_DD', 'TXT_DATETIME_DD')];
for ($i = 1; $i <= $maxDays; $i++) {
$days[$i] = \sprintf('%02s', $i);
}
return $days;
} | [
"private",
"static",
"function",
"getDays",
"(",
"int",
"$",
"maxDays",
"=",
"31",
")",
":",
"array",
"{",
"$",
"days",
"=",
"[",
"-",
"1",
"=>",
"static",
"::",
"getConstant",
"(",
"'TXT_DATETIME_DD'",
",",
"'TXT_DATETIME_DD'",
")",
"]",
";",
"for",
"... | Returns days array
@param int $maxDays
@return array | [
"Returns",
"days",
"array"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Html/Controlls/DateAndTime.php#L56-L63 |
8,235 | mszewcz/php-light-framework | src/Html/Controlls/DateAndTime.php | DateAndTime.getHours | private static function getHours(): array
{
$hours = [-1 => static::getConstant('TXT_DATETIME_HH', 'TXT_DATETIME_HH')];
for ($i = 0; $i <= 23; $i++) {
$hours[$i] = \sprintf('%02s', $i);
}
return $hours;
} | php | private static function getHours(): array
{
$hours = [-1 => static::getConstant('TXT_DATETIME_HH', 'TXT_DATETIME_HH')];
for ($i = 0; $i <= 23; $i++) {
$hours[$i] = \sprintf('%02s', $i);
}
return $hours;
} | [
"private",
"static",
"function",
"getHours",
"(",
")",
":",
"array",
"{",
"$",
"hours",
"=",
"[",
"-",
"1",
"=>",
"static",
"::",
"getConstant",
"(",
"'TXT_DATETIME_HH'",
",",
"'TXT_DATETIME_HH'",
")",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"... | Returns hours array
@return array | [
"Returns",
"hours",
"array"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Html/Controlls/DateAndTime.php#L70-L77 |
8,236 | mszewcz/php-light-framework | src/Html/Controlls/DateAndTime.php | DateAndTime.getMinutes | private static function getMinutes(): array
{
$minutes = [-1 => static::getConstant('TXT_DATETIME_II', 'TXT_DATETIME_II')];
for ($i = 0; $i <= 59; $i++) {
$minutes[$i] = \sprintf('%02s', $i);
}
return $minutes;
} | php | private static function getMinutes(): array
{
$minutes = [-1 => static::getConstant('TXT_DATETIME_II', 'TXT_DATETIME_II')];
for ($i = 0; $i <= 59; $i++) {
$minutes[$i] = \sprintf('%02s', $i);
}
return $minutes;
} | [
"private",
"static",
"function",
"getMinutes",
"(",
")",
":",
"array",
"{",
"$",
"minutes",
"=",
"[",
"-",
"1",
"=>",
"static",
"::",
"getConstant",
"(",
"'TXT_DATETIME_II'",
",",
"'TXT_DATETIME_II'",
")",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",... | Returns minutes array
@return array | [
"Returns",
"minutes",
"array"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Html/Controlls/DateAndTime.php#L84-L91 |
8,237 | mszewcz/php-light-framework | src/Html/Controlls/DateAndTime.php | DateAndTime.getSeconds | private static function getSeconds(): array
{
$seconds = [-1 => static::getConstant('TXT_DATETIME_SS', 'TXT_DATETIME_SS')];
for ($i = 0; $i <= 59; $i++) {
$seconds[$i] = \sprintf('%02s', $i);
}
return $seconds;
} | php | private static function getSeconds(): array
{
$seconds = [-1 => static::getConstant('TXT_DATETIME_SS', 'TXT_DATETIME_SS')];
for ($i = 0; $i <= 59; $i++) {
$seconds[$i] = \sprintf('%02s', $i);
}
return $seconds;
} | [
"private",
"static",
"function",
"getSeconds",
"(",
")",
":",
"array",
"{",
"$",
"seconds",
"=",
"[",
"-",
"1",
"=>",
"static",
"::",
"getConstant",
"(",
"'TXT_DATETIME_SS'",
",",
"'TXT_DATETIME_SS'",
")",
"]",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",... | Returns seconds array
@return array | [
"Returns",
"seconds",
"array"
] | 4d3b46781c387202c2dfbdb8760151b3ae8ef49c | https://github.com/mszewcz/php-light-framework/blob/4d3b46781c387202c2dfbdb8760151b3ae8ef49c/src/Html/Controlls/DateAndTime.php#L98-L105 |
8,238 | vinala/kernel | src/Mailing/SMTP.php | SMTP.getDefault | public static function getDefault()
{
$smtp = new self(
config('mail.host'),
config('mail.port'),
config('mail.encryption'),
config('mail.username'),
config('mail.password'),
config('mail.from')['adresse'],
config('mail.from... | php | public static function getDefault()
{
$smtp = new self(
config('mail.host'),
config('mail.port'),
config('mail.encryption'),
config('mail.username'),
config('mail.password'),
config('mail.from')['adresse'],
config('mail.from... | [
"public",
"static",
"function",
"getDefault",
"(",
")",
"{",
"$",
"smtp",
"=",
"new",
"self",
"(",
"config",
"(",
"'mail.host'",
")",
",",
"config",
"(",
"'mail.port'",
")",
",",
"config",
"(",
"'mail.encryption'",
")",
",",
"config",
"(",
"'mail.username'... | Init the SMTP class by getting gefualt values from Config surface.
@return Vinala\Kernel\Mailing | [
"Init",
"the",
"SMTP",
"class",
"by",
"getting",
"gefualt",
"values",
"from",
"Config",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Mailing/SMTP.php#L109-L124 |
8,239 | vinala/kernel | src/Mailing/SMTP.php | SMTP.check | private static function check($smtp)
{
exception_if(empty($smtp->host), SmtpParameterNotFoundException::class, 'host');
exception_if(empty($smtp->port), SmtpParameterNotFoundException::class, 'port');
exception_if(empty($smtp->encryption), SmtpParameterNotFoundException::class, 'encryption')... | php | private static function check($smtp)
{
exception_if(empty($smtp->host), SmtpParameterNotFoundException::class, 'host');
exception_if(empty($smtp->port), SmtpParameterNotFoundException::class, 'port');
exception_if(empty($smtp->encryption), SmtpParameterNotFoundException::class, 'encryption')... | [
"private",
"static",
"function",
"check",
"(",
"$",
"smtp",
")",
"{",
"exception_if",
"(",
"empty",
"(",
"$",
"smtp",
"->",
"host",
")",
",",
"SmtpParameterNotFoundException",
"::",
"class",
",",
"'host'",
")",
";",
"exception_if",
"(",
"empty",
"(",
"$",
... | Check if SMTP configurated.
@return bool | [
"Check",
"if",
"SMTP",
"configurated",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Mailing/SMTP.php#L131-L142 |
8,240 | flowcode/AmulenClassificationBundle | src/Flowcode/ClassificationBundle/Controller/CategoryController.php | CategoryController.createEditForm | private function createEditForm(Category $entity)
{
$form = $this->createForm($this->get("amulen.classification.form.category"), $entity, array(
'action' => $this->generateUrl('admin_category_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->ad... | php | private function createEditForm(Category $entity)
{
$form = $this->createForm($this->get("amulen.classification.form.category"), $entity, array(
'action' => $this->generateUrl('admin_category_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->ad... | [
"private",
"function",
"createEditForm",
"(",
"Category",
"$",
"entity",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"$",
"this",
"->",
"get",
"(",
"\"amulen.classification.form.category\"",
")",
",",
"$",
"entity",
",",
"array",
"(",
... | Creates a form to edit a Category entity.
@param Category $entity The entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"edit",
"a",
"Category",
"entity",
"."
] | e280537c47f85e7da614ccd00a6993ff9ed86e18 | https://github.com/flowcode/AmulenClassificationBundle/blob/e280537c47f85e7da614ccd00a6993ff9ed86e18/src/Flowcode/ClassificationBundle/Controller/CategoryController.php#L160-L170 |
8,241 | bugotech/http | src/HttpServiceProvider.php | HttpServiceProvider.mapRoutes | protected function mapRoutes()
{
$this->app['events']->listen('kernel.handling', function () {
// Gatilho para arquivo routes.php
$file_route = app_path('routes.php');
if (files()->exists($file_route)) {
require $file_route;
}
// W... | php | protected function mapRoutes()
{
$this->app['events']->listen('kernel.handling', function () {
// Gatilho para arquivo routes.php
$file_route = app_path('routes.php');
if (files()->exists($file_route)) {
require $file_route;
}
// W... | [
"protected",
"function",
"mapRoutes",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"[",
"'events'",
"]",
"->",
"listen",
"(",
"'kernel.handling'",
",",
"function",
"(",
")",
"{",
"// Gatilho para arquivo routes.php",
"$",
"file_route",
"=",
"app_path",
"(",
"'rout... | Mapear as rotas do sistema. | [
"Mapear",
"as",
"rotas",
"do",
"sistema",
"."
] | 68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486 | https://github.com/bugotech/http/blob/68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486/src/HttpServiceProvider.php#L100-L121 |
8,242 | bugotech/http | src/HttpServiceProvider.php | HttpServiceProvider.shareRequestInUrl | protected function shareRequestInUrl()
{
$this->app['events']->listen('Illuminate\Routing\Events\RouteMatched', function (RouteMatched $event) {
foreach ($event->route->parameters() as $k => $v) {
$this->app['url']->share($k, $v);
}
});
} | php | protected function shareRequestInUrl()
{
$this->app['events']->listen('Illuminate\Routing\Events\RouteMatched', function (RouteMatched $event) {
foreach ($event->route->parameters() as $k => $v) {
$this->app['url']->share($k, $v);
}
});
} | [
"protected",
"function",
"shareRequestInUrl",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"[",
"'events'",
"]",
"->",
"listen",
"(",
"'Illuminate\\Routing\\Events\\RouteMatched'",
",",
"function",
"(",
"RouteMatched",
"$",
"event",
")",
"{",
"foreach",
"(",
"$",
... | Register request params in url. | [
"Register",
"request",
"params",
"in",
"url",
"."
] | 68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486 | https://github.com/bugotech/http/blob/68c2e8a28eaa2e53f98a55d2f2ec0e33c83fd486/src/HttpServiceProvider.php#L126-L133 |
8,243 | deasilworks/cef | src/EntityCollection.php | EntityCollection.getModel | public function getModel()
{
$namePath = $this->getModelClass();
$model = new $namePath();
if (!($model instanceof EntityDataModel)) {
throw new \Exception($this->valueClass.' is not an instance of EntityModel.');
}
return $model;
} | php | public function getModel()
{
$namePath = $this->getModelClass();
$model = new $namePath();
if (!($model instanceof EntityDataModel)) {
throw new \Exception($this->valueClass.' is not an instance of EntityModel.');
}
return $model;
} | [
"public",
"function",
"getModel",
"(",
")",
"{",
"$",
"namePath",
"=",
"$",
"this",
"->",
"getModelClass",
"(",
")",
";",
"$",
"model",
"=",
"new",
"$",
"namePath",
"(",
")",
";",
"if",
"(",
"!",
"(",
"$",
"model",
"instanceof",
"EntityDataModel",
")... | Model Factory.
@throws \Exception
@return mixed | [
"Model",
"Factory",
"."
] | 18c65f2b123512bba2208975dc655354f57670be | https://github.com/deasilworks/cef/blob/18c65f2b123512bba2208975dc655354f57670be/src/EntityCollection.php#L348-L358 |
8,244 | deasilworks/cef | src/EntityCollection.php | EntityCollection.addEntity | public function addEntity($entity)
{
$this->collection[] = $entity;
$this->setCount(count($this->collection));
return $this;
} | php | public function addEntity($entity)
{
$this->collection[] = $entity;
$this->setCount(count($this->collection));
return $this;
} | [
"public",
"function",
"addEntity",
"(",
"$",
"entity",
")",
"{",
"$",
"this",
"->",
"collection",
"[",
"]",
"=",
"$",
"entity",
";",
"$",
"this",
"->",
"setCount",
"(",
"count",
"(",
"$",
"this",
"->",
"collection",
")",
")",
";",
"return",
"$",
"t... | Adds a single entity.
@param array $entity
@return EntityCollection | [
"Adds",
"a",
"single",
"entity",
"."
] | 18c65f2b123512bba2208975dc655354f57670be | https://github.com/deasilworks/cef/blob/18c65f2b123512bba2208975dc655354f57670be/src/EntityCollection.php#L419-L425 |
8,245 | dankempster/axstrad-common | src/Util/Debug.php | Debug.summariseArray | private static function summariseArray(array $var, $depth = 1)
{
static $depth = 1;
if ($depth == 2) {
return 'Array('.count($var).')';
}
elseif (($count = count($var)) > 0) {
$key = array_keys($var);
$key = $key[0];
$value = array_va... | php | private static function summariseArray(array $var, $depth = 1)
{
static $depth = 1;
if ($depth == 2) {
return 'Array('.count($var).')';
}
elseif (($count = count($var)) > 0) {
$key = array_keys($var);
$key = $key[0];
$value = array_va... | [
"private",
"static",
"function",
"summariseArray",
"(",
"array",
"$",
"var",
",",
"$",
"depth",
"=",
"1",
")",
"{",
"static",
"$",
"depth",
"=",
"1",
";",
"if",
"(",
"$",
"depth",
"==",
"2",
")",
"{",
"return",
"'Array('",
".",
"count",
"(",
"$",
... | Summarises an array
@param array $var
@return string | [
"Summarises",
"an",
"array"
] | 900ae03199aa027750d9fa8375d376e3754a5abd | https://github.com/dankempster/axstrad-common/blob/900ae03199aa027750d9fa8375d376e3754a5abd/src/Util/Debug.php#L93-L125 |
8,246 | afonzeca/arun-core | src/ArunCore/Core/IO/FileContentGenerator.php | FileContentGenerator.loadDomainCode | public function loadDomainCode(string $domainName)
{
$domainClassName = DomainActionNameGenerator::getDomainClassName($domainName);
return $this->load($this->domainsPath . "/" . $domainClassName.".php");
} | php | public function loadDomainCode(string $domainName)
{
$domainClassName = DomainActionNameGenerator::getDomainClassName($domainName);
return $this->load($this->domainsPath . "/" . $domainClassName.".php");
} | [
"public",
"function",
"loadDomainCode",
"(",
"string",
"$",
"domainName",
")",
"{",
"$",
"domainClassName",
"=",
"DomainActionNameGenerator",
"::",
"getDomainClassName",
"(",
"$",
"domainName",
")",
";",
"return",
"$",
"this",
"->",
"load",
"(",
"$",
"this",
"... | Load code from a specified ClassDomain
@param string $domainName
@return bool|null|string | [
"Load",
"code",
"from",
"a",
"specified",
"ClassDomain"
] | 7a8af37e326187ff9ed7e2ff7bde6a489a9803a2 | https://github.com/afonzeca/arun-core/blob/7a8af37e326187ff9ed7e2ff7bde6a489a9803a2/src/ArunCore/Core/IO/FileContentGenerator.php#L73-L78 |
8,247 | Atipik/Hoa-WebSocket-Bundle | WebSocket/Runner.php | Runner.addEvent | public function addEvent($event, $callable)
{
if (!is_callable($callable)) {
throw new \InvalidArgumentException(
sprintf(
'%s expects parameter 2 to be callable, %s given: %s',
__METHOD__,
gettype($callable),
... | php | public function addEvent($event, $callable)
{
if (!is_callable($callable)) {
throw new \InvalidArgumentException(
sprintf(
'%s expects parameter 2 to be callable, %s given: %s',
__METHOD__,
gettype($callable),
... | [
"public",
"function",
"addEvent",
"(",
"$",
"event",
",",
"$",
"callable",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callable",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'%s expects parameter 2 to be calla... | Add an event and its callback
@param string $event
@param callable $callable | [
"Add",
"an",
"event",
"and",
"its",
"callback"
] | 5961ba1fd808bae8ab4f96f76fb7a4db90edf76f | https://github.com/Atipik/Hoa-WebSocket-Bundle/blob/5961ba1fd808bae8ab4f96f76fb7a4db90edf76f/WebSocket/Runner.php#L53-L71 |
8,248 | Atipik/Hoa-WebSocket-Bundle | WebSocket/Runner.php | Runner.initWebSocketServer | public function initWebSocketServer()
{
$webSocketServer = $this->getWebSocketServer();
$webSocketServer->setLogger(
$this->getLogger()
);
if ($this->getNodeClass() !== null) {
$webSocketServer->getConnection()->setNodeName(
$this->getNodeCla... | php | public function initWebSocketServer()
{
$webSocketServer = $this->getWebSocketServer();
$webSocketServer->setLogger(
$this->getLogger()
);
if ($this->getNodeClass() !== null) {
$webSocketServer->getConnection()->setNodeName(
$this->getNodeCla... | [
"public",
"function",
"initWebSocketServer",
"(",
")",
"{",
"$",
"webSocketServer",
"=",
"$",
"this",
"->",
"getWebSocketServer",
"(",
")",
";",
"$",
"webSocketServer",
"->",
"setLogger",
"(",
"$",
"this",
"->",
"getLogger",
"(",
")",
")",
";",
"if",
"(",
... | Initialize WebSocket server
@return Hoa\Websocket\Server | [
"Initialize",
"WebSocket",
"server"
] | 5961ba1fd808bae8ab4f96f76fb7a4db90edf76f | https://github.com/Atipik/Hoa-WebSocket-Bundle/blob/5961ba1fd808bae8ab4f96f76fb7a4db90edf76f/WebSocket/Runner.php#L196-L237 |
8,249 | Atipik/Hoa-WebSocket-Bundle | WebSocket/Runner.php | Runner.launchModuleAction | public function launchModuleAction($event, Module\ModuleInterface $module, $method, Bucket $bucket, $additionnalData = null)
{
$module->setBucket($bucket);
return call_user_func(
array(
$module,
$method
),
$additionnalData
... | php | public function launchModuleAction($event, Module\ModuleInterface $module, $method, Bucket $bucket, $additionnalData = null)
{
$module->setBucket($bucket);
return call_user_func(
array(
$module,
$method
),
$additionnalData
... | [
"public",
"function",
"launchModuleAction",
"(",
"$",
"event",
",",
"Module",
"\\",
"ModuleInterface",
"$",
"module",
",",
"$",
"method",
",",
"Bucket",
"$",
"bucket",
",",
"$",
"additionnalData",
"=",
"null",
")",
"{",
"$",
"module",
"->",
"setBucket",
"(... | Launch module action
@param string $event
@param Module\ModuleInterface $module
@param string $method
@param Bucket $bucket
@param mixed $additionnalData
@return boolean | [
"Launch",
"module",
"action"
] | 5961ba1fd808bae8ab4f96f76fb7a4db90edf76f | https://github.com/Atipik/Hoa-WebSocket-Bundle/blob/5961ba1fd808bae8ab4f96f76fb7a4db90edf76f/WebSocket/Runner.php#L250-L261 |
8,250 | Atipik/Hoa-WebSocket-Bundle | WebSocket/Runner.php | Runner.onError | public function onError(Bucket $bucket)
{
$data = $bucket->getData();
if (isset($data['exception']) && $data['exception'] instanceof Quit) {
throw $data['exception'];
}
$this->onEvent('error', $bucket);
} | php | public function onError(Bucket $bucket)
{
$data = $bucket->getData();
if (isset($data['exception']) && $data['exception'] instanceof Quit) {
throw $data['exception'];
}
$this->onEvent('error', $bucket);
} | [
"public",
"function",
"onError",
"(",
"Bucket",
"$",
"bucket",
")",
"{",
"$",
"data",
"=",
"$",
"bucket",
"->",
"getData",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'exception'",
"]",
")",
"&&",
"$",
"data",
"[",
"'exception'",
"]"... | Fire a "error" event
@param Hoa\Event\Bucket $bucket | [
"Fire",
"a",
"error",
"event"
] | 5961ba1fd808bae8ab4f96f76fb7a4db90edf76f | https://github.com/Atipik/Hoa-WebSocket-Bundle/blob/5961ba1fd808bae8ab4f96f76fb7a4db90edf76f/WebSocket/Runner.php#L338-L347 |
8,251 | Atipik/Hoa-WebSocket-Bundle | WebSocket/Runner.php | Runner.run | public function run()
{
try {
$this->initWebSocketServer()->run();
return true;
} catch (Exception\Quit $e) {
$this->getLogger()->success(
$e->getMessage()
);
return true;
} catch (\Exception $e) {
$tra... | php | public function run()
{
try {
$this->initWebSocketServer()->run();
return true;
} catch (Exception\Quit $e) {
$this->getLogger()->success(
$e->getMessage()
);
return true;
} catch (\Exception $e) {
$tra... | [
"public",
"function",
"run",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"initWebSocketServer",
"(",
")",
"->",
"run",
"(",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"Exception",
"\\",
"Quit",
"$",
"e",
")",
"{",
"$",
"this",
"->",
"g... | Run this server
@return boolean | [
"Run",
"this",
"server"
] | 5961ba1fd808bae8ab4f96f76fb7a4db90edf76f | https://github.com/Atipik/Hoa-WebSocket-Bundle/blob/5961ba1fd808bae8ab4f96f76fb7a4db90edf76f/WebSocket/Runner.php#L422-L456 |
8,252 | phn-io/compilation | src/Phn/Compilation/Compiler.php | Compiler.write | public function write($content = '')
{
$content = preg_split('/\R/', $content);
foreach ($content as $line) {
$this->source .= PHP_EOL.str_repeat(' ', $this->depth).$line;
}
return $this;
} | php | public function write($content = '')
{
$content = preg_split('/\R/', $content);
foreach ($content as $line) {
$this->source .= PHP_EOL.str_repeat(' ', $this->depth).$line;
}
return $this;
} | [
"public",
"function",
"write",
"(",
"$",
"content",
"=",
"''",
")",
"{",
"$",
"content",
"=",
"preg_split",
"(",
"'/\\R/'",
",",
"$",
"content",
")",
";",
"foreach",
"(",
"$",
"content",
"as",
"$",
"line",
")",
"{",
"$",
"this",
"->",
"source",
".=... | Write a new line of code. The new line is added before the content. A block of code can also be wrote in one
shot.
The following code:
$block = <<<PHP
echo " ";
echo "World";
PHP;
$compiler
->write('echo "Hello";')
->write($block)
;
Compiles into:
<?php
echo "Hello";
echo " ";
echo "World";
@param string $conten... | [
"Write",
"a",
"new",
"line",
"of",
"code",
".",
"The",
"new",
"line",
"is",
"added",
"before",
"the",
"content",
".",
"A",
"block",
"of",
"code",
"can",
"also",
"be",
"wrote",
"in",
"one",
"shot",
"."
] | 202e1816cc0039c08ad7ab3eb914e91e51d77320 | https://github.com/phn-io/compilation/blob/202e1816cc0039c08ad7ab3eb914e91e51d77320/src/Phn/Compilation/Compiler.php#L109-L118 |
8,253 | phn-io/compilation | src/Phn/Compilation/Compiler.php | Compiler.string | public function string($string, $singleLine = false)
{
$string = sprintf('"%s"', addcslashes($string, "\0\t\"\$\\"));
if ($singleLine === true) {
$string = preg_replace('/\n/', '\n', $string);
}
$this->source .= $string;
return $this;
} | php | public function string($string, $singleLine = false)
{
$string = sprintf('"%s"', addcslashes($string, "\0\t\"\$\\"));
if ($singleLine === true) {
$string = preg_replace('/\n/', '\n', $string);
}
$this->source .= $string;
return $this;
} | [
"public",
"function",
"string",
"(",
"$",
"string",
",",
"$",
"singleLine",
"=",
"false",
")",
"{",
"$",
"string",
"=",
"sprintf",
"(",
"'\"%s\"'",
",",
"addcslashes",
"(",
"$",
"string",
",",
"\"\\0\\t\\\"\\$\\\\\"",
")",
")",
";",
"if",
"(",
"$",
"si... | Adds a string to the source code.
The following code:
$compiler
->nl()->string('Hello world')->raw(';')
;
Compiles into:
<?php
"Hello World";
@param string $string The string to add.
@param bool $singleLine Specifies if the given string should be represented inline or not. false per default.
@return $this ... | [
"Adds",
"a",
"string",
"to",
"the",
"source",
"code",
"."
] | 202e1816cc0039c08ad7ab3eb914e91e51d77320 | https://github.com/phn-io/compilation/blob/202e1816cc0039c08ad7ab3eb914e91e51d77320/src/Phn/Compilation/Compiler.php#L245-L256 |
8,254 | cityware/city-wmi | src/Models/Variants/HardDisk.php | HardDisk.checkDisk | public function checkDisk($fixErrors = false, $vigorousIndexCheck = true, $skipFolderCycle = true, $forceDismount = false, $recoverBadSectors = false, $runAtBootup = false)
{
$result = $this->variant->chkdsk($fixErrors, $vigorousIndexCheck, $skipFolderCycle, $forceDismount, $recoverBadSectors, $runAtBootup)... | php | public function checkDisk($fixErrors = false, $vigorousIndexCheck = true, $skipFolderCycle = true, $forceDismount = false, $recoverBadSectors = false, $runAtBootup = false)
{
$result = $this->variant->chkdsk($fixErrors, $vigorousIndexCheck, $skipFolderCycle, $forceDismount, $recoverBadSectors, $runAtBootup)... | [
"public",
"function",
"checkDisk",
"(",
"$",
"fixErrors",
"=",
"false",
",",
"$",
"vigorousIndexCheck",
"=",
"true",
",",
"$",
"skipFolderCycle",
"=",
"true",
",",
"$",
"forceDismount",
"=",
"false",
",",
"$",
"recoverBadSectors",
"=",
"false",
",",
"$",
"... | Invokes the Chkdsk operation on the current volume.
@param bool|false $fixErrors If true, errors found on the disk are fixed. The default is false.
@param bool|true $vigorousIndexCheck If true, a vigorous check of index entries is performed. The default is true.
@param bool|true $skipFolderCycle If true, the folder ... | [
"Invokes",
"the",
"Chkdsk",
"operation",
"on",
"the",
"current",
"volume",
"."
] | c7296e6855b6719f537ff5c2dc19d521ce1415d8 | https://github.com/cityware/city-wmi/blob/c7296e6855b6719f537ff5c2dc19d521ce1415d8/src/Models/Variants/HardDisk.php#L228-L240 |
8,255 | vworldat/SimpleContentBundle | Twig/Extension/SimpleContentExtension.php | SimpleContentExtension.contentBlockFilter | public function contentBlockFilter($defaultContent, $name, $type = 'line', $locale = null, $useLocaleFallback = null)
{
$block = $this->contentService->getOrCreateContentBlock($name, $locale, $useLocaleFallback, $type, $defaultContent);
if (null === $locale || (null !== $this->translator && $this->... | php | public function contentBlockFilter($defaultContent, $name, $type = 'line', $locale = null, $useLocaleFallback = null)
{
$block = $this->contentService->getOrCreateContentBlock($name, $locale, $useLocaleFallback, $type, $defaultContent);
if (null === $locale || (null !== $this->translator && $this->... | [
"public",
"function",
"contentBlockFilter",
"(",
"$",
"defaultContent",
",",
"$",
"name",
",",
"$",
"type",
"=",
"'line'",
",",
"$",
"locale",
"=",
"null",
",",
"$",
"useLocaleFallback",
"=",
"null",
")",
"{",
"$",
"block",
"=",
"$",
"this",
"->",
"con... | Fetch content block with the given default content and name.
This allows to wrap existing content with a filter block.
If a locale different from the current locale is given, the block is fetched/created,
but not displayed.
Implemented / allowed types so far:
* line Single line, escaped (default)
* text Mul... | [
"Fetch",
"content",
"block",
"with",
"the",
"given",
"default",
"content",
"and",
"name",
".",
"This",
"allows",
"to",
"wrap",
"existing",
"content",
"with",
"a",
"filter",
"block",
"."
] | cca691609c9e7850969f27dac524865342042c68 | https://github.com/vworldat/SimpleContentBundle/blob/cca691609c9e7850969f27dac524865342042c68/Twig/Extension/SimpleContentExtension.php#L98-L108 |
8,256 | vworldat/SimpleContentBundle | Twig/Extension/SimpleContentExtension.php | SimpleContentExtension.renderContent | protected function renderContent(ContentBlock $block)
{
$content = $block->getContent();
switch ($block->getType())
{
case 'line':
$content = htmlspecialchars($content);
break;
case 'text':
$content = htmlspecialchars(... | php | protected function renderContent(ContentBlock $block)
{
$content = $block->getContent();
switch ($block->getType())
{
case 'line':
$content = htmlspecialchars($content);
break;
case 'text':
$content = htmlspecialchars(... | [
"protected",
"function",
"renderContent",
"(",
"ContentBlock",
"$",
"block",
")",
"{",
"$",
"content",
"=",
"$",
"block",
"->",
"getContent",
"(",
")",
";",
"switch",
"(",
"$",
"block",
"->",
"getType",
"(",
")",
")",
"{",
"case",
"'line'",
":",
"$",
... | Render the given ContentBlock, HTML-escaping the content where necessary.
@throws \InvalidArgumentException If given type is unknown
@param ContentBlock $block
@return string | [
"Render",
"the",
"given",
"ContentBlock",
"HTML",
"-",
"escaping",
"the",
"content",
"where",
"necessary",
"."
] | cca691609c9e7850969f27dac524865342042c68 | https://github.com/vworldat/SimpleContentBundle/blob/cca691609c9e7850969f27dac524865342042c68/Twig/Extension/SimpleContentExtension.php#L119-L146 |
8,257 | vworldat/SimpleContentBundle | Twig/Extension/SimpleContentExtension.php | SimpleContentExtension.contentBlockFilterLine | public function contentBlockFilterLine($defaultContent, $name, $locale = null, $useLocaleFallback = null)
{
return $this->contentBlockFilter($defaultContent, $name, 'line', $locale, $useLocaleFallback);
} | php | public function contentBlockFilterLine($defaultContent, $name, $locale = null, $useLocaleFallback = null)
{
return $this->contentBlockFilter($defaultContent, $name, 'line', $locale, $useLocaleFallback);
} | [
"public",
"function",
"contentBlockFilterLine",
"(",
"$",
"defaultContent",
",",
"$",
"name",
",",
"$",
"locale",
"=",
"null",
",",
"$",
"useLocaleFallback",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"contentBlockFilter",
"(",
"$",
"defaultContent",
... | Shortcut to contentBlockFilter using "line" rendering.
@param string $defaultContent Default content to assign if block has to be created
@param string $name Block name
@param string $locale Specific locale to use instead of current locale
@param string $useLocaleFallback Override global use... | [
"Shortcut",
"to",
"contentBlockFilter",
"using",
"line",
"rendering",
"."
] | cca691609c9e7850969f27dac524865342042c68 | https://github.com/vworldat/SimpleContentBundle/blob/cca691609c9e7850969f27dac524865342042c68/Twig/Extension/SimpleContentExtension.php#L158-L161 |
8,258 | vworldat/SimpleContentBundle | Twig/Extension/SimpleContentExtension.php | SimpleContentExtension.contentBlockFilterText | public function contentBlockFilterText($defaultContent, $name, $locale = null, $useLocaleFallback = null)
{
return $this->contentBlockFilter($defaultContent, $name, 'text', $locale, $useLocaleFallback);
} | php | public function contentBlockFilterText($defaultContent, $name, $locale = null, $useLocaleFallback = null)
{
return $this->contentBlockFilter($defaultContent, $name, 'text', $locale, $useLocaleFallback);
} | [
"public",
"function",
"contentBlockFilterText",
"(",
"$",
"defaultContent",
",",
"$",
"name",
",",
"$",
"locale",
"=",
"null",
",",
"$",
"useLocaleFallback",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"contentBlockFilter",
"(",
"$",
"defaultContent",
... | Shortcut to contentBlockFilter using "text" rendering.
@param string $defaultContent Default content to assign if block has to be created
@param string $name Block name
@param string $locale Specific locale to use instead of current locale
@param string $useLocaleFallback Override global use... | [
"Shortcut",
"to",
"contentBlockFilter",
"using",
"text",
"rendering",
"."
] | cca691609c9e7850969f27dac524865342042c68 | https://github.com/vworldat/SimpleContentBundle/blob/cca691609c9e7850969f27dac524865342042c68/Twig/Extension/SimpleContentExtension.php#L173-L176 |
8,259 | vworldat/SimpleContentBundle | Twig/Extension/SimpleContentExtension.php | SimpleContentExtension.contentBlockFilterMarkdown | public function contentBlockFilterMarkdown($defaultContent, $name, $locale = null, $useLocaleFallback = null)
{
return $this->contentBlockFilter($defaultContent, $name, 'markdown', $locale, $useLocaleFallback);
} | php | public function contentBlockFilterMarkdown($defaultContent, $name, $locale = null, $useLocaleFallback = null)
{
return $this->contentBlockFilter($defaultContent, $name, 'markdown', $locale, $useLocaleFallback);
} | [
"public",
"function",
"contentBlockFilterMarkdown",
"(",
"$",
"defaultContent",
",",
"$",
"name",
",",
"$",
"locale",
"=",
"null",
",",
"$",
"useLocaleFallback",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"contentBlockFilter",
"(",
"$",
"defaultConten... | Shortcut to contentBlockFilter using "markdown" rendering.
@param string $defaultContent Default content to assign if block has to be created
@param string $name Block name
@param string $locale Specific locale to use instead of current locale
@param string $useLocaleFallback Override global... | [
"Shortcut",
"to",
"contentBlockFilter",
"using",
"markdown",
"rendering",
"."
] | cca691609c9e7850969f27dac524865342042c68 | https://github.com/vworldat/SimpleContentBundle/blob/cca691609c9e7850969f27dac524865342042c68/Twig/Extension/SimpleContentExtension.php#L188-L191 |
8,260 | vworldat/SimpleContentBundle | Twig/Extension/SimpleContentExtension.php | SimpleContentExtension.contentBlockFilterHtml | public function contentBlockFilterHtml($defaultContent, $name, $locale = null, $useLocaleFallback = null)
{
return $this->contentBlockFilter($defaultContent, $name, 'html', $locale, $useLocaleFallback);
} | php | public function contentBlockFilterHtml($defaultContent, $name, $locale = null, $useLocaleFallback = null)
{
return $this->contentBlockFilter($defaultContent, $name, 'html', $locale, $useLocaleFallback);
} | [
"public",
"function",
"contentBlockFilterHtml",
"(",
"$",
"defaultContent",
",",
"$",
"name",
",",
"$",
"locale",
"=",
"null",
",",
"$",
"useLocaleFallback",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"contentBlockFilter",
"(",
"$",
"defaultContent",
... | Shortcut to contentBlockFilter using "html" rendering.
@param string $defaultContent Default content to assign if block has to be created
@param string $name Block name
@param string $locale Specific locale to use instead of current locale
@param string $useLocaleFallback Override global use... | [
"Shortcut",
"to",
"contentBlockFilter",
"using",
"html",
"rendering",
"."
] | cca691609c9e7850969f27dac524865342042c68 | https://github.com/vworldat/SimpleContentBundle/blob/cca691609c9e7850969f27dac524865342042c68/Twig/Extension/SimpleContentExtension.php#L203-L206 |
8,261 | sebardo/ecommerce | EcommerceBundle/Entity/Repository/InvoiceRepository.php | InvoiceRepository.getNextNumber | public function getNextNumber()
{
if (0 === (int) $this->countTotal()) {
return 1;
}
$qb = $this->getQueryBuilder()
->select('MAX(i.invoiceNumber) + 1');
return $qb->getQuery()
->getSingleScalarResult();
} | php | public function getNextNumber()
{
if (0 === (int) $this->countTotal()) {
return 1;
}
$qb = $this->getQueryBuilder()
->select('MAX(i.invoiceNumber) + 1');
return $qb->getQuery()
->getSingleScalarResult();
} | [
"public",
"function",
"getNextNumber",
"(",
")",
"{",
"if",
"(",
"0",
"===",
"(",
"int",
")",
"$",
"this",
"->",
"countTotal",
"(",
")",
")",
"{",
"return",
"1",
";",
"}",
"$",
"qb",
"=",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
"->",
"sel... | Get next invoice number
@return int | [
"Get",
"next",
"invoice",
"number"
] | 3e17545e69993f10a1df17f9887810c7378fc7f9 | https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Entity/Repository/InvoiceRepository.php#L82-L93 |
8,262 | bruery/platform-core | src/bundles/BlockBundle/Controller/BlockController.php | BlockController.renderAction | public function renderAction(Request $request)
{
//TODO: render initial block via ajax
$blockType = $request->get('blockType', null);
$action = $request->get('action', null);
// merge all parameters
$params = array_merge($request->request->all(), $request->query->all());... | php | public function renderAction(Request $request)
{
//TODO: render initial block via ajax
$blockType = $request->get('blockType', null);
$action = $request->get('action', null);
// merge all parameters
$params = array_merge($request->request->all(), $request->query->all());... | [
"public",
"function",
"renderAction",
"(",
"Request",
"$",
"request",
")",
"{",
"//TODO: render initial block via ajax",
"$",
"blockType",
"=",
"$",
"request",
"->",
"get",
"(",
"'blockType'",
",",
"null",
")",
";",
"$",
"action",
"=",
"$",
"request",
"->",
... | Default render action
@param Request $request
@return mixed
@throws \Exception | [
"Default",
"render",
"action"
] | 46153c181b2d852763afa30f7378bcbc1b2f4ef3 | https://github.com/bruery/platform-core/blob/46153c181b2d852763afa30f7378bcbc1b2f4ef3/src/bundles/BlockBundle/Controller/BlockController.php#L30-L59 |
8,263 | jeromeklam/freefw | src/FreeFW/JsonApi/V1/Decoder.php | Decoder.decode | public function decode(
\FreeFW\JsonApi\V1\Model\Document $p_document
) : \FreeFW\Core\Model {
if ($p_document->isSimpleResource()) {
$resource = $p_document->getData();
$cls = $resource->getType();
$class = str_replace('_', '::Model::', $cls);
... | php | public function decode(
\FreeFW\JsonApi\V1\Model\Document $p_document
) : \FreeFW\Core\Model {
if ($p_document->isSimpleResource()) {
$resource = $p_document->getData();
$cls = $resource->getType();
$class = str_replace('_', '::Model::', $cls);
... | [
"public",
"function",
"decode",
"(",
"\\",
"FreeFW",
"\\",
"JsonApi",
"\\",
"V1",
"\\",
"Model",
"\\",
"Document",
"$",
"p_document",
")",
":",
"\\",
"FreeFW",
"\\",
"Core",
"\\",
"Model",
"{",
"if",
"(",
"$",
"p_document",
"->",
"isSimpleResource",
"(",... | Decode a ApiResponseInterface
@param \FreeFW\JsonApi\V1\Model\Document $p_document
@return \FreeFW\Core\Model | [
"Decode",
"a",
"ApiResponseInterface"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/JsonApi/V1/Decoder.php#L19-L36 |
8,264 | jagilpe/entity-list-bundle | EntityList/EntityList.php | EntityList.getFields | public function getFields()
{
$fields = array();
foreach ($this->columns as $column) {
$fields = array_merge($fields, $column->getFields());
}
return $fields;
} | php | public function getFields()
{
$fields = array();
foreach ($this->columns as $column) {
$fields = array_merge($fields, $column->getFields());
}
return $fields;
} | [
"public",
"function",
"getFields",
"(",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"columns",
"as",
"$",
"column",
")",
"{",
"$",
"fields",
"=",
"array_merge",
"(",
"$",
"fields",
",",
"$",
"column",
"-... | Returns the fields used in the different cells of the list
@return string[] | [
"Returns",
"the",
"fields",
"used",
"in",
"the",
"different",
"cells",
"of",
"the",
"list"
] | 54331a4de7e7916894fb4a7a3156d8e7c1b0e0dc | https://github.com/jagilpe/entity-list-bundle/blob/54331a4de7e7916894fb4a7a3156d8e7c1b0e0dc/EntityList/EntityList.php#L94-L102 |
8,265 | OWeb/OWeb-Framework | OWeb/manage/SubViews.php | SubViews.getSubView | public function getSubView($name){
if(isset($this->subViews[$name]))
return $this->subViews[$name];
else
return $this->getNewSubView($name);
} | php | public function getSubView($name){
if(isset($this->subViews[$name]))
return $this->subViews[$name];
else
return $this->getNewSubView($name);
} | [
"public",
"function",
"getSubView",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"subViews",
"[",
"$",
"name",
"]",
")",
")",
"return",
"$",
"this",
"->",
"subViews",
"[",
"$",
"name",
"]",
";",
"else",
"return",
"$",
"... | Will return an instance of the Controller required as a subview.
!! A controller can also be initiated throught manually with new <name> but
it might then need manual initialisation
!! since OWeb 0.3.2 this will generate only Singletons.
To get a new instance every time you may create the controller yourself
or use g... | [
"Will",
"return",
"an",
"instance",
"of",
"the",
"Controller",
"required",
"as",
"a",
"subview",
"."
] | fb441f51afb16860b0c946a55c36c789fbb125fa | https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/manage/SubViews.php#L58-L63 |
8,266 | OWeb/OWeb-Framework | OWeb/manage/SubViews.php | SubViews.getNewSubView | public function getNewSubView($name){
try{
$controller = new $name();
if(! ($controller instanceof \OWeb\types\Controller))
throw new \OWeb\manage\exceptions\Controller("The class \"".$name."\" isn't an instance of \OWeb\Types\Controller");
if(!isset($this->subViews[$name]))
$this->subViews[$na... | php | public function getNewSubView($name){
try{
$controller = new $name();
if(! ($controller instanceof \OWeb\types\Controller))
throw new \OWeb\manage\exceptions\Controller("The class \"".$name."\" isn't an instance of \OWeb\Types\Controller");
if(!isset($this->subViews[$name]))
$this->subViews[$na... | [
"public",
"function",
"getNewSubView",
"(",
"$",
"name",
")",
"{",
"try",
"{",
"$",
"controller",
"=",
"new",
"$",
"name",
"(",
")",
";",
"if",
"(",
"!",
"(",
"$",
"controller",
"instanceof",
"\\",
"OWeb",
"\\",
"types",
"\\",
"Controller",
")",
")",... | Will return a new instance of the Controller required as a subview. After
having initialized it.
!! A controller can also be initiated throught manually with new <name> but
it might then need manual initialisation
@param type $name Name of the controller you want to use as a sub view.
@return \Controller The controll... | [
"Will",
"return",
"a",
"new",
"instance",
"of",
"the",
"Controller",
"required",
"as",
"a",
"subview",
".",
"After",
"having",
"initialized",
"it",
"."
] | fb441f51afb16860b0c946a55c36c789fbb125fa | https://github.com/OWeb/OWeb-Framework/blob/fb441f51afb16860b0c946a55c36c789fbb125fa/OWeb/manage/SubViews.php#L76-L93 |
8,267 | tenside/core | src/Util/HomePathDeterminator.php | HomePathDeterminator.detectHomeDirectory | private function detectHomeDirectory()
{
// Environment variable COMPOSER points to the composer.json we should use.
if (false !== ($home = getenv('COMPOSER'))) {
return dirname($home);
}
if ('' !== \Phar::running()) {
// Strip scheme "phar://" prefix and "te... | php | private function detectHomeDirectory()
{
// Environment variable COMPOSER points to the composer.json we should use.
if (false !== ($home = getenv('COMPOSER'))) {
return dirname($home);
}
if ('' !== \Phar::running()) {
// Strip scheme "phar://" prefix and "te... | [
"private",
"function",
"detectHomeDirectory",
"(",
")",
"{",
"// Environment variable COMPOSER points to the composer.json we should use.",
"if",
"(",
"false",
"!==",
"(",
"$",
"home",
"=",
"getenv",
"(",
"'COMPOSER'",
")",
")",
")",
"{",
"return",
"dirname",
"(",
"... | Determine the correct working directory.
@return string
@throws \RuntimeException When the home directory is not /web. | [
"Determine",
"the",
"correct",
"working",
"directory",
"."
] | 56422fa8cdecf03cb431bb6654c2942ade39bf7b | https://github.com/tenside/core/blob/56422fa8cdecf03cb431bb6654c2942ade39bf7b/src/Util/HomePathDeterminator.php#L76-L98 |
8,268 | gossi/trixionary | src/model/Map/SkillDependencyTableMap.php | SkillDependencyTableMap.doInsert | public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(SkillDependencyTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; //... | php | public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(SkillDependencyTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; //... | [
"public",
"static",
"function",
"doInsert",
"(",
"$",
"criteria",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"ge... | Performs an INSERT on the database, given a SkillDependency or Criteria object.
@param mixed $criteria Criteria or SkillDependency object containing data that is used to create the INSERT statement.
@param ConnectionInterface $con the ConnectionInterface connection to use
@return mixed The new ... | [
"Performs",
"an",
"INSERT",
"on",
"the",
"database",
"given",
"a",
"SkillDependency",
"or",
"Criteria",
"object",
"."
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Map/SkillDependencyTableMap.php#L465-L486 |
8,269 | davidyell/CakePHP3-NumbersToWords | src/View/Helper/NumbersToWordsHelper.php | NumbersToWordsHelper.spell | public function spell($item)
{
$formatter = new NumberFormatter($this->config['locale'], NumberFormatter::SPELLOUT);
if (is_int($item)) {
return $formatter->format($item);
}
return preg_replace_callback('/([0-9]+)/', function ($matches) use ($formatter) {
re... | php | public function spell($item)
{
$formatter = new NumberFormatter($this->config['locale'], NumberFormatter::SPELLOUT);
if (is_int($item)) {
return $formatter->format($item);
}
return preg_replace_callback('/([0-9]+)/', function ($matches) use ($formatter) {
re... | [
"public",
"function",
"spell",
"(",
"$",
"item",
")",
"{",
"$",
"formatter",
"=",
"new",
"NumberFormatter",
"(",
"$",
"this",
"->",
"config",
"[",
"'locale'",
"]",
",",
"NumberFormatter",
"::",
"SPELLOUT",
")",
";",
"if",
"(",
"is_int",
"(",
"$",
"item... | Convert a number into a word
@param int|string $item An integer number to convert or a string containing an integer
@return string | [
"Convert",
"a",
"number",
"into",
"a",
"word"
] | 6d4e39bc0d670aa15839eec51c2e6e06d7c7b921 | https://github.com/davidyell/CakePHP3-NumbersToWords/blob/6d4e39bc0d670aa15839eec51c2e6e06d7c7b921/src/View/Helper/NumbersToWordsHelper.php#L34-L45 |
8,270 | davidyell/CakePHP3-NumbersToWords | src/View/Helper/NumbersToWordsHelper.php | NumbersToWordsHelper.ordinal | public function ordinal($item)
{
$formatter = new NumberFormatter($this->config['locale'], NumberFormatter::ORDINAL);
if (is_int($item)) {
return $formatter->format($item);
}
return preg_replace_callback('/([0-9]+)/', function ($matches) use ($formatter) {
r... | php | public function ordinal($item)
{
$formatter = new NumberFormatter($this->config['locale'], NumberFormatter::ORDINAL);
if (is_int($item)) {
return $formatter->format($item);
}
return preg_replace_callback('/([0-9]+)/', function ($matches) use ($formatter) {
r... | [
"public",
"function",
"ordinal",
"(",
"$",
"item",
")",
"{",
"$",
"formatter",
"=",
"new",
"NumberFormatter",
"(",
"$",
"this",
"->",
"config",
"[",
"'locale'",
"]",
",",
"NumberFormatter",
"::",
"ORDINAL",
")",
";",
"if",
"(",
"is_int",
"(",
"$",
"ite... | Convert a number into it's ordinal type
eg, 1 -> 1st, 2 -> 2nd
@param int|string $item An integer number to convert or a string containing a number
@return string | [
"Convert",
"a",
"number",
"into",
"it",
"s",
"ordinal",
"type",
"eg",
"1",
"-",
">",
"1st",
"2",
"-",
">",
"2nd"
] | 6d4e39bc0d670aa15839eec51c2e6e06d7c7b921 | https://github.com/davidyell/CakePHP3-NumbersToWords/blob/6d4e39bc0d670aa15839eec51c2e6e06d7c7b921/src/View/Helper/NumbersToWordsHelper.php#L55-L66 |
8,271 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.ConditionExpr | public function ConditionExpr($Field, $Value, $EscapeFieldSql = TRUE, $EscapeValueSql = TRUE) {
// Change some variables from the old parameter style to the new one.
// THIS PART OF THE FUNCTION SHOULD EVENTUALLY BE REMOVED.
if($EscapeFieldSql === FALSE) {
$Field = '@' . $Field;
}
... | php | public function ConditionExpr($Field, $Value, $EscapeFieldSql = TRUE, $EscapeValueSql = TRUE) {
// Change some variables from the old parameter style to the new one.
// THIS PART OF THE FUNCTION SHOULD EVENTUALLY BE REMOVED.
if($EscapeFieldSql === FALSE) {
$Field = '@' . $Field;
}
... | [
"public",
"function",
"ConditionExpr",
"(",
"$",
"Field",
",",
"$",
"Value",
",",
"$",
"EscapeFieldSql",
"=",
"TRUE",
",",
"$",
"EscapeValueSql",
"=",
"TRUE",
")",
"{",
"// Change some variables from the old parameter style to the new one.",
"// THIS PART OF THE FUNCTION ... | Returns a single Condition Expression for use in a 'where' or an 'on' clause.
@param string $Field The name of the field on the left hand side of the expression.
If $Field ends with an operator, then it used for the comparison. Otherwise '=' will be used.
@param mixed $Value The value on the right side of the expressi... | [
"Returns",
"a",
"single",
"Condition",
"Expression",
"for",
"use",
"in",
"a",
"where",
"or",
"an",
"on",
"clause",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L293-L364 |
8,272 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.Cache | public function Cache($Key, $Operation = NULL, $Options = NULL) {
if (!$Key) {
$this->_CacheKey = NULL;
$this->_CacheOperation = NULL;
$this->_CacheOptions = NULL;
return $this;
}
$this->_CacheKey = $Key;
if (!is_null($Operation))
$this->_Cac... | php | public function Cache($Key, $Operation = NULL, $Options = NULL) {
if (!$Key) {
$this->_CacheKey = NULL;
$this->_CacheOperation = NULL;
$this->_CacheOptions = NULL;
return $this;
}
$this->_CacheKey = $Key;
if (!is_null($Operation))
$this->_Cac... | [
"public",
"function",
"Cache",
"(",
"$",
"Key",
",",
"$",
"Operation",
"=",
"NULL",
",",
"$",
"Options",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"$",
"Key",
")",
"{",
"$",
"this",
"->",
"_CacheKey",
"=",
"NULL",
";",
"$",
"this",
"->",
"_CacheOper... | Set the cache key for this transaction
@param string|array $Key The cache key (or array of keys) that this query will save into.
@param string $Operation The cache operation as a hint to the db.
@param array $Options The cache options as passed into Gdn_Cache::Store().
@return Gdn_SQLDriver $this | [
"Set",
"the",
"cache",
"key",
"for",
"this",
"transaction"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L374-L392 |
8,273 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.Delete | public function Delete($Table = '', $Where = '', $Limit = FALSE) {
if ($Table == '') {
if (!isset($this->_Froms[0]))
return FALSE;
$Table = $this->_Froms[0];
} elseif (is_array($Table)) {
foreach ($Table as $t) {
$this->Delete($t, $Where, $Limit, FALSE);
... | php | public function Delete($Table = '', $Where = '', $Limit = FALSE) {
if ($Table == '') {
if (!isset($this->_Froms[0]))
return FALSE;
$Table = $this->_Froms[0];
} elseif (is_array($Table)) {
foreach ($Table as $t) {
$this->Delete($t, $Where, $Limit, FALSE);
... | [
"public",
"function",
"Delete",
"(",
"$",
"Table",
"=",
"''",
",",
"$",
"Where",
"=",
"''",
",",
"$",
"Limit",
"=",
"FALSE",
")",
"{",
"if",
"(",
"$",
"Table",
"==",
"''",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_Froms",
"... | Builds and executes a delete from query.
@param mixed $Table The table (or array of table names) to delete from.
@param mixed $Where The string on the left side of the where comparison, or an associative
array of Field => Value items to compare.
@param int $Limit The number of records to limit the query to. | [
"Builds",
"and",
"executes",
"a",
"delete",
"from",
"query",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L409-L437 |
8,274 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.Distinct | public function Distinct($Bool = TRUE) {
$this->_Distinct = (is_bool($Bool)) ? $Bool : TRUE;
return $this;
} | php | public function Distinct($Bool = TRUE) {
$this->_Distinct = (is_bool($Bool)) ? $Bool : TRUE;
return $this;
} | [
"public",
"function",
"Distinct",
"(",
"$",
"Bool",
"=",
"TRUE",
")",
"{",
"$",
"this",
"->",
"_Distinct",
"=",
"(",
"is_bool",
"(",
"$",
"Bool",
")",
")",
"?",
"$",
"Bool",
":",
"TRUE",
";",
"return",
"$",
"this",
";",
"}"
] | Specifies that the query should be run as a distinct so that duplicate
columns are grouped together. Returns this object for chaining purposes.
@param boolean $Bool A boolean value indicating if the query should be distinct or not. | [
"Specifies",
"that",
"the",
"query",
"should",
"be",
"run",
"as",
"a",
"distinct",
"so",
"that",
"duplicate",
"columns",
"are",
"grouped",
"together",
".",
"Returns",
"this",
"object",
"for",
"chaining",
"purposes",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L445-L448 |
8,275 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.EmptyTable | public function EmptyTable($Table = '') {
if ($Table == '') {
if (!isset($this->_Froms[0]))
return FALSE;
$Table = $this->_Froms[0];
} else {
$Table = $this->EscapeIdentifier($this->Database->DatabasePrefix.$Table);
}
$Sql = $this->GetDelete($Table);
... | php | public function EmptyTable($Table = '') {
if ($Table == '') {
if (!isset($this->_Froms[0]))
return FALSE;
$Table = $this->_Froms[0];
} else {
$Table = $this->EscapeIdentifier($this->Database->DatabasePrefix.$Table);
}
$Sql = $this->GetDelete($Table);
... | [
"public",
"function",
"EmptyTable",
"(",
"$",
"Table",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"Table",
"==",
"''",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_Froms",
"[",
"0",
"]",
")",
")",
"return",
"FALSE",
";",
"$",
"Table",... | Removes all data from a table.
@param string $Table The table to empty. | [
"Removes",
"all",
"data",
"from",
"a",
"table",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L455-L469 |
8,276 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.FetchTables | public function FetchTables($LimitToPrefix = FALSE) {
$Sql = $this->FetchTableSql($LimitToPrefix);
$Data = $this->Query($Sql);
$Return = array();
foreach($Data->ResultArray() as $Row) {
if (isset($Row['TABLE_NAME']))
$Return[] = $Row['TABLE_NAME'];
else
... | php | public function FetchTables($LimitToPrefix = FALSE) {
$Sql = $this->FetchTableSql($LimitToPrefix);
$Data = $this->Query($Sql);
$Return = array();
foreach($Data->ResultArray() as $Row) {
if (isset($Row['TABLE_NAME']))
$Return[] = $Row['TABLE_NAME'];
else
... | [
"public",
"function",
"FetchTables",
"(",
"$",
"LimitToPrefix",
"=",
"FALSE",
")",
"{",
"$",
"Sql",
"=",
"$",
"this",
"->",
"FetchTableSql",
"(",
"$",
"LimitToPrefix",
")",
";",
"$",
"Data",
"=",
"$",
"this",
"->",
"Query",
"(",
"$",
"Sql",
")",
";",... | Returns an array containing table names in the database.
@param mixed $LimitToPrefix Whether or not to limit the search to tables with the database prefix or a specific table name. The following types can be given for this parameter:
- <b>TRUE</b>: The search will be limited to the database prefix.
- <b>FALSE</b>: All ... | [
"Returns",
"an",
"array",
"containing",
"table",
"names",
"in",
"the",
"database",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L552-L564 |
8,277 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.Get | public function Get($Table = '', $OrderFields = '', $OrderDirection = 'asc', $Limit = FALSE, $PageNumber = FALSE) {
if ($Table != '') {
//$this->MapAliases($Table);
$this->From($Table);
}
if ($OrderFields != '')
$this->OrderBy($OrderFields, $OrderDirection);
if ($Lim... | php | public function Get($Table = '', $OrderFields = '', $OrderDirection = 'asc', $Limit = FALSE, $PageNumber = FALSE) {
if ($Table != '') {
//$this->MapAliases($Table);
$this->From($Table);
}
if ($OrderFields != '')
$this->OrderBy($OrderFields, $OrderDirection);
if ($Lim... | [
"public",
"function",
"Get",
"(",
"$",
"Table",
"=",
"''",
",",
"$",
"OrderFields",
"=",
"''",
",",
"$",
"OrderDirection",
"=",
"'asc'",
",",
"$",
"Limit",
"=",
"FALSE",
",",
"$",
"PageNumber",
"=",
"FALSE",
")",
"{",
"if",
"(",
"$",
"Table",
"!=",... | Builds the select statement and runs the query, returning a result object.
@param string $Table The table from which to select data. Adds to the $this->_Froms collection.
@param string $OrderFields A string of fields to be ordered.
@param string $OrderDirection The direction of the sort.
@param int $Lim... | [
"Builds",
"the",
"select",
"statement",
"and",
"runs",
"the",
"query",
"returning",
"a",
"result",
"object",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L657-L676 |
8,278 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver._GetIdentifierTokens | protected function _GetIdentifierTokens($Sql) {
$Tokens = preg_split('/`/', $Sql, -1, PREG_SPLIT_DELIM_CAPTURE);
$Result = array();
$InIdent = FALSE;
$CurrentToken = '';
for($i = 0; $i < count($Tokens); $i++) {
$Token = $Tokens[i];
$Result .= $Token;
if($T... | php | protected function _GetIdentifierTokens($Sql) {
$Tokens = preg_split('/`/', $Sql, -1, PREG_SPLIT_DELIM_CAPTURE);
$Result = array();
$InIdent = FALSE;
$CurrentToken = '';
for($i = 0; $i < count($Tokens); $i++) {
$Token = $Tokens[i];
$Result .= $Token;
if($T... | [
"protected",
"function",
"_GetIdentifierTokens",
"(",
"$",
"Sql",
")",
"{",
"$",
"Tokens",
"=",
"preg_split",
"(",
"'/`/'",
",",
"$",
"Sql",
",",
"-",
"1",
",",
"PREG_SPLIT_DELIM_CAPTURE",
")",
";",
"$",
"Result",
"=",
"array",
"(",
")",
";",
"$",
"InI... | A helper function for escaping sql identifiers.
@param string The sql containing identifiers to escape in a different language.
All identifiers requiring escaping should be enclosed in back ticks (`).
@return array All of the tokens in the sql. The tokens that require escaping will still have back ticks. | [
"A",
"helper",
"function",
"for",
"escaping",
"sql",
"identifiers",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L684-L711 |
8,279 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.GetWhere | public function GetWhere($Table = '', $Where = FALSE, $OrderFields = '', $OrderDirection = 'asc', $Limit = FALSE, $Offset = 0) {
if ($Table != '') {
//$this->MapAliases($Table);
$this->From($Table);
}
if ($Where !== FALSE)
$this->Where($Where);
if ($OrderFields != ''... | php | public function GetWhere($Table = '', $Where = FALSE, $OrderFields = '', $OrderDirection = 'asc', $Limit = FALSE, $Offset = 0) {
if ($Table != '') {
//$this->MapAliases($Table);
$this->From($Table);
}
if ($Where !== FALSE)
$this->Where($Where);
if ($OrderFields != ''... | [
"public",
"function",
"GetWhere",
"(",
"$",
"Table",
"=",
"''",
",",
"$",
"Where",
"=",
"FALSE",
",",
"$",
"OrderFields",
"=",
"''",
",",
"$",
"OrderDirection",
"=",
"'asc'",
",",
"$",
"Limit",
"=",
"FALSE",
",",
"$",
"Offset",
"=",
"0",
")",
"{",
... | Builds the select statement and runs the query, returning a result
object. Allows a where clause, limit, and offset to be added directly.
@param string $Table The table from which to select data. Adds to the $this->_Froms collection.
@param mixed $Where Adds to the $this->_Wheres collection using $this->Where();
@par... | [
"Builds",
"the",
"select",
"statement",
"and",
"runs",
"the",
"query",
"returning",
"a",
"result",
"object",
".",
"Allows",
"a",
"where",
"clause",
"limit",
"and",
"offset",
"to",
"be",
"added",
"directly",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L912-L930 |
8,280 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.GetWhereLike | public function GetWhereLike($Table = '', $Like = FALSE, $OrderFields = '', $OrderDirection = 'asc', $Limit = FALSE, $PageNumber = FALSE) {
if ($Table != '') {
$this->MapAliases($Table);
$this->From($Table);
}
if ($Like !== FALSE)
$this->Like($Like);
if ($OrderFields... | php | public function GetWhereLike($Table = '', $Like = FALSE, $OrderFields = '', $OrderDirection = 'asc', $Limit = FALSE, $PageNumber = FALSE) {
if ($Table != '') {
$this->MapAliases($Table);
$this->From($Table);
}
if ($Like !== FALSE)
$this->Like($Like);
if ($OrderFields... | [
"public",
"function",
"GetWhereLike",
"(",
"$",
"Table",
"=",
"''",
",",
"$",
"Like",
"=",
"FALSE",
",",
"$",
"OrderFields",
"=",
"''",
",",
"$",
"OrderDirection",
"=",
"'asc'",
",",
"$",
"Limit",
"=",
"FALSE",
",",
"$",
"PageNumber",
"=",
"FALSE",
"... | Builds the select statement and runs the query, returning a result
object. Allows a like clause, limit, and offset to be added directly.
@param string $Table The table from which to select data. Adds to the $this->_Froms collection.
@param mixed $Like Adds to the $this->_Wheres collection using $this->Like();
@param ... | [
"Builds",
"the",
"select",
"statement",
"and",
"runs",
"the",
"query",
"returning",
"a",
"result",
"object",
".",
"Allows",
"a",
"like",
"clause",
"limit",
"and",
"offset",
"to",
"be",
"added",
"directly",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L943-L966 |
8,281 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.Insert | public function Insert($Table = '', $Set = NULL, $Select = '') {
if (count($Set) == 0 && count($this->_Sets) == 0) {
return FALSE;
}
if (!is_null($Set) && $Select == '' && !array_key_exists(0, $Set)) {
$this->Set($Set);
$Set = $this->_Sets;
}
if ($Table =... | php | public function Insert($Table = '', $Set = NULL, $Select = '') {
if (count($Set) == 0 && count($this->_Sets) == 0) {
return FALSE;
}
if (!is_null($Set) && $Select == '' && !array_key_exists(0, $Set)) {
$this->Set($Set);
$Set = $this->_Sets;
}
if ($Table =... | [
"public",
"function",
"Insert",
"(",
"$",
"Table",
"=",
"''",
",",
"$",
"Set",
"=",
"NULL",
",",
"$",
"Select",
"=",
"''",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"Set",
")",
"==",
"0",
"&&",
"count",
"(",
"$",
"this",
"->",
"_Sets",
")",
"==... | Builds the insert statement and runs the query, returning a result
object.
@param string $Table The table to which data should be inserted.
@param mixed $Set An associative array (or object) of FieldName => Value pairs that should
be inserted, or an array of FieldName values that should have values
inserted from $Sel... | [
"Builds",
"the",
"insert",
"statement",
"and",
"runs",
"the",
"query",
"returning",
"a",
"result",
"object",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L1096-L1117 |
8,282 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.Replace | public function Replace($Table = '', $Set = NULL, $Where, $CheckExisting = FALSE) {
if(count($this->_Sets) > 0) {
foreach($this->_Sets as $Key => $Value) {
if(array_key_exists($Value, $this->_NamedParameters)) {
$Set[$Key] = $this->_NamedParameters[$Value];
unset... | php | public function Replace($Table = '', $Set = NULL, $Where, $CheckExisting = FALSE) {
if(count($this->_Sets) > 0) {
foreach($this->_Sets as $Key => $Value) {
if(array_key_exists($Value, $this->_NamedParameters)) {
$Set[$Key] = $this->_NamedParameters[$Value];
unset... | [
"public",
"function",
"Replace",
"(",
"$",
"Table",
"=",
"''",
",",
"$",
"Set",
"=",
"NULL",
",",
"$",
"Where",
",",
"$",
"CheckExisting",
"=",
"FALSE",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"_Sets",
")",
">",
"0",
")",
"{",
"fo... | Inserts or updates values in the table depending on whether they are already there.
@param string $Table The name of the table to insert/update.
@param array $Set The columns to update.
@param array $Where The columns to find the row to update.
If a row is not found then one is inserted and the items in this array are... | [
"Inserts",
"or",
"updates",
"values",
"in",
"the",
"table",
"depending",
"on",
"whether",
"they",
"are",
"already",
"there",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L1127-L1185 |
8,283 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.MapAliases | public function MapAliases($TableString) {
// Make sure all tables have an alias.
if(strpos($TableString, ' ') === FALSE) {
$TableString .= " `$TableString`";
}
// Map the alias to the alias mapping array
$TableString = trim(preg_replace('/\s+as\s+/i', ' ', $TableString));
... | php | public function MapAliases($TableString) {
// Make sure all tables have an alias.
if(strpos($TableString, ' ') === FALSE) {
$TableString .= " `$TableString`";
}
// Map the alias to the alias mapping array
$TableString = trim(preg_replace('/\s+as\s+/i', ' ', $TableString));
... | [
"public",
"function",
"MapAliases",
"(",
"$",
"TableString",
")",
"{",
"// Make sure all tables have an alias.",
"if",
"(",
"strpos",
"(",
"$",
"TableString",
",",
"' '",
")",
"===",
"FALSE",
")",
"{",
"$",
"TableString",
".=",
"\" `$TableString`\"",
";",
"}",
... | Takes a provided table specification and parses out any table aliases
provided, placing them in an alias mapping array. Returns the table
specification with any table prefix prepended.
@param string $TableString The string specification of the table. ie.
"tbl_User as u" or "user u".
@return string | [
"Takes",
"a",
"provided",
"table",
"specification",
"and",
"parses",
"out",
"any",
"table",
"aliases",
"provided",
"placing",
"them",
"in",
"an",
"alias",
"mapping",
"array",
".",
"Returns",
"the",
"table",
"specification",
"with",
"any",
"table",
"prefix",
"p... | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L1294-L1316 |
8,284 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.NamedParameter | public function NamedParameter($Name, $CreateNew = FALSE, $Value = NULL) {
// Format the parameter name so it is safe for sql
$NiceName = ':'.preg_replace('/([^\w\d_-])/', '', $Name); // Removes everything from the string except letters, numbers, dashes, and underscores
if($CreateNew) {
// M... | php | public function NamedParameter($Name, $CreateNew = FALSE, $Value = NULL) {
// Format the parameter name so it is safe for sql
$NiceName = ':'.preg_replace('/([^\w\d_-])/', '', $Name); // Removes everything from the string except letters, numbers, dashes, and underscores
if($CreateNew) {
// M... | [
"public",
"function",
"NamedParameter",
"(",
"$",
"Name",
",",
"$",
"CreateNew",
"=",
"FALSE",
",",
"$",
"Value",
"=",
"NULL",
")",
"{",
"// Format the parameter name so it is safe for sql",
"$",
"NiceName",
"=",
"':'",
".",
"preg_replace",
"(",
"'/([^\\w\\d_-])/'... | Takes a parameter name and makes sure it is cleaned up to be used as a
named parameter in a pdo prepared statement.
@param string $Name The name of the parameter to cleanup
@param boolean $CreateNew Wether or not this is a new or existing parameter.
@return string The cleaned up named parameter name. | [
"Takes",
"a",
"parameter",
"name",
"and",
"makes",
"sure",
"it",
"is",
"cleaned",
"up",
"to",
"be",
"used",
"as",
"a",
"named",
"parameter",
"in",
"a",
"pdo",
"prepared",
"statement",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L1333-L1353 |
8,285 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver._ParseExpr | protected function _ParseExpr($Expr, $Name = NULL, $EscapeExpr = FALSE) {
$Result = '';
$C = substr($Expr, 0, 1);
if($C === '=' && $EscapeExpr === FALSE) {
// This is a function call. Each parameter has to be parsed.
$FunctionArray = preg_split('/(\[[^\]]+\])/', substr(... | php | protected function _ParseExpr($Expr, $Name = NULL, $EscapeExpr = FALSE) {
$Result = '';
$C = substr($Expr, 0, 1);
if($C === '=' && $EscapeExpr === FALSE) {
// This is a function call. Each parameter has to be parsed.
$FunctionArray = preg_split('/(\[[^\]]+\])/', substr(... | [
"protected",
"function",
"_ParseExpr",
"(",
"$",
"Expr",
",",
"$",
"Name",
"=",
"NULL",
",",
"$",
"EscapeExpr",
"=",
"FALSE",
")",
"{",
"$",
"Result",
"=",
"''",
";",
"$",
"C",
"=",
"substr",
"(",
"$",
"Expr",
",",
"0",
",",
"1",
")",
";",
"if"... | Parses an expression for use in where clauses.
@param string $Expr The expression to parse.
@param string $Name A name to give the parameter if $Expr becomes a named parameter.
@return string The parsed expression. | [
"Parses",
"an",
"expression",
"for",
"use",
"in",
"where",
"clauses",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L1525-L1565 |
8,286 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.PrefixTable | public function PrefixTable($Table) {
$Prefix = $this->Database->DatabasePrefix;
if ($Prefix != '' && substr($Table, 0, strlen($Prefix)) != $Prefix)
$Table = $Prefix.$Table;
return $Table;
} | php | public function PrefixTable($Table) {
$Prefix = $this->Database->DatabasePrefix;
if ($Prefix != '' && substr($Table, 0, strlen($Prefix)) != $Prefix)
$Table = $Prefix.$Table;
return $Table;
} | [
"public",
"function",
"PrefixTable",
"(",
"$",
"Table",
")",
"{",
"$",
"Prefix",
"=",
"$",
"this",
"->",
"Database",
"->",
"DatabasePrefix",
";",
"if",
"(",
"$",
"Prefix",
"!=",
"''",
"&&",
"substr",
"(",
"$",
"Table",
",",
"0",
",",
"strlen",
"(",
... | Prefixes a table with the database prefix if it is not already there.
@param string $Table The table name to prefix. | [
"Prefixes",
"a",
"table",
"with",
"the",
"database",
"prefix",
"if",
"it",
"is",
"not",
"already",
"there",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L1588-L1595 |
8,287 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.Put | public function Put($Table = '', $Set = NULL, $Where = FALSE, $Limit = FALSE) {
$this->Update($Table, $Set, $Where, $Limit);
if (count($this->_Sets) == 0 || !isset($this->_Froms[0])) {
$this->Reset();
return FALSE;
}
$Sql = $this->GetUpdate($this->_Froms, $this->_Sets, $this-... | php | public function Put($Table = '', $Set = NULL, $Where = FALSE, $Limit = FALSE) {
$this->Update($Table, $Set, $Where, $Limit);
if (count($this->_Sets) == 0 || !isset($this->_Froms[0])) {
$this->Reset();
return FALSE;
}
$Sql = $this->GetUpdate($this->_Froms, $this->_Sets, $this-... | [
"public",
"function",
"Put",
"(",
"$",
"Table",
"=",
"''",
",",
"$",
"Set",
"=",
"NULL",
",",
"$",
"Where",
"=",
"FALSE",
",",
"$",
"Limit",
"=",
"FALSE",
")",
"{",
"$",
"this",
"->",
"Update",
"(",
"$",
"Table",
",",
"$",
"Set",
",",
"$",
"W... | Builds the update statement and runs the query, returning a result object.
@param string $Table The table to which data should be updated.
@param mixed $Set An array of $FieldName => $Value pairs, or an object of $DataSet->Field
properties containing one rowset.
@param string $Where Adds to the $this->_Wheres collect... | [
"Builds",
"the",
"update",
"statement",
"and",
"runs",
"the",
"query",
"returning",
"a",
"result",
"object",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L1606-L1618 |
8,288 | bishopb/vanilla | library/database/class.sqldriver.php | Gdn_SQLDriver.SelectCase | public function SelectCase($Field, $Options, $Alias) {
$CaseOptions = '';
foreach ($Options as $Key => $Val) {
if ($Key == '')
$CaseOptions .= ' else ' . $Val;
else
$CaseOptions .= ' when ' . $Key . ' then ' . $Val;
}
$Expr = array('Field' => $Fie... | php | public function SelectCase($Field, $Options, $Alias) {
$CaseOptions = '';
foreach ($Options as $Key => $Val) {
if ($Key == '')
$CaseOptions .= ' else ' . $Val;
else
$CaseOptions .= ' when ' . $Key . ' then ' . $Val;
}
$Expr = array('Field' => $Fie... | [
"public",
"function",
"SelectCase",
"(",
"$",
"Field",
",",
"$",
"Options",
",",
"$",
"Alias",
")",
"{",
"$",
"CaseOptions",
"=",
"''",
";",
"foreach",
"(",
"$",
"Options",
"as",
"$",
"Key",
"=>",
"$",
"Val",
")",
"{",
"if",
"(",
"$",
"Key",
"=="... | Allows the specification of a case statement in the select list.
@param string $Field The field being examined in the case statement.
@param array $Options The options and results in an associative array. A
blank key will be the final "else" option of the case statement. eg.
array('null' => 1, '' => 0) results in "whe... | [
"Allows",
"the",
"specification",
"of",
"a",
"case",
"statement",
"in",
"the",
"select",
"list",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/database/class.sqldriver.php#L1768-L1785 |
8,289 | synapsestudios/synapse-base | src/Synapse/Controller/ControllerServiceProvider.php | ControllerServiceProvider.register | public function register(Application $app)
{
$app['resolver'] = $app->share($app->extend('resolver', function ($resolver, $app) {
return new Resolver($resolver, $app);
}));
$app->initializer(
'Synapse\\Application\\UrlGeneratorAwareInterface',
function ($... | php | public function register(Application $app)
{
$app['resolver'] = $app->share($app->extend('resolver', function ($resolver, $app) {
return new Resolver($resolver, $app);
}));
$app->initializer(
'Synapse\\Application\\UrlGeneratorAwareInterface',
function ($... | [
"public",
"function",
"register",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'resolver'",
"]",
"=",
"$",
"app",
"->",
"share",
"(",
"$",
"app",
"->",
"extend",
"(",
"'resolver'",
",",
"function",
"(",
"$",
"resolver",
",",
"$",
"app"... | Register the controller resolver and initializers
@param Application $app | [
"Register",
"the",
"controller",
"resolver",
"and",
"initializers"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Controller/ControllerServiceProvider.php#L15-L36 |
8,290 | Innmind/RestBundle | Client/ServerFactory.php | ServerFactory.make | public function make($host)
{
$host = $this->resolver->resolve($host, '/');
$hash = md5($host);
if (isset($this->instances[$hash])) {
return $this->instances[$hash];
}
$validator = new Validator(
$this->validator,
new ResourceNormalizer
... | php | public function make($host)
{
$host = $this->resolver->resolve($host, '/');
$hash = md5($host);
if (isset($this->instances[$hash])) {
return $this->instances[$hash];
}
$validator = new Validator(
$this->validator,
new ResourceNormalizer
... | [
"public",
"function",
"make",
"(",
"$",
"host",
")",
"{",
"$",
"host",
"=",
"$",
"this",
"->",
"resolver",
"->",
"resolve",
"(",
"$",
"host",
",",
"'/'",
")",
";",
"$",
"hash",
"=",
"md5",
"(",
"$",
"host",
")",
";",
"if",
"(",
"isset",
"(",
... | Make a server object for the given host
@param string $host
@return Server | [
"Make",
"a",
"server",
"object",
"for",
"the",
"given",
"host"
] | 46de57d9b45dfbfcf98867be3c601fba57f2edc2 | https://github.com/Innmind/RestBundle/blob/46de57d9b45dfbfcf98867be3c601fba57f2edc2/Client/ServerFactory.php#L51-L78 |
8,291 | kambo-1st/KamboRouter | src/Dispatcher/ClosureAutoBind.php | ClosureAutoBind.setNotFoundHandler | public function setNotFoundHandler($handler) : ClosureAutoBind
{
if (!$this->isClosure($handler)) {
throw new InvalidArgumentException(
'Handler must be closure'
);
}
$this->notFoundHandler = $handler;
return $this;
} | php | public function setNotFoundHandler($handler) : ClosureAutoBind
{
if (!$this->isClosure($handler)) {
throw new InvalidArgumentException(
'Handler must be closure'
);
}
$this->notFoundHandler = $handler;
return $this;
} | [
"public",
"function",
"setNotFoundHandler",
"(",
"$",
"handler",
")",
":",
"ClosureAutoBind",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isClosure",
"(",
"$",
"handler",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Handler must be closure'",
... | Sets not found handler
@param Closure $handler handler that will be excuted if nothing has been
found
@return self for fluent interface
@throws InvalidArgumentException if the provided value is not closure | [
"Sets",
"not",
"found",
"handler"
] | 32ad63ab1c5483714868d5acbbc67beb2f0b1cda | https://github.com/kambo-1st/KamboRouter/blob/32ad63ab1c5483714868d5acbbc67beb2f0b1cda/src/Dispatcher/ClosureAutoBind.php#L82-L93 |
8,292 | kambo-1st/KamboRouter | src/Dispatcher/ClosureAutoBind.php | ClosureAutoBind.getFunctionArguments | private function getFunctionArguments(array $paramMap, array $matches, array $parameters) : array
{
$output = [];
$matches = array_values($matches);
foreach ($parameters as $valueName) {
foreach ($paramMap as $possition => $value) {
if ($value == $valueName[1][0... | php | private function getFunctionArguments(array $paramMap, array $matches, array $parameters) : array
{
$output = [];
$matches = array_values($matches);
foreach ($parameters as $valueName) {
foreach ($paramMap as $possition => $value) {
if ($value == $valueName[1][0... | [
"private",
"function",
"getFunctionArguments",
"(",
"array",
"$",
"paramMap",
",",
"array",
"$",
"matches",
",",
"array",
"$",
"parameters",
")",
":",
"array",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"matches",
"=",
"array_values",
"(",
"$",
"matche... | Get arguments for closure function in proper order
from provided parameters
@param array $paramMap parameter map for getting proper order
@param array $matches parameters from request
@param array $parameters expected parameters from route
@return array Parameters in right order, if there are not any
parametrs a... | [
"Get",
"arguments",
"for",
"closure",
"function",
"in",
"proper",
"order",
"from",
"provided",
"parameters"
] | 32ad63ab1c5483714868d5acbbc67beb2f0b1cda | https://github.com/kambo-1st/KamboRouter/blob/32ad63ab1c5483714868d5acbbc67beb2f0b1cda/src/Dispatcher/ClosureAutoBind.php#L120-L134 |
8,293 | kambo-1st/KamboRouter | src/Dispatcher/ClosureAutoBind.php | ClosureAutoBind.getFunctionArgumentsNames | private function getFunctionArgumentsNames($closure) : array
{
$result = [];
$closureReflection = new ReflectionFunction($closure);
foreach ($closureReflection->getParameters() as $param) {
$result[] = $param->name;
}
return $result;
} | php | private function getFunctionArgumentsNames($closure) : array
{
$result = [];
$closureReflection = new ReflectionFunction($closure);
foreach ($closureReflection->getParameters() as $param) {
$result[] = $param->name;
}
return $result;
} | [
"private",
"function",
"getFunctionArgumentsNames",
"(",
"$",
"closure",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"closureReflection",
"=",
"new",
"ReflectionFunction",
"(",
"$",
"closure",
")",
";",
"foreach",
"(",
"$",
"closureReflec... | Get name of parameters for provided closure
@param \Closure $closure
@return array | [
"Get",
"name",
"of",
"parameters",
"for",
"provided",
"closure"
] | 32ad63ab1c5483714868d5acbbc67beb2f0b1cda | https://github.com/kambo-1st/KamboRouter/blob/32ad63ab1c5483714868d5acbbc67beb2f0b1cda/src/Dispatcher/ClosureAutoBind.php#L143-L154 |
8,294 | koinephp/Mvc | lib/Koine/Mvc/View.php | View.renderWithLayout | public function renderWithLayout($template, array $localVariables = array())
{
$this->addData(array(
'localVariables' => $localVariables,
'view' => $template,
));
return $this->render($this->getLayout(), $localVariables);
} | php | public function renderWithLayout($template, array $localVariables = array())
{
$this->addData(array(
'localVariables' => $localVariables,
'view' => $template,
));
return $this->render($this->getLayout(), $localVariables);
} | [
"public",
"function",
"renderWithLayout",
"(",
"$",
"template",
",",
"array",
"$",
"localVariables",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"addData",
"(",
"array",
"(",
"'localVariables'",
"=>",
"$",
"localVariables",
",",
"'view'",
"=>",
"$... | Renders with layout
@param string $template
@param array $localVariables | [
"Renders",
"with",
"layout"
] | 2c018f2638ea08d82dec3002c0c81a863be2e194 | https://github.com/koinephp/Mvc/blob/2c018f2638ea08d82dec3002c0c81a863be2e194/lib/Koine/Mvc/View.php#L56-L64 |
8,295 | webriq/core | module/Customize/src/Grid/Customize/Model/CssParser.php | CssParser.parse | public function parse( $file )
{
if ( ! is_file( $file ) || ! is_readable( $file ) )
{
return null;
}
$sheet = new Sheet\Structure();
$this->buffer = @ file_get_contents( $file );
$this->acceptBom();
while ( ! empty( $this->buffer ) )
{
... | php | public function parse( $file )
{
if ( ! is_file( $file ) || ! is_readable( $file ) )
{
return null;
}
$sheet = new Sheet\Structure();
$this->buffer = @ file_get_contents( $file );
$this->acceptBom();
while ( ! empty( $this->buffer ) )
{
... | [
"public",
"function",
"parse",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"is_file",
"(",
"$",
"file",
")",
"||",
"!",
"is_readable",
"(",
"$",
"file",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"sheet",
"=",
"new",
"Sheet",
"\\",
"Structur... | Parse a css file
@param string $file
@return \Customize\Model\Sheet\Structure | [
"Parse",
"a",
"css",
"file"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Model/CssParser.php#L41-L58 |
8,296 | webriq/core | module/Customize/src/Grid/Customize/Model/CssParser.php | CssParser.acceptWhiteSpace | public function acceptWhiteSpace( $additional = '' )
{
$this->buffer = ltrim( $this->buffer, self::WHITE_SPACE . $additional );
while ( substr( $this->buffer, 0, 2 ) == '/*' )
{
$this->buffer = ltrim(
preg_replace( '#/\*.*?\*/s#', '', $this->buffer ),
... | php | public function acceptWhiteSpace( $additional = '' )
{
$this->buffer = ltrim( $this->buffer, self::WHITE_SPACE . $additional );
while ( substr( $this->buffer, 0, 2 ) == '/*' )
{
$this->buffer = ltrim(
preg_replace( '#/\*.*?\*/s#', '', $this->buffer ),
... | [
"public",
"function",
"acceptWhiteSpace",
"(",
"$",
"additional",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"buffer",
"=",
"ltrim",
"(",
"$",
"this",
"->",
"buffer",
",",
"self",
"::",
"WHITE_SPACE",
".",
"$",
"additional",
")",
";",
"while",
"(",
"subst... | Accept white-space & comments
@param string $additional
@return void | [
"Accept",
"white",
"-",
"space",
"&",
"comments"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Model/CssParser.php#L76-L87 |
8,297 | movicon/movicon-http | src/http/request/RequestCookie.php | RequestCookie.get | public static function get($name, $options = [])
{
$default = isset($options["default"]) ? $options["default"] : null;
return isset($_COOKIE[$name]) ? $_COOKIE[$name] : $default;
} | php | public static function get($name, $options = [])
{
$default = isset($options["default"]) ? $options["default"] : null;
return isset($_COOKIE[$name]) ? $_COOKIE[$name] : $default;
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"name",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"default",
"=",
"isset",
"(",
"$",
"options",
"[",
"\"default\"",
"]",
")",
"?",
"$",
"options",
"[",
"\"default\"",
"]",
":",
"null",
";",
... | Gets a cookie.
Example:
// gets a cookie and returns '123' if the cookie does not exist
$token = RequestCookie::get("token", ["default" => "123"]);
@param string $name Cookie name
@param array $options Options (not required)
@return mixed|null | [
"Gets",
"a",
"cookie",
"."
] | ae9e4aa763c52f272c628fef0ec4496478312355 | https://github.com/movicon/movicon-http/blob/ae9e4aa763c52f272c628fef0ec4496478312355/src/http/request/RequestCookie.php#L19-L24 |
8,298 | robertasproniu/tic-tac-toe-agent | src/Board.php | Board.setBoard | public function setBoard(array $board)
{
if (empty($board)) {
return false;
}
// is not associative array and total size of array is not the same as board size then invalidate board
if (($boardSize = count($board, COUNT_RECURSIVE)) == count($board) && $boardSize != pow($... | php | public function setBoard(array $board)
{
if (empty($board)) {
return false;
}
// is not associative array and total size of array is not the same as board size then invalidate board
if (($boardSize = count($board, COUNT_RECURSIVE)) == count($board) && $boardSize != pow($... | [
"public",
"function",
"setBoard",
"(",
"array",
"$",
"board",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"board",
")",
")",
"{",
"return",
"false",
";",
"}",
"// is not associative array and total size of array is not the same as board size then invalidate board",
"if",
... | Set Board Values
@param array $board
@return array
@throws \Exception | [
"Set",
"Board",
"Values"
] | 00bc8e31e3c9770f2ee24d97d82e40dff20e3e98 | https://github.com/robertasproniu/tic-tac-toe-agent/blob/00bc8e31e3c9770f2ee24d97d82e40dff20e3e98/src/Board.php#L28-L53 |
8,299 | robertasproniu/tic-tac-toe-agent | src/Board.php | Board.setValue | public function setValue(array $position, $value)
{
if (!$this->validatePosition($position)) {
return false;
}
list ($xPos, $yPos) = $position;
if (!empty($this->board[$xPos][$yPos])) {
return false;
}
$this->board[$xPos][$yPos] = $value;
... | php | public function setValue(array $position, $value)
{
if (!$this->validatePosition($position)) {
return false;
}
list ($xPos, $yPos) = $position;
if (!empty($this->board[$xPos][$yPos])) {
return false;
}
$this->board[$xPos][$yPos] = $value;
... | [
"public",
"function",
"setValue",
"(",
"array",
"$",
"position",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validatePosition",
"(",
"$",
"position",
")",
")",
"{",
"return",
"false",
";",
"}",
"list",
"(",
"$",
"xPos",
",",
"$... | Set value to a particular position on board
@param array $position
@param $value
@ | [
"Set",
"value",
"to",
"a",
"particular",
"position",
"on",
"board"
] | 00bc8e31e3c9770f2ee24d97d82e40dff20e3e98 | https://github.com/robertasproniu/tic-tac-toe-agent/blob/00bc8e31e3c9770f2ee24d97d82e40dff20e3e98/src/Board.php#L86-L100 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.