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 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
CatsSystem/swoole-etcd | etcd/AuthClient.php | AuthClient.UserGrantRole | public function UserGrantRole(AuthUserGrantRoleRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/UserGrantRole',
$argument,
['\Etcdserverpb\AuthUserGrantRoleResponse', 'decode'],
$metadata, $options);
} | php | public function UserGrantRole(AuthUserGrantRoleRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/UserGrantRole',
$argument,
['\Etcdserverpb\AuthUserGrantRoleResponse', 'decode'],
$metadata, $options);
} | [
"public",
"function",
"UserGrantRole",
"(",
"AuthUserGrantRoleRequest",
"$",
"argument",
",",
"$",
"metadata",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"_simpleRequest",
"(",
"'/etcdserverpb.Auth/UserGrantRole'",
... | UserGrant grants a role to a specified user.
@param AuthUserGrantRoleRequest $argument input argument
@param array $metadata metadata
@param array $options call options
@return UnaryCall | [
"UserGrant",
"grants",
"a",
"role",
"to",
"a",
"specified",
"user",
"."
] | 9fe824bbcc39a1cc1609b22ffa030287e7e8912d | https://github.com/CatsSystem/swoole-etcd/blob/9fe824bbcc39a1cc1609b22ffa030287e7e8912d/etcd/AuthClient.php#L177-L184 | train |
CatsSystem/swoole-etcd | etcd/AuthClient.php | AuthClient.UserRevokeRole | public function UserRevokeRole(AuthUserRevokeRoleRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/UserRevokeRole',
$argument,
['\Etcdserverpb\AuthUserRevokeRoleResponse', 'decode'],
$metadata, $options);
} | php | public function UserRevokeRole(AuthUserRevokeRoleRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/UserRevokeRole',
$argument,
['\Etcdserverpb\AuthUserRevokeRoleResponse', 'decode'],
$metadata, $options);
} | [
"public",
"function",
"UserRevokeRole",
"(",
"AuthUserRevokeRoleRequest",
"$",
"argument",
",",
"$",
"metadata",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"_simpleRequest",
"(",
"'/etcdserverpb.Auth/UserRevokeRole'... | UserRevokeRole revokes a role of specified user.
@param AuthUserRevokeRoleRequest $argument input argument
@param array $metadata metadata
@param array $options call options
@return UnaryCall | [
"UserRevokeRole",
"revokes",
"a",
"role",
"of",
"specified",
"user",
"."
] | 9fe824bbcc39a1cc1609b22ffa030287e7e8912d | https://github.com/CatsSystem/swoole-etcd/blob/9fe824bbcc39a1cc1609b22ffa030287e7e8912d/etcd/AuthClient.php#L193-L200 | train |
CatsSystem/swoole-etcd | etcd/AuthClient.php | AuthClient.RoleAdd | public function RoleAdd(AuthRoleAddRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleAdd',
$argument,
['\Etcdserverpb\AuthRoleAddResponse', 'decode'],
$metadata, $options);
} | php | public function RoleAdd(AuthRoleAddRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleAdd',
$argument,
['\Etcdserverpb\AuthRoleAddResponse', 'decode'],
$metadata, $options);
} | [
"public",
"function",
"RoleAdd",
"(",
"AuthRoleAddRequest",
"$",
"argument",
",",
"$",
"metadata",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"_simpleRequest",
"(",
"'/etcdserverpb.Auth/RoleAdd'",
",",
"$",
"a... | RoleAdd adds a new role.
@param AuthRoleAddRequest $argument input argument
@param array $metadata metadata
@param array $options call options
@return UnaryCall | [
"RoleAdd",
"adds",
"a",
"new",
"role",
"."
] | 9fe824bbcc39a1cc1609b22ffa030287e7e8912d | https://github.com/CatsSystem/swoole-etcd/blob/9fe824bbcc39a1cc1609b22ffa030287e7e8912d/etcd/AuthClient.php#L209-L216 | train |
CatsSystem/swoole-etcd | etcd/AuthClient.php | AuthClient.RoleGet | public function RoleGet(AuthRoleGetRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleGet',
$argument,
['\Etcdserverpb\AuthRoleGetResponse', 'decode'],
$metadata, $options);
} | php | public function RoleGet(AuthRoleGetRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleGet',
$argument,
['\Etcdserverpb\AuthRoleGetResponse', 'decode'],
$metadata, $options);
} | [
"public",
"function",
"RoleGet",
"(",
"AuthRoleGetRequest",
"$",
"argument",
",",
"$",
"metadata",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"_simpleRequest",
"(",
"'/etcdserverpb.Auth/RoleGet'",
",",
"$",
"a... | RoleGet gets detailed role information.
@param AuthRoleGetRequest $argument input argument
@param array $metadata metadata
@param array $options call options
@return UnaryCall | [
"RoleGet",
"gets",
"detailed",
"role",
"information",
"."
] | 9fe824bbcc39a1cc1609b22ffa030287e7e8912d | https://github.com/CatsSystem/swoole-etcd/blob/9fe824bbcc39a1cc1609b22ffa030287e7e8912d/etcd/AuthClient.php#L225-L232 | train |
CatsSystem/swoole-etcd | etcd/AuthClient.php | AuthClient.RoleList | public function RoleList(AuthRoleListRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleList',
$argument,
['\Etcdserverpb\AuthRoleListResponse', 'decode'],
$metadata, $options);
} | php | public function RoleList(AuthRoleListRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleList',
$argument,
['\Etcdserverpb\AuthRoleListResponse', 'decode'],
$metadata, $options);
} | [
"public",
"function",
"RoleList",
"(",
"AuthRoleListRequest",
"$",
"argument",
",",
"$",
"metadata",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"_simpleRequest",
"(",
"'/etcdserverpb.Auth/RoleList'",
",",
"$",
... | RoleList gets lists of all roles.
@param AuthRoleListRequest $argument input argument
@param array $metadata metadata
@param array $options call options
@return UnaryCall | [
"RoleList",
"gets",
"lists",
"of",
"all",
"roles",
"."
] | 9fe824bbcc39a1cc1609b22ffa030287e7e8912d | https://github.com/CatsSystem/swoole-etcd/blob/9fe824bbcc39a1cc1609b22ffa030287e7e8912d/etcd/AuthClient.php#L241-L248 | train |
CatsSystem/swoole-etcd | etcd/AuthClient.php | AuthClient.RoleDelete | public function RoleDelete(AuthRoleDeleteRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleDelete',
$argument,
['\Etcdserverpb\AuthRoleDeleteResponse', 'decode'],
$metadata, $options);
} | php | public function RoleDelete(AuthRoleDeleteRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleDelete',
$argument,
['\Etcdserverpb\AuthRoleDeleteResponse', 'decode'],
$metadata, $options);
} | [
"public",
"function",
"RoleDelete",
"(",
"AuthRoleDeleteRequest",
"$",
"argument",
",",
"$",
"metadata",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"_simpleRequest",
"(",
"'/etcdserverpb.Auth/RoleDelete'",
",",
... | RoleDelete deletes a specified role.
@param AuthRoleDeleteRequest $argument input argument
@param array $metadata metadata
@param array $options call options
@return UnaryCall | [
"RoleDelete",
"deletes",
"a",
"specified",
"role",
"."
] | 9fe824bbcc39a1cc1609b22ffa030287e7e8912d | https://github.com/CatsSystem/swoole-etcd/blob/9fe824bbcc39a1cc1609b22ffa030287e7e8912d/etcd/AuthClient.php#L257-L264 | train |
CatsSystem/swoole-etcd | etcd/AuthClient.php | AuthClient.RoleGrantPermission | public function RoleGrantPermission(AuthRoleGrantPermissionRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleGrantPermission',
$argument,
['\Etcdserverpb\AuthRoleGrantPermissionResponse', 'decode'],
$metadata, $options);
} | php | public function RoleGrantPermission(AuthRoleGrantPermissionRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleGrantPermission',
$argument,
['\Etcdserverpb\AuthRoleGrantPermissionResponse', 'decode'],
$metadata, $options);
} | [
"public",
"function",
"RoleGrantPermission",
"(",
"AuthRoleGrantPermissionRequest",
"$",
"argument",
",",
"$",
"metadata",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"_simpleRequest",
"(",
"'/etcdserverpb.Auth/RoleG... | RoleGrantPermission grants a permission of a specified key or range to a specified role.
@param AuthRoleGrantPermissionRequest $argument input argument
@param array $metadata metadata
@param array $options call options
@return UnaryCall | [
"RoleGrantPermission",
"grants",
"a",
"permission",
"of",
"a",
"specified",
"key",
"or",
"range",
"to",
"a",
"specified",
"role",
"."
] | 9fe824bbcc39a1cc1609b22ffa030287e7e8912d | https://github.com/CatsSystem/swoole-etcd/blob/9fe824bbcc39a1cc1609b22ffa030287e7e8912d/etcd/AuthClient.php#L273-L280 | train |
CatsSystem/swoole-etcd | etcd/AuthClient.php | AuthClient.RoleRevokePermission | public function RoleRevokePermission(AuthRoleRevokePermissionRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleRevokePermission',
$argument,
['\Etcdserverpb\AuthRoleRevokePermissionResponse', 'decode'],
$metadata, $options);
} | php | public function RoleRevokePermission(AuthRoleRevokePermissionRequest $argument,
$metadata = [], $options = [])
{
return $this->_simpleRequest('/etcdserverpb.Auth/RoleRevokePermission',
$argument,
['\Etcdserverpb\AuthRoleRevokePermissionResponse', 'decode'],
$metadata, $options);
} | [
"public",
"function",
"RoleRevokePermission",
"(",
"AuthRoleRevokePermissionRequest",
"$",
"argument",
",",
"$",
"metadata",
"=",
"[",
"]",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"_simpleRequest",
"(",
"'/etcdserverpb.Auth/Rol... | RoleRevokePermission revokes a key or range permission of a specified role.
@param AuthRoleRevokePermissionRequest $argument input argument
@param array $metadata metadata
@param array $options call options
@return UnaryCall | [
"RoleRevokePermission",
"revokes",
"a",
"key",
"or",
"range",
"permission",
"of",
"a",
"specified",
"role",
"."
] | 9fe824bbcc39a1cc1609b22ffa030287e7e8912d | https://github.com/CatsSystem/swoole-etcd/blob/9fe824bbcc39a1cc1609b22ffa030287e7e8912d/etcd/AuthClient.php#L289-L296 | train |
globalis-ms/puppet-skilled-framework | src/Database/Magic/Model.php | Model.load | public function load($relations)
{
$query = $this->newQuery()->with(
is_string($relations) ? func_get_args() : $relations
);
$query->eagerLoadRelations([$this]);
return $this;
} | php | public function load($relations)
{
$query = $this->newQuery()->with(
is_string($relations) ? func_get_args() : $relations
);
$query->eagerLoadRelations([$this]);
return $this;
} | [
"public",
"function",
"load",
"(",
"$",
"relations",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"newQuery",
"(",
")",
"->",
"with",
"(",
"is_string",
"(",
"$",
"relations",
")",
"?",
"func_get_args",
"(",
")",
":",
"$",
"relations",
")",
";",
... | Eager load relations on the model.
@param array|string $relations
@return $this | [
"Eager",
"load",
"relations",
"on",
"the",
"model",
"."
] | 4bb9ff30a32210f54add1f0e53d4769d26eb3c29 | https://github.com/globalis-ms/puppet-skilled-framework/blob/4bb9ff30a32210f54add1f0e53d4769d26eb3c29/src/Database/Magic/Model.php#L602-L611 | train |
globalis-ms/puppet-skilled-framework | src/Database/Magic/Model.php | Model.freshTimestamp | public function freshTimestamp()
{
$t = microtime(true);
$micro = sprintf("%06d",($t - floor($t)) * 1000000);
return new Carbon(date('Y-m-d H:i:s.'.$micro, $t));
} | php | public function freshTimestamp()
{
$t = microtime(true);
$micro = sprintf("%06d",($t - floor($t)) * 1000000);
return new Carbon(date('Y-m-d H:i:s.'.$micro, $t));
} | [
"public",
"function",
"freshTimestamp",
"(",
")",
"{",
"$",
"t",
"=",
"microtime",
"(",
"true",
")",
";",
"$",
"micro",
"=",
"sprintf",
"(",
"\"%06d\"",
",",
"(",
"$",
"t",
"-",
"floor",
"(",
"$",
"t",
")",
")",
"*",
"1000000",
")",
";",
"return"... | Get a fresh timestamp for the model.
@return \Carbon\Carbon | [
"Get",
"a",
"fresh",
"timestamp",
"for",
"the",
"model",
"."
] | 4bb9ff30a32210f54add1f0e53d4769d26eb3c29 | https://github.com/globalis-ms/puppet-skilled-framework/blob/4bb9ff30a32210f54add1f0e53d4769d26eb3c29/src/Database/Magic/Model.php#L1784-L1789 | train |
protobuf-php/google-protobuf-proto | src/google/protobuf/FileDescriptorProto.php | FileDescriptorProto.addDependency | public function addDependency($value)
{
if ($this->dependency === null) {
$this->dependency = new \Protobuf\ScalarCollection();
}
$this->dependency->add($value);
} | php | public function addDependency($value)
{
if ($this->dependency === null) {
$this->dependency = new \Protobuf\ScalarCollection();
}
$this->dependency->add($value);
} | [
"public",
"function",
"addDependency",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dependency",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"dependency",
"=",
"new",
"\\",
"Protobuf",
"\\",
"ScalarCollection",
"(",
")",
";",
"}",
"$",
... | Add a new element to 'dependency'
@param string $value | [
"Add",
"a",
"new",
"element",
"to",
"dependency"
] | da1827b4a23fccd4eb998a8d4bcd972f2330bc29 | https://github.com/protobuf-php/google-protobuf-proto/blob/da1827b4a23fccd4eb998a8d4bcd972f2330bc29/src/google/protobuf/FileDescriptorProto.php#L206-L213 | train |
protobuf-php/google-protobuf-proto | src/google/protobuf/FileDescriptorProto.php | FileDescriptorProto.addPublicDependency | public function addPublicDependency($value)
{
if ($this->public_dependency === null) {
$this->public_dependency = new \Protobuf\ScalarCollection();
}
$this->public_dependency->add($value);
} | php | public function addPublicDependency($value)
{
if ($this->public_dependency === null) {
$this->public_dependency = new \Protobuf\ScalarCollection();
}
$this->public_dependency->add($value);
} | [
"public",
"function",
"addPublicDependency",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"public_dependency",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"public_dependency",
"=",
"new",
"\\",
"Protobuf",
"\\",
"ScalarCollection",
"(",
")",
... | Add a new element to 'public_dependency'
@param int $value | [
"Add",
"a",
"new",
"element",
"to",
"public_dependency"
] | da1827b4a23fccd4eb998a8d4bcd972f2330bc29 | https://github.com/protobuf-php/google-protobuf-proto/blob/da1827b4a23fccd4eb998a8d4bcd972f2330bc29/src/google/protobuf/FileDescriptorProto.php#L250-L257 | train |
protobuf-php/google-protobuf-proto | src/google/protobuf/FileDescriptorProto.php | FileDescriptorProto.addWeakDependency | public function addWeakDependency($value)
{
if ($this->weak_dependency === null) {
$this->weak_dependency = new \Protobuf\ScalarCollection();
}
$this->weak_dependency->add($value);
} | php | public function addWeakDependency($value)
{
if ($this->weak_dependency === null) {
$this->weak_dependency = new \Protobuf\ScalarCollection();
}
$this->weak_dependency->add($value);
} | [
"public",
"function",
"addWeakDependency",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"weak_dependency",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"weak_dependency",
"=",
"new",
"\\",
"Protobuf",
"\\",
"ScalarCollection",
"(",
")",
";",
... | Add a new element to 'weak_dependency'
@param int $value | [
"Add",
"a",
"new",
"element",
"to",
"weak_dependency"
] | da1827b4a23fccd4eb998a8d4bcd972f2330bc29 | https://github.com/protobuf-php/google-protobuf-proto/blob/da1827b4a23fccd4eb998a8d4bcd972f2330bc29/src/google/protobuf/FileDescriptorProto.php#L294-L301 | train |
protobuf-php/google-protobuf-proto | src/google/protobuf/FileDescriptorProto.php | FileDescriptorProto.addMessageType | public function addMessageType(\google\protobuf\DescriptorProto $value)
{
if ($this->message_type === null) {
$this->message_type = new \Protobuf\MessageCollection();
}
$this->message_type->add($value);
} | php | public function addMessageType(\google\protobuf\DescriptorProto $value)
{
if ($this->message_type === null) {
$this->message_type = new \Protobuf\MessageCollection();
}
$this->message_type->add($value);
} | [
"public",
"function",
"addMessageType",
"(",
"\\",
"google",
"\\",
"protobuf",
"\\",
"DescriptorProto",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"message_type",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"message_type",
"=",
"new",
"\\",
"P... | Add a new element to 'message_type'
@param \google\protobuf\DescriptorProto $value | [
"Add",
"a",
"new",
"element",
"to",
"message_type"
] | da1827b4a23fccd4eb998a8d4bcd972f2330bc29 | https://github.com/protobuf-php/google-protobuf-proto/blob/da1827b4a23fccd4eb998a8d4bcd972f2330bc29/src/google/protobuf/FileDescriptorProto.php#L338-L345 | train |
protobuf-php/google-protobuf-proto | src/google/protobuf/FileDescriptorProto.php | FileDescriptorProto.addEnumType | public function addEnumType(\google\protobuf\EnumDescriptorProto $value)
{
if ($this->enum_type === null) {
$this->enum_type = new \Protobuf\MessageCollection();
}
$this->enum_type->add($value);
} | php | public function addEnumType(\google\protobuf\EnumDescriptorProto $value)
{
if ($this->enum_type === null) {
$this->enum_type = new \Protobuf\MessageCollection();
}
$this->enum_type->add($value);
} | [
"public",
"function",
"addEnumType",
"(",
"\\",
"google",
"\\",
"protobuf",
"\\",
"EnumDescriptorProto",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"enum_type",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"enum_type",
"=",
"new",
"\\",
"Protob... | Add a new element to 'enum_type'
@param \google\protobuf\EnumDescriptorProto $value | [
"Add",
"a",
"new",
"element",
"to",
"enum_type"
] | da1827b4a23fccd4eb998a8d4bcd972f2330bc29 | https://github.com/protobuf-php/google-protobuf-proto/blob/da1827b4a23fccd4eb998a8d4bcd972f2330bc29/src/google/protobuf/FileDescriptorProto.php#L382-L389 | train |
protobuf-php/google-protobuf-proto | src/google/protobuf/FileDescriptorProto.php | FileDescriptorProto.addService | public function addService(\google\protobuf\ServiceDescriptorProto $value)
{
if ($this->service === null) {
$this->service = new \Protobuf\MessageCollection();
}
$this->service->add($value);
} | php | public function addService(\google\protobuf\ServiceDescriptorProto $value)
{
if ($this->service === null) {
$this->service = new \Protobuf\MessageCollection();
}
$this->service->add($value);
} | [
"public",
"function",
"addService",
"(",
"\\",
"google",
"\\",
"protobuf",
"\\",
"ServiceDescriptorProto",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"service",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"service",
"=",
"new",
"\\",
"Protobuf... | Add a new element to 'service'
@param \google\protobuf\ServiceDescriptorProto $value | [
"Add",
"a",
"new",
"element",
"to",
"service"
] | da1827b4a23fccd4eb998a8d4bcd972f2330bc29 | https://github.com/protobuf-php/google-protobuf-proto/blob/da1827b4a23fccd4eb998a8d4bcd972f2330bc29/src/google/protobuf/FileDescriptorProto.php#L426-L433 | train |
protobuf-php/google-protobuf-proto | src/google/protobuf/FileDescriptorProto.php | FileDescriptorProto.addExtension | public function addExtension(\google\protobuf\FieldDescriptorProto $value)
{
if ($this->extension === null) {
$this->extension = new \Protobuf\MessageCollection();
}
$this->extension->add($value);
} | php | public function addExtension(\google\protobuf\FieldDescriptorProto $value)
{
if ($this->extension === null) {
$this->extension = new \Protobuf\MessageCollection();
}
$this->extension->add($value);
} | [
"public",
"function",
"addExtension",
"(",
"\\",
"google",
"\\",
"protobuf",
"\\",
"FieldDescriptorProto",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"extension",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"extension",
"=",
"new",
"\\",
"Prot... | Add a new element to 'extension'
@param \google\protobuf\FieldDescriptorProto $value | [
"Add",
"a",
"new",
"element",
"to",
"extension"
] | da1827b4a23fccd4eb998a8d4bcd972f2330bc29 | https://github.com/protobuf-php/google-protobuf-proto/blob/da1827b4a23fccd4eb998a8d4bcd972f2330bc29/src/google/protobuf/FileDescriptorProto.php#L470-L477 | train |
nanbando/core | src/Core/Server/Command/Ssh/SshConnection.php | SshConnection.execute | public function execute($command, callable $callback = null)
{
$this->login();
return $this->ssh->exec(sprintf('cd %s; %s', $this->directory, $command), $callback);
} | php | public function execute($command, callable $callback = null)
{
$this->login();
return $this->ssh->exec(sprintf('cd %s; %s', $this->directory, $command), $callback);
} | [
"public",
"function",
"execute",
"(",
"$",
"command",
",",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"login",
"(",
")",
";",
"return",
"$",
"this",
"->",
"ssh",
"->",
"exec",
"(",
"sprintf",
"(",
"'cd %s; %s'",
",",
"$",
... | Executes command on connected server.
@param string $command
@param callable|null $callback
@return string | [
"Executes",
"command",
"on",
"connected",
"server",
"."
] | 790f5c6339753bffafb50a846ccb6bab81f26877 | https://github.com/nanbando/core/blob/790f5c6339753bffafb50a846ccb6bab81f26877/src/Core/Server/Command/Ssh/SshConnection.php#L103-L108 | train |
nanbando/core | src/Core/Server/Command/Ssh/SshConnection.php | SshConnection.executeNanbando | public function executeNanbando($command, array $parameter, callable $callback = null)
{
$this->login();
$parameterString = [];
foreach ($parameter as $key => $value) {
if (!is_array($value)) {
$value = [$value];
}
foreach ($value as $item) {
$parameterString[] = trim((is_string($key) ? $key . ' ' : '') . $item);
}
}
return $this->execute(
sprintf('%s %s %s', $this->executable, $command, implode(' ', $parameterString)),
$callback
);
} | php | public function executeNanbando($command, array $parameter, callable $callback = null)
{
$this->login();
$parameterString = [];
foreach ($parameter as $key => $value) {
if (!is_array($value)) {
$value = [$value];
}
foreach ($value as $item) {
$parameterString[] = trim((is_string($key) ? $key . ' ' : '') . $item);
}
}
return $this->execute(
sprintf('%s %s %s', $this->executable, $command, implode(' ', $parameterString)),
$callback
);
} | [
"public",
"function",
"executeNanbando",
"(",
"$",
"command",
",",
"array",
"$",
"parameter",
",",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"login",
"(",
")",
";",
"$",
"parameterString",
"=",
"[",
"]",
";",
"foreach",
"("... | Executes nanbando command on connected server.
@param $command
@param array $parameter
@param callable|null $callback
@return string | [
"Executes",
"nanbando",
"command",
"on",
"connected",
"server",
"."
] | 790f5c6339753bffafb50a846ccb6bab81f26877 | https://github.com/nanbando/core/blob/790f5c6339753bffafb50a846ccb6bab81f26877/src/Core/Server/Command/Ssh/SshConnection.php#L119-L138 | train |
nanbando/core | src/Core/Server/Command/Ssh/SshConnection.php | SshConnection.get | public function get($remoteFile, $localFile)
{
$this->login();
if (!isset($this->ssh)) {
return false;
}
if (!$this->ssh->exec('scp -f ' . escapeshellarg($remoteFile), false)) { // -f = from
return false;
}
$this->sendPacket("\0");
if (!preg_match('#(?<perms>[^ ]+) (?<size>\d+) (?<name>.+)#', rtrim($this->receivePacket()), $info)) {
return false;
}
$this->sendPacket("\0");
$size = 0;
$fp = null;
if ($localFile !== false) {
$fp = @fopen($localFile, 'wb');
if (!$fp) {
return false;
}
}
$progressBar = new ProgressBar($this->output, $info['size']);
$progressBar->setFormat(' %message% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%');
$progressBar->start();
$byteFormatter = new ByteFormatter();
$content = '';
while ($size < $info['size']) {
$data = $this->receivePacket();
// SCP usually seems to split stuff out into 16k chunks
$length = strlen($data);
$size += $length;
$progressBar->advance($length);
$progressBar->setMessage(
sprintf('%s/%s', $byteFormatter->format($size), $byteFormatter->format($info['size']))
);
if (!$fp) {
$content .= $data;
} else {
fwrite($fp, $data);
}
}
$progressBar->finish();
$this->output->writeln('');
$this->closeChannel();
return true;
} | php | public function get($remoteFile, $localFile)
{
$this->login();
if (!isset($this->ssh)) {
return false;
}
if (!$this->ssh->exec('scp -f ' . escapeshellarg($remoteFile), false)) { // -f = from
return false;
}
$this->sendPacket("\0");
if (!preg_match('#(?<perms>[^ ]+) (?<size>\d+) (?<name>.+)#', rtrim($this->receivePacket()), $info)) {
return false;
}
$this->sendPacket("\0");
$size = 0;
$fp = null;
if ($localFile !== false) {
$fp = @fopen($localFile, 'wb');
if (!$fp) {
return false;
}
}
$progressBar = new ProgressBar($this->output, $info['size']);
$progressBar->setFormat(' %message% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%');
$progressBar->start();
$byteFormatter = new ByteFormatter();
$content = '';
while ($size < $info['size']) {
$data = $this->receivePacket();
// SCP usually seems to split stuff out into 16k chunks
$length = strlen($data);
$size += $length;
$progressBar->advance($length);
$progressBar->setMessage(
sprintf('%s/%s', $byteFormatter->format($size), $byteFormatter->format($info['size']))
);
if (!$fp) {
$content .= $data;
} else {
fwrite($fp, $data);
}
}
$progressBar->finish();
$this->output->writeln('');
$this->closeChannel();
return true;
} | [
"public",
"function",
"get",
"(",
"$",
"remoteFile",
",",
"$",
"localFile",
")",
"{",
"$",
"this",
"->",
"login",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"ssh",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",... | Download remote-file and save it to given local-file.
@param string $remoteFile
@param string $localFile
@return bool | [
"Download",
"remote",
"-",
"file",
"and",
"save",
"it",
"to",
"given",
"local",
"-",
"file",
"."
] | 790f5c6339753bffafb50a846ccb6bab81f26877 | https://github.com/nanbando/core/blob/790f5c6339753bffafb50a846ccb6bab81f26877/src/Core/Server/Command/Ssh/SshConnection.php#L148-L207 | train |
nanbando/core | src/Core/Server/Command/Ssh/SshConnection.php | SshConnection.login | private function login()
{
if ($this->loggedIn) {
return;
}
if (array_key_exists('rsakey', $this->sshConfig)) {
$this->loginWithRsaKey();
} elseif (array_key_exists('password', $this->sshConfig)) {
$this->loginWithPassword();
}
$this->loggedIn = $this->validate();
} | php | private function login()
{
if ($this->loggedIn) {
return;
}
if (array_key_exists('rsakey', $this->sshConfig)) {
$this->loginWithRsaKey();
} elseif (array_key_exists('password', $this->sshConfig)) {
$this->loginWithPassword();
}
$this->loggedIn = $this->validate();
} | [
"private",
"function",
"login",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loggedIn",
")",
"{",
"return",
";",
"}",
"if",
"(",
"array_key_exists",
"(",
"'rsakey'",
",",
"$",
"this",
"->",
"sshConfig",
")",
")",
"{",
"$",
"this",
"->",
"loginWithRs... | Executes login to server. | [
"Executes",
"login",
"to",
"server",
"."
] | 790f5c6339753bffafb50a846ccb6bab81f26877 | https://github.com/nanbando/core/blob/790f5c6339753bffafb50a846ccb6bab81f26877/src/Core/Server/Command/Ssh/SshConnection.php#L240-L253 | train |
nanbando/core | src/Core/Server/Command/Ssh/SshConnection.php | SshConnection.loginWithPassword | private function loginWithPassword()
{
$password = $this->sshConfig['password'];
if (!is_string($password)) {
$password = $this->askForPassword(
sprintf(
'Password for %s@%s:%s: ',
$this->sshConfig['username'],
$this->sshConfig['host'],
$this->sshConfig['port']
)
);
}
if (!$this->ssh->login($this->sshConfig['username'], $password)) {
throw new SshLoginException($this->name);
}
return true;
} | php | private function loginWithPassword()
{
$password = $this->sshConfig['password'];
if (!is_string($password)) {
$password = $this->askForPassword(
sprintf(
'Password for %s@%s:%s: ',
$this->sshConfig['username'],
$this->sshConfig['host'],
$this->sshConfig['port']
)
);
}
if (!$this->ssh->login($this->sshConfig['username'], $password)) {
throw new SshLoginException($this->name);
}
return true;
} | [
"private",
"function",
"loginWithPassword",
"(",
")",
"{",
"$",
"password",
"=",
"$",
"this",
"->",
"sshConfig",
"[",
"'password'",
"]",
";",
"if",
"(",
"!",
"is_string",
"(",
"$",
"password",
")",
")",
"{",
"$",
"password",
"=",
"$",
"this",
"->",
"... | Login to server using username and password.
@return bool
@throws SshLoginException | [
"Login",
"to",
"server",
"using",
"username",
"and",
"password",
"."
] | 790f5c6339753bffafb50a846ccb6bab81f26877 | https://github.com/nanbando/core/blob/790f5c6339753bffafb50a846ccb6bab81f26877/src/Core/Server/Command/Ssh/SshConnection.php#L262-L281 | train |
nanbando/core | src/Core/Server/Command/Ssh/SshConnection.php | SshConnection.loginWithRsaKey | private function loginWithRsaKey()
{
$key = new RSA();
$password = $this->sshConfig['rsakey']['password'];
if ($password) {
if (!is_string($password)) {
$password = $this->askForPassword(
sprintf('Password for file "%s": ', $this->sshConfig['rsakey']['file'])
);
}
$key->setPassword($password);
}
$key->loadKey(file_get_contents($this->sshConfig['rsakey']['file']));
if (!$this->ssh->login($this->sshConfig['username'], $key)) {
throw new SshLoginException($this->name);
}
return true;
} | php | private function loginWithRsaKey()
{
$key = new RSA();
$password = $this->sshConfig['rsakey']['password'];
if ($password) {
if (!is_string($password)) {
$password = $this->askForPassword(
sprintf('Password for file "%s": ', $this->sshConfig['rsakey']['file'])
);
}
$key->setPassword($password);
}
$key->loadKey(file_get_contents($this->sshConfig['rsakey']['file']));
if (!$this->ssh->login($this->sshConfig['username'], $key)) {
throw new SshLoginException($this->name);
}
return true;
} | [
"private",
"function",
"loginWithRsaKey",
"(",
")",
"{",
"$",
"key",
"=",
"new",
"RSA",
"(",
")",
";",
"$",
"password",
"=",
"$",
"this",
"->",
"sshConfig",
"[",
"'rsakey'",
"]",
"[",
"'password'",
"]",
";",
"if",
"(",
"$",
"password",
")",
"{",
"i... | Login to server using rsa key-file.
@return bool
@throws SshLoginException | [
"Login",
"to",
"server",
"using",
"rsa",
"key",
"-",
"file",
"."
] | 790f5c6339753bffafb50a846ccb6bab81f26877 | https://github.com/nanbando/core/blob/790f5c6339753bffafb50a846ccb6bab81f26877/src/Core/Server/Command/Ssh/SshConnection.php#L290-L310 | train |
nanbando/core | src/Core/Server/Command/Ssh/SshConnection.php | SshConnection.askForPassword | private function askForPassword($question)
{
$questionHelper = new QuestionHelper();
$question = new Question($question);
$question->setHidden(true);
$question->setHiddenFallback(false);
$password = $questionHelper->ask($this->input, $this->output, $question);
$this->output->writeln('');
return $password;
} | php | private function askForPassword($question)
{
$questionHelper = new QuestionHelper();
$question = new Question($question);
$question->setHidden(true);
$question->setHiddenFallback(false);
$password = $questionHelper->ask($this->input, $this->output, $question);
$this->output->writeln('');
return $password;
} | [
"private",
"function",
"askForPassword",
"(",
"$",
"question",
")",
"{",
"$",
"questionHelper",
"=",
"new",
"QuestionHelper",
"(",
")",
";",
"$",
"question",
"=",
"new",
"Question",
"(",
"$",
"question",
")",
";",
"$",
"question",
"->",
"setHidden",
"(",
... | Uses question helper to ask for password.
@param string $question
@return string | [
"Uses",
"question",
"helper",
"to",
"ask",
"for",
"password",
"."
] | 790f5c6339753bffafb50a846ccb6bab81f26877 | https://github.com/nanbando/core/blob/790f5c6339753bffafb50a846ccb6bab81f26877/src/Core/Server/Command/Ssh/SshConnection.php#L319-L331 | train |
nanbando/core | src/Core/Server/Command/Ssh/SshConnection.php | SshConnection.validate | private function validate()
{
if (!$this->testServer($this->ssh, sprintf('-d "%s"', $this->directory))) {
throw new SshValidateException('Directory does not exists');
}
if (!$this->testServer($this->ssh, sprintf('-x "%s"', $this->executable), $this->directory)) {
throw new SshValidateException('Executable does not exists');
}
return true;
} | php | private function validate()
{
if (!$this->testServer($this->ssh, sprintf('-d "%s"', $this->directory))) {
throw new SshValidateException('Directory does not exists');
}
if (!$this->testServer($this->ssh, sprintf('-x "%s"', $this->executable), $this->directory)) {
throw new SshValidateException('Executable does not exists');
}
return true;
} | [
"private",
"function",
"validate",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"testServer",
"(",
"$",
"this",
"->",
"ssh",
",",
"sprintf",
"(",
"'-d \"%s\"'",
",",
"$",
"this",
"->",
"directory",
")",
")",
")",
"{",
"throw",
"new",
"SshValidat... | Validates ssh connection.
@return bool
@throws SshValidateException | [
"Validates",
"ssh",
"connection",
"."
] | 790f5c6339753bffafb50a846ccb6bab81f26877 | https://github.com/nanbando/core/blob/790f5c6339753bffafb50a846ccb6bab81f26877/src/Core/Server/Command/Ssh/SshConnection.php#L340-L351 | train |
hakanersu/amaran-laravel | src/Xuma/Amaran/AmaranHandler.php | AmaranHandler.create | public function create()
{
$script = "<script>\n\t$(function(){ \n\t\t";
if ($this->click) {
$script .= "\t$('".$this->click[0]."').on('".$this->click[1]."',function(){ \n\t\t\t\t $.amaran(". json_encode($this->amaran).") \n\t\t\t}); \n\t\t});\n\t</script>\n";
} else {
$script .= "$.amaran(".json_encode($this->amaran)."); \n\t });\n</script>\n";
}
if ($this->flash) {
$this->session->flash('amaranjs.content', $script);
} else {
$this->viewBinder->bind($script);
}
} | php | public function create()
{
$script = "<script>\n\t$(function(){ \n\t\t";
if ($this->click) {
$script .= "\t$('".$this->click[0]."').on('".$this->click[1]."',function(){ \n\t\t\t\t $.amaran(". json_encode($this->amaran).") \n\t\t\t}); \n\t\t});\n\t</script>\n";
} else {
$script .= "$.amaran(".json_encode($this->amaran)."); \n\t });\n</script>\n";
}
if ($this->flash) {
$this->session->flash('amaranjs.content', $script);
} else {
$this->viewBinder->bind($script);
}
} | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"script",
"=",
"\"<script>\\n\\t$(function(){ \\n\\t\\t\"",
";",
"if",
"(",
"$",
"this",
"->",
"click",
")",
"{",
"$",
"script",
".=",
"\"\\t$('\"",
".",
"$",
"this",
"->",
"click",
"[",
"0",
"]",
".",
... | Bind AmaranJS to view. | [
"Bind",
"AmaranJS",
"to",
"view",
"."
] | 8c166f3d37307485aa7a2d4becf6718166240297 | https://github.com/hakanersu/amaran-laravel/blob/8c166f3d37307485aa7a2d4becf6718166240297/src/Xuma/Amaran/AmaranHandler.php#L60-L76 | train |
globalis-ms/puppet-skilled-framework | src/Database/Query/Builder.php | Builder.whereSub | protected function whereSub($column, $operator, Closure $callback, $boolean)
{
$type = 'Sub';
$query = $this->newQuery();
// Once we have the query instance we can simply execute it so it can add all
// of the sub-select's conditions to itself, and then we can cache it off
// in the array of where clauses for the "main" parent query instance.
call_user_func($callback, $query);
$this->wheres[] = compact('type', 'column', 'operator', 'query', 'boolean');
$this->addBinding($query->getBindings(), 'where');
return $this;
} | php | protected function whereSub($column, $operator, Closure $callback, $boolean)
{
$type = 'Sub';
$query = $this->newQuery();
// Once we have the query instance we can simply execute it so it can add all
// of the sub-select's conditions to itself, and then we can cache it off
// in the array of where clauses for the "main" parent query instance.
call_user_func($callback, $query);
$this->wheres[] = compact('type', 'column', 'operator', 'query', 'boolean');
$this->addBinding($query->getBindings(), 'where');
return $this;
} | [
"protected",
"function",
"whereSub",
"(",
"$",
"column",
",",
"$",
"operator",
",",
"Closure",
"$",
"callback",
",",
"$",
"boolean",
")",
"{",
"$",
"type",
"=",
"'Sub'",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"newQuery",
"(",
")",
";",
"// Once w... | Add a full sub-select to the query.
@param string $column
@param string $operator
@param \Closure $callback
@param string $boolean
@return $this | [
"Add",
"a",
"full",
"sub",
"-",
"select",
"to",
"the",
"query",
"."
] | 4bb9ff30a32210f54add1f0e53d4769d26eb3c29 | https://github.com/globalis-ms/puppet-skilled-framework/blob/4bb9ff30a32210f54add1f0e53d4769d26eb3c29/src/Database/Query/Builder.php#L759-L775 | train |
globalis-ms/puppet-skilled-framework | src/Database/Query/Builder.php | Builder.whereInSub | protected function whereInSub($column, Closure $callback, $boolean, $not)
{
$type = $not ? 'NotInSub' : 'InSub';
// To create the exists sub-select, we will actually create a query and call the
// provided callback with the query so the developer may set any of the query
// conditions they want for the in clause, then we'll put it in this array.
call_user_func($callback, $query = $this->newQuery());
$this->wheres[] = compact('type', 'column', 'query', 'boolean');
$this->addBinding($query->getBindings(), 'where');
return $this;
} | php | protected function whereInSub($column, Closure $callback, $boolean, $not)
{
$type = $not ? 'NotInSub' : 'InSub';
// To create the exists sub-select, we will actually create a query and call the
// provided callback with the query so the developer may set any of the query
// conditions they want for the in clause, then we'll put it in this array.
call_user_func($callback, $query = $this->newQuery());
$this->wheres[] = compact('type', 'column', 'query', 'boolean');
$this->addBinding($query->getBindings(), 'where');
return $this;
} | [
"protected",
"function",
"whereInSub",
"(",
"$",
"column",
",",
"Closure",
"$",
"callback",
",",
"$",
"boolean",
",",
"$",
"not",
")",
"{",
"$",
"type",
"=",
"$",
"not",
"?",
"'NotInSub'",
":",
"'InSub'",
";",
"// To create the exists sub-select, we will actua... | Add a where in with a sub-select to the query.
@param string $column
@param \Closure $callback
@param string $boolean
@param bool $not
@return $this | [
"Add",
"a",
"where",
"in",
"with",
"a",
"sub",
"-",
"select",
"to",
"the",
"query",
"."
] | 4bb9ff30a32210f54add1f0e53d4769d26eb3c29 | https://github.com/globalis-ms/puppet-skilled-framework/blob/4bb9ff30a32210f54add1f0e53d4769d26eb3c29/src/Database/Query/Builder.php#L937-L951 | train |
globalis-ms/puppet-skilled-framework | src/Database/Query/Builder.php | Builder.whereTime | public function whereTime($column, $operator, $value, $boolean = 'and')
{
return $this->addDateBasedWhere('Time', $column, $operator, $value, $boolean);
} | php | public function whereTime($column, $operator, $value, $boolean = 'and')
{
return $this->addDateBasedWhere('Time', $column, $operator, $value, $boolean);
} | [
"public",
"function",
"whereTime",
"(",
"$",
"column",
",",
"$",
"operator",
",",
"$",
"value",
",",
"$",
"boolean",
"=",
"'and'",
")",
"{",
"return",
"$",
"this",
"->",
"addDateBasedWhere",
"(",
"'Time'",
",",
"$",
"column",
",",
"$",
"operator",
",",... | Add a "where time" statement to the query.
@param string $column
@param string $operator
@param int $value
@param string $boolean
@return \Globalis\PuppetSkilled\Database\Query\Builder|static | [
"Add",
"a",
"where",
"time",
"statement",
"to",
"the",
"query",
"."
] | 4bb9ff30a32210f54add1f0e53d4769d26eb3c29 | https://github.com/globalis-ms/puppet-skilled-framework/blob/4bb9ff30a32210f54add1f0e53d4769d26eb3c29/src/Database/Query/Builder.php#L1066-L1069 | train |
globalis-ms/puppet-skilled-framework | src/Database/Query/Builder.php | Builder.backupFieldsForCount | protected function backupFieldsForCount()
{
foreach (['orders', 'limit', 'offset', 'columns'] as $field) {
$this->backups[$field] = $this->{$field};
$this->{$field} = null;
}
foreach (['order', 'select'] as $key) {
$this->bindingBackups[$key] = $this->bindings[$key];
$this->bindings[$key] = [];
}
} | php | protected function backupFieldsForCount()
{
foreach (['orders', 'limit', 'offset', 'columns'] as $field) {
$this->backups[$field] = $this->{$field};
$this->{$field} = null;
}
foreach (['order', 'select'] as $key) {
$this->bindingBackups[$key] = $this->bindings[$key];
$this->bindings[$key] = [];
}
} | [
"protected",
"function",
"backupFieldsForCount",
"(",
")",
"{",
"foreach",
"(",
"[",
"'orders'",
",",
"'limit'",
",",
"'offset'",
",",
"'columns'",
"]",
"as",
"$",
"field",
")",
"{",
"$",
"this",
"->",
"backups",
"[",
"$",
"field",
"]",
"=",
"$",
"this... | Backup then remove some fields for the pagination count.
@return void | [
"Backup",
"then",
"remove",
"some",
"fields",
"for",
"the",
"pagination",
"count",
"."
] | 4bb9ff30a32210f54add1f0e53d4769d26eb3c29 | https://github.com/globalis-ms/puppet-skilled-framework/blob/4bb9ff30a32210f54add1f0e53d4769d26eb3c29/src/Database/Query/Builder.php#L1662-L1675 | train |
jbouzekri/FileUploaderBundle | EventListener/Upload/UploadListener.php | UploadListener.createFileHistory | protected function createFileHistory(PostPersistEvent $event)
{
// Find original filename in request uploaded file
$files = $event->getRequest()->files->all();
$uploadedFile = array_pop($files);
$originalFileName = $uploadedFile->getClientOriginalName();
// Get generated filename
$fileName = $event->getFile()->getBasename();
// Fill FileHistory object
return $this->fileHistoryManager->createAndSave($fileName, $originalFileName, $event->getType());
} | php | protected function createFileHistory(PostPersistEvent $event)
{
// Find original filename in request uploaded file
$files = $event->getRequest()->files->all();
$uploadedFile = array_pop($files);
$originalFileName = $uploadedFile->getClientOriginalName();
// Get generated filename
$fileName = $event->getFile()->getBasename();
// Fill FileHistory object
return $this->fileHistoryManager->createAndSave($fileName, $originalFileName, $event->getType());
} | [
"protected",
"function",
"createFileHistory",
"(",
"PostPersistEvent",
"$",
"event",
")",
"{",
"// Find original filename in request uploaded file",
"$",
"files",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
"->",
"files",
"->",
"all",
"(",
")",
";",
"$",
"u... | Create a filehistory to retrieve original name and uploading user
@param PostPersistEvent $event
@return FileHistory | [
"Create",
"a",
"filehistory",
"to",
"retrieve",
"original",
"name",
"and",
"uploading",
"user"
] | 592e7ed827eaa4e7f8f6f52947ca5e5a86835f6c | https://github.com/jbouzekri/FileUploaderBundle/blob/592e7ed827eaa4e7f8f6f52947ca5e5a86835f6c/EventListener/Upload/UploadListener.php#L62-L74 | train |
globalis-ms/puppet-skilled-framework | src/Database/Magic/Builder.php | Builder.mergeConstraintsFrom | public function mergeConstraintsFrom(Builder $from)
{
$whereBindings = array_get(
$from->getQuery()->getRawBindings(), 'where', []
);
// Here we have some other query that we want to merge the where constraints from. We will
// copy over any where constraints on the query as well as remove any global scopes the
// query might have removed. Then we will return ourselves with the finished merging.
return $this->withoutGlobalScopes(
$from->removedScopes()
)->mergeWheres(
$from->getQuery()->wheres, $whereBindings
);
} | php | public function mergeConstraintsFrom(Builder $from)
{
$whereBindings = array_get(
$from->getQuery()->getRawBindings(), 'where', []
);
// Here we have some other query that we want to merge the where constraints from. We will
// copy over any where constraints on the query as well as remove any global scopes the
// query might have removed. Then we will return ourselves with the finished merging.
return $this->withoutGlobalScopes(
$from->removedScopes()
)->mergeWheres(
$from->getQuery()->wheres, $whereBindings
);
} | [
"public",
"function",
"mergeConstraintsFrom",
"(",
"Builder",
"$",
"from",
")",
"{",
"$",
"whereBindings",
"=",
"array_get",
"(",
"$",
"from",
"->",
"getQuery",
"(",
")",
"->",
"getRawBindings",
"(",
")",
",",
"'where'",
",",
"[",
"]",
")",
";",
"// Here... | Merge the where constraints from another query to the current query.
@param \Globalis\PuppetSkilled\Database\Magic\Builder $from
@return \Globalis\PuppetSkilled\Database\Magic\Builder|static | [
"Merge",
"the",
"where",
"constraints",
"from",
"another",
"query",
"to",
"the",
"current",
"query",
"."
] | 4bb9ff30a32210f54add1f0e53d4769d26eb3c29 | https://github.com/globalis-ms/puppet-skilled-framework/blob/4bb9ff30a32210f54add1f0e53d4769d26eb3c29/src/Database/Magic/Builder.php#L405-L418 | train |
globalis-ms/puppet-skilled-framework | src/Database/Magic/Builder.php | Builder.firstOr | public function firstOr($columns = ['*'], callable $callback = null)
{
if (is_callable($columns)) {
$callback = $columns;
$columns = ['*'];
}
if (! is_null($model = $this->first($columns))) {
return $model;
}
return call_user_func($callback);
} | php | public function firstOr($columns = ['*'], callable $callback = null)
{
if (is_callable($columns)) {
$callback = $columns;
$columns = ['*'];
}
if (! is_null($model = $this->first($columns))) {
return $model;
}
return call_user_func($callback);
} | [
"public",
"function",
"firstOr",
"(",
"$",
"columns",
"=",
"[",
"'*'",
"]",
",",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"columns",
")",
")",
"{",
"$",
"callback",
"=",
"$",
"columns",
";",
"$",
"colu... | Execute the query and get the first result or call a callback.
@param callable|array $columns
@param callable|null $callback
@return \Globalis\PuppetSkilled\Database\Magic\Model|static|mixed | [
"Execute",
"the",
"query",
"and",
"get",
"the",
"first",
"result",
"or",
"call",
"a",
"callback",
"."
] | 4bb9ff30a32210f54add1f0e53d4769d26eb3c29 | https://github.com/globalis-ms/puppet-skilled-framework/blob/4bb9ff30a32210f54add1f0e53d4769d26eb3c29/src/Database/Magic/Builder.php#L716-L729 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.map | public function map($row){
$class = $this->modelClass;
$model = new $class($this->db, $row, false);
$model->setAttribute('table', $this->table)->setAttribute('pk', $this->pk);
return $model;
} | php | public function map($row){
$class = $this->modelClass;
$model = new $class($this->db, $row, false);
$model->setAttribute('table', $this->table)->setAttribute('pk', $this->pk);
return $model;
} | [
"public",
"function",
"map",
"(",
"$",
"row",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"modelClass",
";",
"$",
"model",
"=",
"new",
"$",
"class",
"(",
"$",
"this",
"->",
"db",
",",
"$",
"row",
",",
"false",
")",
";",
"$",
"model",
"->",
... | Map array to model
@param array $row
@return \Ark\Database\Model | [
"Map",
"array",
"to",
"model"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L83-L88 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.mapModels | public function mapModels($rows){
$rst = array();
foreach($rows as $row){
$rst[] = $this->map($row);
}
return $rst;
} | php | public function mapModels($rows){
$rst = array();
foreach($rows as $row){
$rst[] = $this->map($row);
}
return $rst;
} | [
"public",
"function",
"mapModels",
"(",
"$",
"rows",
")",
"{",
"$",
"rst",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"rows",
"as",
"$",
"row",
")",
"{",
"$",
"rst",
"[",
"]",
"=",
"$",
"this",
"->",
"map",
"(",
"$",
"row",
")",
";",
... | Map data rows to model array
@param array $rows
@return array | [
"Map",
"data",
"rows",
"to",
"model",
"array"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L96-L103 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.create | public function create($row = array()){
$class = $this->modelClass;
$model = new $class($this->db, $row);
$model->setAttribute('table', $this->table)->setAttribute('pk', $this->pk);
return $model;
} | php | public function create($row = array()){
$class = $this->modelClass;
$model = new $class($this->db, $row);
$model->setAttribute('table', $this->table)->setAttribute('pk', $this->pk);
return $model;
} | [
"public",
"function",
"create",
"(",
"$",
"row",
"=",
"array",
"(",
")",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"modelClass",
";",
"$",
"model",
"=",
"new",
"$",
"class",
"(",
"$",
"this",
"->",
"db",
",",
"$",
"row",
")",
";",
"$",
... | Create a fresh model from array
@param array $row
@return \Ark\Database\Model | [
"Create",
"a",
"fresh",
"model",
"from",
"array"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L111-L117 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.count | public function count($conditions = '', $params = array()){
return $this->db->builder()->select('COUNT(*)')->from($this->table)->where($conditions, $params)->queryValue();
} | php | public function count($conditions = '', $params = array()){
return $this->db->builder()->select('COUNT(*)')->from($this->table)->where($conditions, $params)->queryValue();
} | [
"public",
"function",
"count",
"(",
"$",
"conditions",
"=",
"''",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"builder",
"(",
")",
"->",
"select",
"(",
"'COUNT(*)'",
")",
"->",
"from",
"(",
"$",
... | Count with conditions
@param string|array $conditions
@param array $params
@return integer | [
"Count",
"with",
"conditions"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L153-L155 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.findOne | public function findOne($conditions, $params = array()){
$row = $this->db->builder()->select()->from($this->table)->where($conditions, $params)->limit(1)->queryRow();
if(false === $row){
return false;
}
return $this->map($row);
} | php | public function findOne($conditions, $params = array()){
$row = $this->db->builder()->select()->from($this->table)->where($conditions, $params)->limit(1)->queryRow();
if(false === $row){
return false;
}
return $this->map($row);
} | [
"public",
"function",
"findOne",
"(",
"$",
"conditions",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"row",
"=",
"$",
"this",
"->",
"db",
"->",
"builder",
"(",
")",
"->",
"select",
"(",
")",
"->",
"from",
"(",
"$",
"this",
"->",
... | Find one model with conditions
@param string|array $conditions
@param array $params
@return \Ark\Database\Model Or false on failure | [
"Find",
"one",
"model",
"with",
"conditions"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L195-L202 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.findByPK | public function findByPK($pk){
$pkConditions = $this->buildPKConditions($this->pk, $pk);
return $this->findOne($pkConditions[0], $pkConditions[1]);
} | php | public function findByPK($pk){
$pkConditions = $this->buildPKConditions($this->pk, $pk);
return $this->findOne($pkConditions[0], $pkConditions[1]);
} | [
"public",
"function",
"findByPK",
"(",
"$",
"pk",
")",
"{",
"$",
"pkConditions",
"=",
"$",
"this",
"->",
"buildPKConditions",
"(",
"$",
"this",
"->",
"pk",
",",
"$",
"pk",
")",
";",
"return",
"$",
"this",
"->",
"findOne",
"(",
"$",
"pkConditions",
"[... | Find one model by primary key
@param string|array $pk
@return \Ark\Database\Model Or false on failure | [
"Find",
"one",
"model",
"by",
"primary",
"key"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L221-L224 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.findMany | public function findMany($conditions = '', $params = array(), $orderBy = null, $limit = null, $offset = null){
$cmd = $this->db->builder()->select()->from($this->table)->where($conditions, $params);
if($orderBy){
$cmd->orderBy($orderBy);
}
$rows = $cmd->limit($limit, $offset)->queryAll();
if(false === $rows){
return false;
}
else{
return $this->mapModels($rows);
}
} | php | public function findMany($conditions = '', $params = array(), $orderBy = null, $limit = null, $offset = null){
$cmd = $this->db->builder()->select()->from($this->table)->where($conditions, $params);
if($orderBy){
$cmd->orderBy($orderBy);
}
$rows = $cmd->limit($limit, $offset)->queryAll();
if(false === $rows){
return false;
}
else{
return $this->mapModels($rows);
}
} | [
"public",
"function",
"findMany",
"(",
"$",
"conditions",
"=",
"''",
",",
"$",
"params",
"=",
"array",
"(",
")",
",",
"$",
"orderBy",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"$",
"cmd",
"=",
"$",
... | Find many models with conditions
@param string|array $conditions
@param array $params
@param string|array $orderBy
@param int $limit
@param int $offset
@return array Or false on failure | [
"Find",
"many",
"models",
"with",
"conditions"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L236-L248 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.findManyBy | public function findManyBy($key, $value, $orderBy = null, $limit = null, $offset = null){
return $this->findMany($key.'=:key', array(':key' => $value), $orderBy, $limit, $offset);
} | php | public function findManyBy($key, $value, $orderBy = null, $limit = null, $offset = null){
return $this->findMany($key.'=:key', array(':key' => $value), $orderBy, $limit, $offset);
} | [
"public",
"function",
"findManyBy",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"orderBy",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"findMany",
"(",
"$",
"key",
".",
"'... | Find many models with by key
@param string $key
@param mixed $value
@param string|array $orderBy
@param int $limit
@param int $offset
@return array Or false on failure | [
"Find",
"many",
"models",
"with",
"by",
"key"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L260-L262 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.update | public function update($values, $conditions, $params = array()){
return $this->db->builder()->update($this->table, $values, $conditions, $params);
} | php | public function update($values, $conditions, $params = array()){
return $this->db->builder()->update($this->table, $values, $conditions, $params);
} | [
"public",
"function",
"update",
"(",
"$",
"values",
",",
"$",
"conditions",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"builder",
"(",
")",
"->",
"update",
"(",
"$",
"this",
"->",
"table",
",",
... | Update table with condition
@param array $values
@param string|array $conditions
@param array $params
@return int|boolean | [
"Update",
"table",
"with",
"condition"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L272-L274 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.updateByPK | public function updateByPK($pk, $values){
$pkConditions = $this->buildPKConditions($this->pk, $pk);
return $this->update($values, $pkConditions[0], $pkConditions[1]);
} | php | public function updateByPK($pk, $values){
$pkConditions = $this->buildPKConditions($this->pk, $pk);
return $this->update($values, $pkConditions[0], $pkConditions[1]);
} | [
"public",
"function",
"updateByPK",
"(",
"$",
"pk",
",",
"$",
"values",
")",
"{",
"$",
"pkConditions",
"=",
"$",
"this",
"->",
"buildPKConditions",
"(",
"$",
"this",
"->",
"pk",
",",
"$",
"pk",
")",
";",
"return",
"$",
"this",
"->",
"update",
"(",
... | Update table by primary key
@param string|array $pk
@param array $values
@return int|boolean | [
"Update",
"table",
"by",
"primary",
"key"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L294-L297 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.delete | public function delete($conditions, $params = array()){
return $this->db->builder()->delete($this->table, $conditions, $params);
} | php | public function delete($conditions, $params = array()){
return $this->db->builder()->delete($this->table, $conditions, $params);
} | [
"public",
"function",
"delete",
"(",
"$",
"conditions",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"builder",
"(",
")",
"->",
"delete",
"(",
"$",
"this",
"->",
"table",
",",
"$",
"conditions",
","... | Delete with condition
@param string|array $conditioins
@param array $params
@return int|boolean | [
"Delete",
"with",
"condition"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L316-L318 | train |
arkphp/database | src/ModelFactory.php | ModelFactory.deleteByPK | public function deleteByPK($pk){
$pkConditions = $this->buildPKConditions($this->pk, $pk);
return $this->delete($pkConditions[0], $pkConditions[1]);
} | php | public function deleteByPK($pk){
$pkConditions = $this->buildPKConditions($this->pk, $pk);
return $this->delete($pkConditions[0], $pkConditions[1]);
} | [
"public",
"function",
"deleteByPK",
"(",
"$",
"pk",
")",
"{",
"$",
"pkConditions",
"=",
"$",
"this",
"->",
"buildPKConditions",
"(",
"$",
"this",
"->",
"pk",
",",
"$",
"pk",
")",
";",
"return",
"$",
"this",
"->",
"delete",
"(",
"$",
"pkConditions",
"... | Delete by primary key
@param string|array $pk
@return int|boolean | [
"Delete",
"by",
"primary",
"key"
] | 5b332d0b0b683bb4211fa12687e7c89a3ab158df | https://github.com/arkphp/database/blob/5b332d0b0b683bb4211fa12687e7c89a3ab158df/src/ModelFactory.php#L337-L340 | train |
globalis-ms/puppet-skilled-framework | src/Database/Magic/Relations/BelongsToMany.php | BelongsToMany.findMany | public function findMany($ids, $columns = ['*'])
{
return empty($ids) ? [] : $this->whereIn(
$this->getRelated()->getQualifiedKeyName(), $ids
)->get($columns);
} | php | public function findMany($ids, $columns = ['*'])
{
return empty($ids) ? [] : $this->whereIn(
$this->getRelated()->getQualifiedKeyName(), $ids
)->get($columns);
} | [
"public",
"function",
"findMany",
"(",
"$",
"ids",
",",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"return",
"empty",
"(",
"$",
"ids",
")",
"?",
"[",
"]",
":",
"$",
"this",
"->",
"whereIn",
"(",
"$",
"this",
"->",
"getRelated",
"(",
")",
"... | Find multiple related models by their primary keys.
@param mixed $ids
@param array $columns
@return array | [
"Find",
"multiple",
"related",
"models",
"by",
"their",
"primary",
"keys",
"."
] | 4bb9ff30a32210f54add1f0e53d4769d26eb3c29 | https://github.com/globalis-ms/puppet-skilled-framework/blob/4bb9ff30a32210f54add1f0e53d4769d26eb3c29/src/Database/Magic/Relations/BelongsToMany.php#L395-L400 | train |
peterkahl/curlMaster | src/curlMaster.php | curlMaster.Array2string | private function Array2string($arr, $glue = '&') {
if (!is_array($arr)) {
throw new Exception('Argument arr must be array');;
}
$new = array();
foreach ($arr as $k => $v) {
$new[] = urlencode($k) .'='. urlencode($v);
}
return implode($glue, $new);
} | php | private function Array2string($arr, $glue = '&') {
if (!is_array($arr)) {
throw new Exception('Argument arr must be array');;
}
$new = array();
foreach ($arr as $k => $v) {
$new[] = urlencode($k) .'='. urlencode($v);
}
return implode($glue, $new);
} | [
"private",
"function",
"Array2string",
"(",
"$",
"arr",
",",
"$",
"glue",
"=",
"'&'",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"arr",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Argument arr must be array'",
")",
";",
";",
"}",
"$",
"ne... | Converts array to string
@param array $arr
@param string $glue
@return string
@throws \Exception | [
"Converts",
"array",
"to",
"string"
] | 62de99a183c52de1b832e02536f36c0a5709d867 | https://github.com/peterkahl/curlMaster/blob/62de99a183c52de1b832e02536f36c0a5709d867/src/curlMaster.php#L396-L405 | train |
peterkahl/curlMaster | src/curlMaster.php | curlMaster.getHeaders | private function getHeaders($str) {
$str = explode(self::LE . self::LE, $str);
$str = reset($str);
$str = explode(self::LE, $str);
$new = array();
$s = 1;
foreach ($str as $line) {
$pos = strpos($line, ': ');
if ($pos !== false) {
$key = strtolower(substr($line, 0, $pos));
if (!isset($new[$key])) {
$new[$key] = preg_replace('/\s+/', ' ', trim(substr($line, $pos+1)));
}
else {
$new[$key.'-'.$s] = preg_replace('/\s+/', ' ', trim(substr($line, $pos+1)));
$s++;
}
}
else {
$new['status'] = $line; # HTTP/1.1 200 OK
}
}
return $new;
} | php | private function getHeaders($str) {
$str = explode(self::LE . self::LE, $str);
$str = reset($str);
$str = explode(self::LE, $str);
$new = array();
$s = 1;
foreach ($str as $line) {
$pos = strpos($line, ': ');
if ($pos !== false) {
$key = strtolower(substr($line, 0, $pos));
if (!isset($new[$key])) {
$new[$key] = preg_replace('/\s+/', ' ', trim(substr($line, $pos+1)));
}
else {
$new[$key.'-'.$s] = preg_replace('/\s+/', ' ', trim(substr($line, $pos+1)));
$s++;
}
}
else {
$new['status'] = $line; # HTTP/1.1 200 OK
}
}
return $new;
} | [
"private",
"function",
"getHeaders",
"(",
"$",
"str",
")",
"{",
"$",
"str",
"=",
"explode",
"(",
"self",
"::",
"LE",
".",
"self",
"::",
"LE",
",",
"$",
"str",
")",
";",
"$",
"str",
"=",
"reset",
"(",
"$",
"str",
")",
";",
"$",
"str",
"=",
"ex... | Parses headers from string
@param string $str
@return array | [
"Parses",
"headers",
"from",
"string"
] | 62de99a183c52de1b832e02536f36c0a5709d867 | https://github.com/peterkahl/curlMaster/blob/62de99a183c52de1b832e02536f36c0a5709d867/src/curlMaster.php#L413-L436 | train |
peterkahl/curlMaster | src/curlMaster.php | curlMaster.getBody | private function getBody($str) {
$str = substr($str, strpos($str, self::LE . self::LE));
return trim($str);
} | php | private function getBody($str) {
$str = substr($str, strpos($str, self::LE . self::LE));
return trim($str);
} | [
"private",
"function",
"getBody",
"(",
"$",
"str",
")",
"{",
"$",
"str",
"=",
"substr",
"(",
"$",
"str",
",",
"strpos",
"(",
"$",
"str",
",",
"self",
"::",
"LE",
".",
"self",
"::",
"LE",
")",
")",
";",
"return",
"trim",
"(",
"$",
"str",
")",
... | Parses body from string
@param string $str
@return string | [
"Parses",
"body",
"from",
"string"
] | 62de99a183c52de1b832e02536f36c0a5709d867 | https://github.com/peterkahl/curlMaster/blob/62de99a183c52de1b832e02536f36c0a5709d867/src/curlMaster.php#L444-L447 | train |
peterkahl/curlMaster | src/curlMaster.php | curlMaster.ParseCachingHeader | private function ParseCachingHeader($arr) {
if (!empty($arr['cache-control'])) {
if (strpos('no-cache', $arr['cache-control']) !== false) {
return 0;
}
if (strpos('no-store', $arr['cache-control']) !== false) {
return 0;
}
if (strpos('max-age=0', $arr['cache-control']) !== false) {
return 0;
}
if (preg_match('/\bmax-age=(\d+),?\b/', $arr['cache-control'], $match)) {
return (integer) $match[1];
}
}
if (!empty($arr['expires'])) {
if (preg_match('/^-\d+|0$/', $arr['expires'])) {
return 0;
}
$epoch = strtotime($arr['expires']);
$sec = $epoch - time();
if ($sec > 0) {
return $sec;
}
return 0;
}
return 0;
} | php | private function ParseCachingHeader($arr) {
if (!empty($arr['cache-control'])) {
if (strpos('no-cache', $arr['cache-control']) !== false) {
return 0;
}
if (strpos('no-store', $arr['cache-control']) !== false) {
return 0;
}
if (strpos('max-age=0', $arr['cache-control']) !== false) {
return 0;
}
if (preg_match('/\bmax-age=(\d+),?\b/', $arr['cache-control'], $match)) {
return (integer) $match[1];
}
}
if (!empty($arr['expires'])) {
if (preg_match('/^-\d+|0$/', $arr['expires'])) {
return 0;
}
$epoch = strtotime($arr['expires']);
$sec = $epoch - time();
if ($sec > 0) {
return $sec;
}
return 0;
}
return 0;
} | [
"private",
"function",
"ParseCachingHeader",
"(",
"$",
"arr",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"arr",
"[",
"'cache-control'",
"]",
")",
")",
"{",
"if",
"(",
"strpos",
"(",
"'no-cache'",
",",
"$",
"arr",
"[",
"'cache-control'",
"]",
")",
"... | Parses the response headers and returns the number of seconds
that will be the maximum caching time of our cached file.
@param array $arr
@return integer | [
"Parses",
"the",
"response",
"headers",
"and",
"returns",
"the",
"number",
"of",
"seconds",
"that",
"will",
"be",
"the",
"maximum",
"caching",
"time",
"of",
"our",
"cached",
"file",
"."
] | 62de99a183c52de1b832e02536f36c0a5709d867 | https://github.com/peterkahl/curlMaster/blob/62de99a183c52de1b832e02536f36c0a5709d867/src/curlMaster.php#L456-L486 | train |
peterkahl/curlMaster | src/curlMaster.php | curlMaster.GetCookieFileName | private function GetCookieFileName($url) {
$temp = parse_url($url);
$ext = (string) $this->CookieMaxAge;
return $this->CacheDir .'/CURL_COOKIE-'. sha1($temp['host']) .'.'. $ext;
} | php | private function GetCookieFileName($url) {
$temp = parse_url($url);
$ext = (string) $this->CookieMaxAge;
return $this->CacheDir .'/CURL_COOKIE-'. sha1($temp['host']) .'.'. $ext;
} | [
"private",
"function",
"GetCookieFileName",
"(",
"$",
"url",
")",
"{",
"$",
"temp",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"$",
"ext",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"CookieMaxAge",
";",
"return",
"$",
"this",
"->",
"CacheDir",
"."... | Returns name of a cookie file
@param string $url
@return string | [
"Returns",
"name",
"of",
"a",
"cookie",
"file"
] | 62de99a183c52de1b832e02536f36c0a5709d867 | https://github.com/peterkahl/curlMaster/blob/62de99a183c52de1b832e02536f36c0a5709d867/src/curlMaster.php#L511-L515 | train |
peterkahl/curlMaster | src/curlMaster.php | curlMaster.DeleteChacheFile | public function DeleteChacheFile($filename) {
if (preg_match('/^\/CURL_RESPON-[0-9a-f]{40}\.\d+$/', $filename)) {
$filename = $this->CacheDir . $filename;
if (file_exists($filename)) {
unlink($filename);
}
}
} | php | public function DeleteChacheFile($filename) {
if (preg_match('/^\/CURL_RESPON-[0-9a-f]{40}\.\d+$/', $filename)) {
$filename = $this->CacheDir . $filename;
if (file_exists($filename)) {
unlink($filename);
}
}
} | [
"public",
"function",
"DeleteChacheFile",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^\\/CURL_RESPON-[0-9a-f]{40}\\.\\d+$/'",
",",
"$",
"filename",
")",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"CacheDir",
".",
"$",
"filename",
... | Deletes a cache file
@param string $filename | [
"Deletes",
"a",
"cache",
"file"
] | 62de99a183c52de1b832e02536f36c0a5709d867 | https://github.com/peterkahl/curlMaster/blob/62de99a183c52de1b832e02536f36c0a5709d867/src/curlMaster.php#L538-L545 | train |
peterkahl/curlMaster | src/curlMaster.php | curlMaster.FilePutContents | private function FilePutContents($file, $str) {
$fileObj = new SplFileObject($file, 'w');
while (!$fileObj->flock(LOCK_EX)) {
usleep(1);
}
$bytes = $fileObj->fwrite($str);
$fileObj->flock(LOCK_UN);
return $bytes;
} | php | private function FilePutContents($file, $str) {
$fileObj = new SplFileObject($file, 'w');
while (!$fileObj->flock(LOCK_EX)) {
usleep(1);
}
$bytes = $fileObj->fwrite($str);
$fileObj->flock(LOCK_UN);
return $bytes;
} | [
"private",
"function",
"FilePutContents",
"(",
"$",
"file",
",",
"$",
"str",
")",
"{",
"$",
"fileObj",
"=",
"new",
"SplFileObject",
"(",
"$",
"file",
",",
"'w'",
")",
";",
"while",
"(",
"!",
"$",
"fileObj",
"->",
"flock",
"(",
"LOCK_EX",
")",
")",
... | Saves string inside a file
@param string $file
@param string $str
@return boolean | [
"Saves",
"string",
"inside",
"a",
"file"
] | 62de99a183c52de1b832e02536f36c0a5709d867 | https://github.com/peterkahl/curlMaster/blob/62de99a183c52de1b832e02536f36c0a5709d867/src/curlMaster.php#L588-L596 | train |
peterkahl/curlMaster | src/curlMaster.php | curlMaster.FileGetContents | private function FileGetContents($file) {
$fileObj = new SplFileObject($file, 'r');
while (!$fileObj->flock(LOCK_EX)) {
usleep(1);
}
$str = $fileObj->fread($fileObj->getSize());
$fileObj->flock(LOCK_UN);
return $str;
} | php | private function FileGetContents($file) {
$fileObj = new SplFileObject($file, 'r');
while (!$fileObj->flock(LOCK_EX)) {
usleep(1);
}
$str = $fileObj->fread($fileObj->getSize());
$fileObj->flock(LOCK_UN);
return $str;
} | [
"private",
"function",
"FileGetContents",
"(",
"$",
"file",
")",
"{",
"$",
"fileObj",
"=",
"new",
"SplFileObject",
"(",
"$",
"file",
",",
"'r'",
")",
";",
"while",
"(",
"!",
"$",
"fileObj",
"->",
"flock",
"(",
"LOCK_EX",
")",
")",
"{",
"usleep",
"(",... | Retrieves contents of a file
@param string $file
@return string | [
"Retrieves",
"contents",
"of",
"a",
"file"
] | 62de99a183c52de1b832e02536f36c0a5709d867 | https://github.com/peterkahl/curlMaster/blob/62de99a183c52de1b832e02536f36c0a5709d867/src/curlMaster.php#L604-L612 | train |
undera/pwe | PWE/Modules/PWEModule.php | PWEModule.getBaseLink | protected function getBaseLink()
{
$res = '.';
$res .= str_repeat("/..", sizeof($this->PWE->getURL()->getParamsAsArray()));
return $res;
} | php | protected function getBaseLink()
{
$res = '.';
$res .= str_repeat("/..", sizeof($this->PWE->getURL()->getParamsAsArray()));
return $res;
} | [
"protected",
"function",
"getBaseLink",
"(",
")",
"{",
"$",
"res",
"=",
"'.'",
";",
"$",
"res",
".=",
"str_repeat",
"(",
"\"/..\"",
",",
"sizeof",
"(",
"$",
"this",
"->",
"PWE",
"->",
"getURL",
"(",
")",
"->",
"getParamsAsArray",
"(",
")",
")",
")",
... | Wherever you called with URL params you may get relative link
to your base structure node
@return string relative path to node base | [
"Wherever",
"you",
"called",
"with",
"URL",
"params",
"you",
"may",
"get",
"relative",
"link",
"to",
"your",
"base",
"structure",
"node"
] | 4795f3a9755657c2a8be8ef3236992580b7954b3 | https://github.com/undera/pwe/blob/4795f3a9755657c2a8be8ef3236992580b7954b3/PWE/Modules/PWEModule.php#L40-L45 | train |
eclogue/courser | src/App.php | App.addRoute | public function addRoute(string $method, string $route, ...$callback)
{
$method = strtolower($method);
$route = ltrim($route, '/');
$group = rtrim($this->group, '/') . '/';
$route = $group . $route;
$scope = $this->middleware->count();
$this->layer[$method][] = new Route(
$method,
$route,
$callback,
$scope,
$this->group
);
return true;
} | php | public function addRoute(string $method, string $route, ...$callback)
{
$method = strtolower($method);
$route = ltrim($route, '/');
$group = rtrim($this->group, '/') . '/';
$route = $group . $route;
$scope = $this->middleware->count();
$this->layer[$method][] = new Route(
$method,
$route,
$callback,
$scope,
$this->group
);
return true;
} | [
"public",
"function",
"addRoute",
"(",
"string",
"$",
"method",
",",
"string",
"$",
"route",
",",
"...",
"$",
"callback",
")",
"{",
"$",
"method",
"=",
"strtolower",
"(",
"$",
"method",
")",
";",
"$",
"route",
"=",
"ltrim",
"(",
"$",
"route",
",",
... | add a route to stack
@param string $method
@param string $route
@param array $callback
@return bool | [
"add",
"a",
"route",
"to",
"stack"
] | d1d1d460b3bea4f991b1c18ff0069ee197bbb833 | https://github.com/eclogue/courser/blob/d1d1d460b3bea4f991b1c18ff0069ee197bbb833/src/App.php#L169-L185 | train |
eclogue/courser | src/App.php | App.import | public function import(array $loader)
{
$this->loader = $loader;
foreach ($loader as $alias => $namespace) {
$alias = $this->alias($alias);
$this->container->set($alias, function ($c) use ($alias, $namespace) {
if (is_callable([$namespace, 'make'])) {
call_user_func_array($namespace . '::make', [$alias, $c]);
}
return new $namespace();
});
}
} | php | public function import(array $loader)
{
$this->loader = $loader;
foreach ($loader as $alias => $namespace) {
$alias = $this->alias($alias);
$this->container->set($alias, function ($c) use ($alias, $namespace) {
if (is_callable([$namespace, 'make'])) {
call_user_func_array($namespace . '::make', [$alias, $c]);
}
return new $namespace();
});
}
} | [
"public",
"function",
"import",
"(",
"array",
"$",
"loader",
")",
"{",
"$",
"this",
"->",
"loader",
"=",
"$",
"loader",
";",
"foreach",
"(",
"$",
"loader",
"as",
"$",
"alias",
"=>",
"$",
"namespace",
")",
"{",
"$",
"alias",
"=",
"$",
"this",
"->",
... | import custom files keep to psr-4
@param $loader | [
"import",
"custom",
"files",
"keep",
"to",
"psr",
"-",
"4"
] | d1d1d460b3bea4f991b1c18ff0069ee197bbb833 | https://github.com/eclogue/courser/blob/d1d1d460b3bea4f991b1c18ff0069ee197bbb833/src/App.php#L392-L405 | train |
sokil/FrontendBundle | src/Spa/ApplicationData.php | ApplicationData.getData | public function getData()
{
$data = [];
foreach ($this->providerList as $provider) {
$data += $provider->getData();
}
return $data;
} | php | public function getData()
{
$data = [];
foreach ($this->providerList as $provider) {
$data += $provider->getData();
}
return $data;
} | [
"public",
"function",
"getData",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"providerList",
"as",
"$",
"provider",
")",
"{",
"$",
"data",
"+=",
"$",
"provider",
"->",
"getData",
"(",
")",
";",
"}",
"return",
... | Get data from all providers
@return array | [
"Get",
"data",
"from",
"all",
"providers"
] | 2a5475928c3758acec3b975e37372df0985b30bf | https://github.com/sokil/FrontendBundle/blob/2a5475928c3758acec3b975e37372df0985b30bf/src/Spa/ApplicationData.php#L43-L52 | train |
php-kitchen/code-specs | src/Expectation/Matcher/ObjectMatcher.php | ObjectMatcher.throwsException | public function throwsException($exceptionClassOrObject): ObjectExceptionMatcher {
$class = is_string($exceptionClassOrObject) ? $exceptionClassOrObject : get_class($exceptionClassOrObject);
$matcher = $this->createInternalMatcherWithDescription(ObjectExceptionMatcher::class, 'I see that exception "' . $class . '"');
$matcher->exceptionClassOrObject = $exceptionClassOrObject;
return $matcher;
} | php | public function throwsException($exceptionClassOrObject): ObjectExceptionMatcher {
$class = is_string($exceptionClassOrObject) ? $exceptionClassOrObject : get_class($exceptionClassOrObject);
$matcher = $this->createInternalMatcherWithDescription(ObjectExceptionMatcher::class, 'I see that exception "' . $class . '"');
$matcher->exceptionClassOrObject = $exceptionClassOrObject;
return $matcher;
} | [
"public",
"function",
"throwsException",
"(",
"$",
"exceptionClassOrObject",
")",
":",
"ObjectExceptionMatcher",
"{",
"$",
"class",
"=",
"is_string",
"(",
"$",
"exceptionClassOrObject",
")",
"?",
"$",
"exceptionClassOrObject",
":",
"get_class",
"(",
"$",
"exceptionC... | Start sub-chain of exception matcher.
@param \Exception|string $exceptionClassOrObject exception class or object that going to be thrown by object
@return ObjectExceptionMatcher | [
"Start",
"sub",
"-",
"chain",
"of",
"exception",
"matcher",
"."
] | 6ce45183073c346787818afef922508aefc2d358 | https://github.com/php-kitchen/code-specs/blob/6ce45183073c346787818afef922508aefc2d358/src/Expectation/Matcher/ObjectMatcher.php#L94-L101 | train |
jbouzekri/FileUploaderBundle | Service/EndpointConfiguration.php | EndpointConfiguration.getValue | public function getValue($endpoint, $key)
{
if (isset($this->endpoints['endpoints'][$endpoint])
&& isset($this->endpoints['endpoints'][$endpoint][$key])
) {
return $this->endpoints['endpoints'][$endpoint][$key];
}
if (isset($this->endpoints[$key])) {
return $this->endpoints[$key];
}
return null;
} | php | public function getValue($endpoint, $key)
{
if (isset($this->endpoints['endpoints'][$endpoint])
&& isset($this->endpoints['endpoints'][$endpoint][$key])
) {
return $this->endpoints['endpoints'][$endpoint][$key];
}
if (isset($this->endpoints[$key])) {
return $this->endpoints[$key];
}
return null;
} | [
"public",
"function",
"getValue",
"(",
"$",
"endpoint",
",",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"endpoints",
"[",
"'endpoints'",
"]",
"[",
"$",
"endpoint",
"]",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"endpoints",
... | Get configuration value
@param string $endpoint
@param string $key
@return mixed | [
"Get",
"configuration",
"value"
] | 592e7ed827eaa4e7f8f6f52947ca5e5a86835f6c | https://github.com/jbouzekri/FileUploaderBundle/blob/592e7ed827eaa4e7f8f6f52947ca5e5a86835f6c/Service/EndpointConfiguration.php#L44-L57 | train |
protobuf-php/google-protobuf-proto | src/google/protobuf/SourceCodeInfo/Location.php | Location.addPath | public function addPath($value)
{
if ($this->path === null) {
$this->path = new \Protobuf\ScalarCollection();
}
$this->path->add($value);
} | php | public function addPath($value)
{
if ($this->path === null) {
$this->path = new \Protobuf\ScalarCollection();
}
$this->path->add($value);
} | [
"public",
"function",
"addPath",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"path",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"path",
"=",
"new",
"\\",
"Protobuf",
"\\",
"ScalarCollection",
"(",
")",
";",
"}",
"$",
"this",
"->",
... | Add a new element to 'path'
@param int $value | [
"Add",
"a",
"new",
"element",
"to",
"path"
] | da1827b4a23fccd4eb998a8d4bcd972f2330bc29 | https://github.com/protobuf-php/google-protobuf-proto/blob/da1827b4a23fccd4eb998a8d4bcd972f2330bc29/src/google/protobuf/SourceCodeInfo/Location.php#L97-L104 | train |
protobuf-php/google-protobuf-proto | src/google/protobuf/SourceCodeInfo/Location.php | Location.addSpan | public function addSpan($value)
{
if ($this->span === null) {
$this->span = new \Protobuf\ScalarCollection();
}
$this->span->add($value);
} | php | public function addSpan($value)
{
if ($this->span === null) {
$this->span = new \Protobuf\ScalarCollection();
}
$this->span->add($value);
} | [
"public",
"function",
"addSpan",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"span",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"span",
"=",
"new",
"\\",
"Protobuf",
"\\",
"ScalarCollection",
"(",
")",
";",
"}",
"$",
"this",
"->",
... | Add a new element to 'span'
@param int $value | [
"Add",
"a",
"new",
"element",
"to",
"span"
] | da1827b4a23fccd4eb998a8d4bcd972f2330bc29 | https://github.com/protobuf-php/google-protobuf-proto/blob/da1827b4a23fccd4eb998a8d4bcd972f2330bc29/src/google/protobuf/SourceCodeInfo/Location.php#L141-L148 | train |
protobuf-php/google-protobuf-proto | src/google/protobuf/SourceCodeInfo/Location.php | Location.addLeadingDetachedComments | public function addLeadingDetachedComments($value)
{
if ($this->leading_detached_comments === null) {
$this->leading_detached_comments = new \Protobuf\ScalarCollection();
}
$this->leading_detached_comments->add($value);
} | php | public function addLeadingDetachedComments($value)
{
if ($this->leading_detached_comments === null) {
$this->leading_detached_comments = new \Protobuf\ScalarCollection();
}
$this->leading_detached_comments->add($value);
} | [
"public",
"function",
"addLeadingDetachedComments",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"leading_detached_comments",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"leading_detached_comments",
"=",
"new",
"\\",
"Protobuf",
"\\",
"ScalarCollec... | Add a new element to 'leading_detached_comments'
@param string $value | [
"Add",
"a",
"new",
"element",
"to",
"leading_detached_comments"
] | da1827b4a23fccd4eb998a8d4bcd972f2330bc29 | https://github.com/protobuf-php/google-protobuf-proto/blob/da1827b4a23fccd4eb998a8d4bcd972f2330bc29/src/google/protobuf/SourceCodeInfo/Location.php#L245-L252 | train |
globalis-ms/puppet-skilled-framework | src/Database/Magic/Revisionable/Revisionable.php | Revisionable.getOldAttributes | public function getOldAttributes()
{
$attributes = $this->prepareAttributes($this->original);
$attributes = $this->getRevisionableItems($attributes);
return $attributes;
} | php | public function getOldAttributes()
{
$attributes = $this->prepareAttributes($this->original);
$attributes = $this->getRevisionableItems($attributes);
return $attributes;
} | [
"public",
"function",
"getOldAttributes",
"(",
")",
"{",
"$",
"attributes",
"=",
"$",
"this",
"->",
"prepareAttributes",
"(",
"$",
"this",
"->",
"original",
")",
";",
"$",
"attributes",
"=",
"$",
"this",
"->",
"getRevisionableItems",
"(",
"$",
"attributes",
... | Get an array of original revisionable attributes.
@return array | [
"Get",
"an",
"array",
"of",
"original",
"revisionable",
"attributes",
"."
] | 4bb9ff30a32210f54add1f0e53d4769d26eb3c29 | https://github.com/globalis-ms/puppet-skilled-framework/blob/4bb9ff30a32210f54add1f0e53d4769d26eb3c29/src/Database/Magic/Revisionable/Revisionable.php#L52-L57 | train |
globalis-ms/puppet-skilled-framework | src/Database/Magic/Revisionable/Revisionable.php | Revisionable.getNewAttributes | public function getNewAttributes()
{
$attributes = $this->prepareAttributes($this->attributes);
$attributes = $this->getRevisionableItems($attributes);
return $attributes;
} | php | public function getNewAttributes()
{
$attributes = $this->prepareAttributes($this->attributes);
$attributes = $this->getRevisionableItems($attributes);
return $attributes;
} | [
"public",
"function",
"getNewAttributes",
"(",
")",
"{",
"$",
"attributes",
"=",
"$",
"this",
"->",
"prepareAttributes",
"(",
"$",
"this",
"->",
"attributes",
")",
";",
"$",
"attributes",
"=",
"$",
"this",
"->",
"getRevisionableItems",
"(",
"$",
"attributes"... | Get an array of current revisionable attributes.
@return array | [
"Get",
"an",
"array",
"of",
"current",
"revisionable",
"attributes",
"."
] | 4bb9ff30a32210f54add1f0e53d4769d26eb3c29 | https://github.com/globalis-ms/puppet-skilled-framework/blob/4bb9ff30a32210f54add1f0e53d4769d26eb3c29/src/Database/Magic/Revisionable/Revisionable.php#L64-L69 | train |
trive-digital/fiskalapi | lib/Invoice/Invoice.php | Invoice.generateSecurityCode | public function generateSecurityCode()
{
$result = $this->getCertificatePrivateKey();
$result .= $this->getOib();
$result .= $this->getDateTime();
$result .= $this->getInvoiceNumber()->getInvoiceNumber();
$result .= $this->getInvoiceNumber()->getBusinessLocationCode();
$result .= $this->getInvoiceNumber()->getPaymentDeviceCode();
$result .= $this->getTotalValue();
$this->setSecurityCode(md5($result));
return $this;
} | php | public function generateSecurityCode()
{
$result = $this->getCertificatePrivateKey();
$result .= $this->getOib();
$result .= $this->getDateTime();
$result .= $this->getInvoiceNumber()->getInvoiceNumber();
$result .= $this->getInvoiceNumber()->getBusinessLocationCode();
$result .= $this->getInvoiceNumber()->getPaymentDeviceCode();
$result .= $this->getTotalValue();
$this->setSecurityCode(md5($result));
return $this;
} | [
"public",
"function",
"generateSecurityCode",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getCertificatePrivateKey",
"(",
")",
";",
"$",
"result",
".=",
"$",
"this",
"->",
"getOib",
"(",
")",
";",
"$",
"result",
".=",
"$",
"this",
"->",
"get... | Generate security code
@return string md5 hash | [
"Generate",
"security",
"code"
] | 1bed6f4573ea1d6890bcf7da42ede4da9cc0b6b9 | https://github.com/trive-digital/fiskalapi/blob/1bed6f4573ea1d6890bcf7da42ede4da9cc0b6b9/lib/Invoice/Invoice.php#L704-L717 | train |
patrickbrouwers/Laravel-Doctrine | src/DoctrineServiceProvider.php | DoctrineServiceProvider.setUpEntityManagers | protected function setUpEntityManagers()
{
$managers = [];
$connections = [];
foreach ($this->config['managers'] as $manager => $settings) {
$managerName = IlluminateRegistry::getManagerNamePrefix() . $manager;
$connectionName = IlluminateRegistry::getConnectionNamePrefix() . $manager;
// Bind manager
$this->app->singleton($managerName, function () use ($settings) {
$manager = EntityManager::create(
ConnectionManager::resolve(array_get($settings, 'connection')),
MetaDataManager::resolve(array_get($settings, 'meta'))
);
$configuration = $manager->getConfiguration();
// Listeners
if (isset($settings['events']['listeners'])) {
foreach ($settings['events']['listeners'] as $event => $listener) {
$manager->getEventManager()->addEventListener($event, $listener);
}
}
// Subscribers
if (isset($settings['events']['subscribers'])) {
foreach ($settings['events']['subscribers'] as $subscriber) {
$manager->getEventManager()->addEventSubscriber($subscriber);
}
}
// Filters
if (isset($settings['filters'])) {
foreach ($settings['filters'] as $name => $filter) {
$configuration->getMetadataDriverImpl()->addFilter($name, $filter);
$manager->getFilters()->enable($name);
}
}
// Paths
$configuration->getMetadataDriverImpl()->addPaths(
array_get($settings, 'paths', [])
);
// Repository
$configuration->setDefaultRepositoryClassName(
array_get($settings, 'repository', \Doctrine\ORM\EntityRepository::class)
);
$configuration->setAutoGenerateProxyClasses(
array_get($settings, 'proxies.auto_generate', false)
);
if ($namespace = array_get($settings, 'proxies.namespace', false)) {
$configuration->setProxyNamespace($namespace);
}
return $manager;
});
// Bind connection
$this->app->singleton($connectionName, function ($app) use ($manager) {
$app->make(IlluminateRegistry::getManagerNamePrefix() . $manager)->getConnection();
});
$managers[$manager] = $manager;
$connections[$manager] = $manager;
}
return [$managers, $connections];
} | php | protected function setUpEntityManagers()
{
$managers = [];
$connections = [];
foreach ($this->config['managers'] as $manager => $settings) {
$managerName = IlluminateRegistry::getManagerNamePrefix() . $manager;
$connectionName = IlluminateRegistry::getConnectionNamePrefix() . $manager;
// Bind manager
$this->app->singleton($managerName, function () use ($settings) {
$manager = EntityManager::create(
ConnectionManager::resolve(array_get($settings, 'connection')),
MetaDataManager::resolve(array_get($settings, 'meta'))
);
$configuration = $manager->getConfiguration();
// Listeners
if (isset($settings['events']['listeners'])) {
foreach ($settings['events']['listeners'] as $event => $listener) {
$manager->getEventManager()->addEventListener($event, $listener);
}
}
// Subscribers
if (isset($settings['events']['subscribers'])) {
foreach ($settings['events']['subscribers'] as $subscriber) {
$manager->getEventManager()->addEventSubscriber($subscriber);
}
}
// Filters
if (isset($settings['filters'])) {
foreach ($settings['filters'] as $name => $filter) {
$configuration->getMetadataDriverImpl()->addFilter($name, $filter);
$manager->getFilters()->enable($name);
}
}
// Paths
$configuration->getMetadataDriverImpl()->addPaths(
array_get($settings, 'paths', [])
);
// Repository
$configuration->setDefaultRepositoryClassName(
array_get($settings, 'repository', \Doctrine\ORM\EntityRepository::class)
);
$configuration->setAutoGenerateProxyClasses(
array_get($settings, 'proxies.auto_generate', false)
);
if ($namespace = array_get($settings, 'proxies.namespace', false)) {
$configuration->setProxyNamespace($namespace);
}
return $manager;
});
// Bind connection
$this->app->singleton($connectionName, function ($app) use ($manager) {
$app->make(IlluminateRegistry::getManagerNamePrefix() . $manager)->getConnection();
});
$managers[$manager] = $manager;
$connections[$manager] = $manager;
}
return [$managers, $connections];
} | [
"protected",
"function",
"setUpEntityManagers",
"(",
")",
"{",
"$",
"managers",
"=",
"[",
"]",
";",
"$",
"connections",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"config",
"[",
"'managers'",
"]",
"as",
"$",
"manager",
"=>",
"$",
"settings"... | Setup the entity managers
@return array | [
"Setup",
"the",
"entity",
"managers"
] | 94471346af6b121000256b303e585e977cc416cd | https://github.com/patrickbrouwers/Laravel-Doctrine/blob/94471346af6b121000256b303e585e977cc416cd/src/DoctrineServiceProvider.php#L103-L175 | train |
patrickbrouwers/Laravel-Doctrine | src/DoctrineServiceProvider.php | DoctrineServiceProvider.registerEntityManager | protected function registerEntityManager()
{
// Bind the default Entity Manager
$this->app->singleton('em', function ($app) {
return $app->make(ManagerRegistry::class)->getManager();
});
$this->app->alias('em', EntityManager::class);
$this->app->alias('em', EntityManagerInterface::class);
} | php | protected function registerEntityManager()
{
// Bind the default Entity Manager
$this->app->singleton('em', function ($app) {
return $app->make(ManagerRegistry::class)->getManager();
});
$this->app->alias('em', EntityManager::class);
$this->app->alias('em', EntityManagerInterface::class);
} | [
"protected",
"function",
"registerEntityManager",
"(",
")",
"{",
"// Bind the default Entity Manager",
"$",
"this",
"->",
"app",
"->",
"singleton",
"(",
"'em'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"$",
"app",
"->",
"make",
"(",
"ManagerRegist... | Setup the entity manager | [
"Setup",
"the",
"entity",
"manager"
] | 94471346af6b121000256b303e585e977cc416cd | https://github.com/patrickbrouwers/Laravel-Doctrine/blob/94471346af6b121000256b303e585e977cc416cd/src/DoctrineServiceProvider.php#L180-L189 | train |
patrickbrouwers/Laravel-Doctrine | src/DoctrineServiceProvider.php | DoctrineServiceProvider.setupMetaData | protected function setupMetaData()
{
MetaDataManager::registerDrivers(
$this->config['meta']['drivers'],
$this->config['dev']
);
MetaDataManager::resolved(function (Configuration $configuration) {
// Debugbar
if ($this->config['debugbar'] === true) {
$debugStack = new DebugStack();
$configuration->setSQLLogger($debugStack);
$this->app['debugbar']->addCollector(
new DoctrineCollector($debugStack)
);
}
$configuration->getMetadataDriverImpl()->addPaths([
__DIR__ . '/Migrations',
__DIR__ . '/Auth/Passwords'
]);
// Automatically make table, column names, etc. like Laravel
$configuration->setNamingStrategy(
$this->app->make(LaravelNamingStrategy::class)
);
// Custom functions
$configuration->setCustomDatetimeFunctions($this->config['custom_datetime_functions']);
$configuration->setCustomNumericFunctions($this->config['custom_numeric_functions']);
$configuration->setCustomStringFunctions($this->config['custom_string_functions']);
// Second level caching
if ($this->config['cache']['second_level']) {
$configuration->setSecondLevelCacheEnabled(true);
$cacheConfig = $configuration->getSecondLevelCacheConfiguration();
$cacheConfig->setCacheFactory(
new DefaultCacheFactory(
$cacheConfig->getRegionsConfiguration(),
CacheManager::resolve(
$this->config['cache']['default']
)
)
);
}
});
} | php | protected function setupMetaData()
{
MetaDataManager::registerDrivers(
$this->config['meta']['drivers'],
$this->config['dev']
);
MetaDataManager::resolved(function (Configuration $configuration) {
// Debugbar
if ($this->config['debugbar'] === true) {
$debugStack = new DebugStack();
$configuration->setSQLLogger($debugStack);
$this->app['debugbar']->addCollector(
new DoctrineCollector($debugStack)
);
}
$configuration->getMetadataDriverImpl()->addPaths([
__DIR__ . '/Migrations',
__DIR__ . '/Auth/Passwords'
]);
// Automatically make table, column names, etc. like Laravel
$configuration->setNamingStrategy(
$this->app->make(LaravelNamingStrategy::class)
);
// Custom functions
$configuration->setCustomDatetimeFunctions($this->config['custom_datetime_functions']);
$configuration->setCustomNumericFunctions($this->config['custom_numeric_functions']);
$configuration->setCustomStringFunctions($this->config['custom_string_functions']);
// Second level caching
if ($this->config['cache']['second_level']) {
$configuration->setSecondLevelCacheEnabled(true);
$cacheConfig = $configuration->getSecondLevelCacheConfiguration();
$cacheConfig->setCacheFactory(
new DefaultCacheFactory(
$cacheConfig->getRegionsConfiguration(),
CacheManager::resolve(
$this->config['cache']['default']
)
)
);
}
});
} | [
"protected",
"function",
"setupMetaData",
"(",
")",
"{",
"MetaDataManager",
"::",
"registerDrivers",
"(",
"$",
"this",
"->",
"config",
"[",
"'meta'",
"]",
"[",
"'drivers'",
"]",
",",
"$",
"this",
"->",
"config",
"[",
"'dev'",
"]",
")",
";",
"MetaDataManage... | Register the meta data drivers | [
"Register",
"the",
"meta",
"data",
"drivers"
] | 94471346af6b121000256b303e585e977cc416cd | https://github.com/patrickbrouwers/Laravel-Doctrine/blob/94471346af6b121000256b303e585e977cc416cd/src/DoctrineServiceProvider.php#L228-L276 | train |
maximebf/CacheCache | src/CacheCache/CacheManager.php | CacheManager.setup | public static function setup($caches, Logger $logger = null, $logLevel = null)
{
if (!is_array($caches)) {
$caches = array(self::_DEFAULT => array('backend' => $caches));
}
self::$logger = $logger;
self::$logLevel = $logLevel;
foreach ($caches as $name => $options) {
self::$caches[$name] = self::factory($options);
}
} | php | public static function setup($caches, Logger $logger = null, $logLevel = null)
{
if (!is_array($caches)) {
$caches = array(self::_DEFAULT => array('backend' => $caches));
}
self::$logger = $logger;
self::$logLevel = $logLevel;
foreach ($caches as $name => $options) {
self::$caches[$name] = self::factory($options);
}
} | [
"public",
"static",
"function",
"setup",
"(",
"$",
"caches",
",",
"Logger",
"$",
"logger",
"=",
"null",
",",
"$",
"logLevel",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"caches",
")",
")",
"{",
"$",
"caches",
"=",
"array",
"(",
... | Setups the cache manager.
If $caches is the class name of a backend, a {@see Backend} instance,
a {@see Cache} instance will be created under the default name.
$caches can also be an array to define multiple cache instances an once.
Keys will be used as cache names and values must be compatible with the
{@see factory()} method $options argument.
<code>
CacheManager::setup(array(
'default' => 'CacheCache\Backend\File'
));
</code>
If $logger is not null, all Backend instances will be wrapped in a
{@see LoggingBackend} object.
@see factory()
@param array $caches
@param Logger $logger
@param int $logLevel | [
"Setups",
"the",
"cache",
"manager",
"."
] | eb64a3748aad4ddaf236ef4738a83267576a0f97 | https://github.com/maximebf/CacheCache/blob/eb64a3748aad4ddaf236ef4738a83267576a0f97/src/CacheCache/CacheManager.php#L64-L76 | train |
fadion/ValidatorAssistant | src/Filters.php | Filters.apply | public function apply()
{
$filters = $this->filters;
$inputs = $this->inputs;
$assistant = $this->assistant;
if (count($filters)) {
foreach ($filters as $name => $filter) {
// Allow filter to defined as array or pipe delimited string
$rules = (is_array($filter)) ? $filter : explode('|', $filter);
// At least a rule is set and the input
// field exists.
if (count($rules) and isset($inputs[$name])) {
foreach ($rules as $rule) {
$splitAt = strpos($rule, ':');
$argument = null;
if ($splitAt) {
$argument = substr($rule, $splitAt+1);
$rule = substr($rule, 0, $splitAt);
}
$rule = strtolower($rule);
$rule = str_replace('_', ' ', $rule);
$rule = str_replace(' ', '', ucwords($rule));
$method = 'filter'.$rule;
// Check if rule is defined as a class method.
if (method_exists($this, $method)) {
$inputs[$name] = $this->$method($inputs[$name], $argument);
}
// Check if ValidatorAssistant object has the same/custom filter defined
if ( $assistant && method_exists($assistant, $method)) {
$inputs[$name] = $assistant->$method($inputs[$name], $argument);
}
}
}
}
}
return $inputs;
} | php | public function apply()
{
$filters = $this->filters;
$inputs = $this->inputs;
$assistant = $this->assistant;
if (count($filters)) {
foreach ($filters as $name => $filter) {
// Allow filter to defined as array or pipe delimited string
$rules = (is_array($filter)) ? $filter : explode('|', $filter);
// At least a rule is set and the input
// field exists.
if (count($rules) and isset($inputs[$name])) {
foreach ($rules as $rule) {
$splitAt = strpos($rule, ':');
$argument = null;
if ($splitAt) {
$argument = substr($rule, $splitAt+1);
$rule = substr($rule, 0, $splitAt);
}
$rule = strtolower($rule);
$rule = str_replace('_', ' ', $rule);
$rule = str_replace(' ', '', ucwords($rule));
$method = 'filter'.$rule;
// Check if rule is defined as a class method.
if (method_exists($this, $method)) {
$inputs[$name] = $this->$method($inputs[$name], $argument);
}
// Check if ValidatorAssistant object has the same/custom filter defined
if ( $assistant && method_exists($assistant, $method)) {
$inputs[$name] = $assistant->$method($inputs[$name], $argument);
}
}
}
}
}
return $inputs;
} | [
"public",
"function",
"apply",
"(",
")",
"{",
"$",
"filters",
"=",
"$",
"this",
"->",
"filters",
";",
"$",
"inputs",
"=",
"$",
"this",
"->",
"inputs",
";",
"$",
"assistant",
"=",
"$",
"this",
"->",
"assistant",
";",
"if",
"(",
"count",
"(",
"$",
... | Apply filters to the inputs.
@return array | [
"Apply",
"filters",
"to",
"the",
"inputs",
"."
] | 8ed6f134fdcf9a8c6ce2dd6a5c9eeb5d4cddf178 | https://github.com/fadion/ValidatorAssistant/blob/8ed6f134fdcf9a8c6ce2dd6a5c9eeb5d4cddf178/src/Filters.php#L41-L86 | train |
fadion/ValidatorAssistant | src/Filters.php | Filters.filterStripTags | private function filterStripTags($value, $argument = null)
{
$allowedTags = array('<p>', '<a>', '<b>', '<i>', '<em>', '<strong>', '<img>', '<br>', '<ul>', '<ol>', '<li>', '<span>', '<blockquote>', '<code>', '<sub>', '<sup>', '<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<dd>', '<dl>', '<label>');
return strip_tags($value, join(null, $allowedTags));
} | php | private function filterStripTags($value, $argument = null)
{
$allowedTags = array('<p>', '<a>', '<b>', '<i>', '<em>', '<strong>', '<img>', '<br>', '<ul>', '<ol>', '<li>', '<span>', '<blockquote>', '<code>', '<sub>', '<sup>', '<h1>', '<h2>', '<h3>', '<h4>', '<h5>', '<h6>', '<dd>', '<dl>', '<label>');
return strip_tags($value, join(null, $allowedTags));
} | [
"private",
"function",
"filterStripTags",
"(",
"$",
"value",
",",
"$",
"argument",
"=",
"null",
")",
"{",
"$",
"allowedTags",
"=",
"array",
"(",
"'<p>'",
",",
"'<a>'",
",",
"'<b>'",
",",
"'<i>'",
",",
"'<em>'",
",",
"'<strong>'",
",",
"'<img>'",
",",
"... | Strip Tags filter
@param string $value
@param string $argument
@return string | [
"Strip",
"Tags",
"filter"
] | 8ed6f134fdcf9a8c6ce2dd6a5c9eeb5d4cddf178 | https://github.com/fadion/ValidatorAssistant/blob/8ed6f134fdcf9a8c6ce2dd6a5c9eeb5d4cddf178/src/Filters.php#L183-L188 | train |
fadion/ValidatorAssistant | src/Filters.php | Filters.filterNumberFormat | private function filterNumberFormat($value, $argument = null)
{
if ($argument and is_int($argument)) {
$value = number_format($value, $argument);
}
return $value;
} | php | private function filterNumberFormat($value, $argument = null)
{
if ($argument and is_int($argument)) {
$value = number_format($value, $argument);
}
return $value;
} | [
"private",
"function",
"filterNumberFormat",
"(",
"$",
"value",
",",
"$",
"argument",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"argument",
"and",
"is_int",
"(",
"$",
"argument",
")",
")",
"{",
"$",
"value",
"=",
"number_format",
"(",
"$",
"value",
",",
... | Number Format filter
@param string $value
@param string $argument
@return string | [
"Number",
"Format",
"filter"
] | 8ed6f134fdcf9a8c6ce2dd6a5c9eeb5d4cddf178 | https://github.com/fadion/ValidatorAssistant/blob/8ed6f134fdcf9a8c6ce2dd6a5c9eeb5d4cddf178/src/Filters.php#L329-L336 | train |
jbouzekri/FileUploaderBundle | Service/ValidatorManager.php | ValidatorManager.validate | public function validate($endpoint, $value, $configKey = 'upload_validators')
{
$validationConfiguration = $this->configuration->getValue($endpoint, $configKey);
foreach ((array) $validationConfiguration as $validationType => $config) {
$validator = $this->validators->getValidator($validationType);
$validator->applyValidator($value, $config);
}
} | php | public function validate($endpoint, $value, $configKey = 'upload_validators')
{
$validationConfiguration = $this->configuration->getValue($endpoint, $configKey);
foreach ((array) $validationConfiguration as $validationType => $config) {
$validator = $this->validators->getValidator($validationType);
$validator->applyValidator($value, $config);
}
} | [
"public",
"function",
"validate",
"(",
"$",
"endpoint",
",",
"$",
"value",
",",
"$",
"configKey",
"=",
"'upload_validators'",
")",
"{",
"$",
"validationConfiguration",
"=",
"$",
"this",
"->",
"configuration",
"->",
"getValue",
"(",
"$",
"endpoint",
",",
"$",... | Validate by applying validators from validator chain
@param string $endpoint
@param mixed $value
@param string $configKey
@throws \Jb\Bundle\FileUploaderBundle\Exception\ValidationException | [
"Validate",
"by",
"applying",
"validators",
"from",
"validator",
"chain"
] | 592e7ed827eaa4e7f8f6f52947ca5e5a86835f6c | https://github.com/jbouzekri/FileUploaderBundle/blob/592e7ed827eaa4e7f8f6f52947ca5e5a86835f6c/Service/ValidatorManager.php#L54-L62 | train |
minkphp/SahiClient | src/Client.php | Client.start | public function start($browserName = null)
{
if ($this->started) {
throw new Exception\ConnectionException('Client is already started');
}
if (!$this->con->isProxyStarted()) {
throw new Exception\ConnectionException('Sahi proxy seems not running');
}
// open browser if connection uses custom SID (not defaultly autogenerated)
if (!$this->con->isCustomSidProvided()) {
if (null === $browserName) {
throw new \InvalidArgumentException('Specify browser to run in');
}
$this->con->start($browserName);
$limit = 600;
while (!$this->con->isReady()) {
usleep(100000);
if (--$limit <= 0) {
throw new Exception\ConnectionException(
'Connection time limit reached'
);
}
}
$this->browserAutoruned = true;
} elseif (!$this->con->isReady()) {
throw new Exception\ConnectionException(sprintf(
"Can not connect to Sahi session with id \"%s\".\n".
"Start Sahi session in target browser by opening:\n".
"http://sahi.example.com/_s_/dyn/Driver_start?sahisid=%s&startUrl=http://sahi.example.com/_s_/dyn/Driver_initialized",
$this->con->getSid(),
$this->con->getSid()
));
}
$this->started = true;
} | php | public function start($browserName = null)
{
if ($this->started) {
throw new Exception\ConnectionException('Client is already started');
}
if (!$this->con->isProxyStarted()) {
throw new Exception\ConnectionException('Sahi proxy seems not running');
}
// open browser if connection uses custom SID (not defaultly autogenerated)
if (!$this->con->isCustomSidProvided()) {
if (null === $browserName) {
throw new \InvalidArgumentException('Specify browser to run in');
}
$this->con->start($browserName);
$limit = 600;
while (!$this->con->isReady()) {
usleep(100000);
if (--$limit <= 0) {
throw new Exception\ConnectionException(
'Connection time limit reached'
);
}
}
$this->browserAutoruned = true;
} elseif (!$this->con->isReady()) {
throw new Exception\ConnectionException(sprintf(
"Can not connect to Sahi session with id \"%s\".\n".
"Start Sahi session in target browser by opening:\n".
"http://sahi.example.com/_s_/dyn/Driver_start?sahisid=%s&startUrl=http://sahi.example.com/_s_/dyn/Driver_initialized",
$this->con->getSid(),
$this->con->getSid()
));
}
$this->started = true;
} | [
"public",
"function",
"start",
"(",
"$",
"browserName",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"ConnectionException",
"(",
"'Client is already started'",
")",
";",
"}",
"if",
"(",
"!",
... | Start Sahi browser session.
@param string $browserName (firefox, ie, safari, chrome, opera)
@throws Exception\ConnectionException
@throws \InvalidArgumentException | [
"Start",
"Sahi",
"browser",
"session",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L51-L91 | train |
minkphp/SahiClient | src/Client.php | Client.stop | public function stop()
{
if (!$this->started) {
throw new Exception\ConnectionException('Client is not started');
}
if ($this->browserAutoruned) {
$this->con->stop();
}
$this->started = false;
} | php | public function stop()
{
if (!$this->started) {
throw new Exception\ConnectionException('Client is not started');
}
if ($this->browserAutoruned) {
$this->con->stop();
}
$this->started = false;
} | [
"public",
"function",
"stop",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"started",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"ConnectionException",
"(",
"'Client is not started'",
")",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"browserAutoruned",
... | Stop Sahi browser session. | [
"Stop",
"Sahi",
"browser",
"session",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L96-L107 | train |
minkphp/SahiClient | src/Client.php | Client.navigateTo | public function navigateTo($url, $reload = null)
{
$arguments = array(json_encode($url));
if (null !== $reload) {
$arguments[] = (bool) $reload ? 'true' : 'false';
}
$this->con->executeStep(sprintf('_sahi._navigateTo(%s)', implode(', ', $arguments)));
} | php | public function navigateTo($url, $reload = null)
{
$arguments = array(json_encode($url));
if (null !== $reload) {
$arguments[] = (bool) $reload ? 'true' : 'false';
}
$this->con->executeStep(sprintf('_sahi._navigateTo(%s)', implode(', ', $arguments)));
} | [
"public",
"function",
"navigateTo",
"(",
"$",
"url",
",",
"$",
"reload",
"=",
"null",
")",
"{",
"$",
"arguments",
"=",
"array",
"(",
"json_encode",
"(",
"$",
"url",
")",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"reload",
")",
"{",
"$",
"arguments",... | Navigates to the given URL.
@param string $url URL
@param boolean|null $reload force reload | [
"Navigates",
"to",
"the",
"given",
"URL",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L135-L144 | train |
minkphp/SahiClient | src/Client.php | Client.wait | public function wait($timeout, $condition)
{
$conditionResult = false;
while ($timeout > 0 && true !== $conditionResult) {
usleep(100);
$timeout -= 100;
// don't throw exceptions
try {
$conditionResult = $this->con->evaluateJavascript($condition);
} catch (\Exception $e) {
$conditionResult = false;
}
}
return (boolean) $conditionResult;
} | php | public function wait($timeout, $condition)
{
$conditionResult = false;
while ($timeout > 0 && true !== $conditionResult) {
usleep(100);
$timeout -= 100;
// don't throw exceptions
try {
$conditionResult = $this->con->evaluateJavascript($condition);
} catch (\Exception $e) {
$conditionResult = false;
}
}
return (boolean) $conditionResult;
} | [
"public",
"function",
"wait",
"(",
"$",
"timeout",
",",
"$",
"condition",
")",
"{",
"$",
"conditionResult",
"=",
"false",
";",
"while",
"(",
"$",
"timeout",
">",
"0",
"&&",
"true",
"!==",
"$",
"conditionResult",
")",
"{",
"usleep",
"(",
"100",
")",
"... | Waits for timeInMilliseconds ms or till the condition is satisfied on the browser,
which ever is sooner.
@param integer $timeout timeout in milliseconds
@param string $condition JS condition
@return boolean | [
"Waits",
"for",
"timeInMilliseconds",
"ms",
"or",
"till",
"the",
"condition",
"is",
"satisfied",
"on",
"the",
"browser",
"which",
"ever",
"is",
"sooner",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L165-L181 | train |
minkphp/SahiClient | src/Client.php | Client.findDiv | public function findDiv($id = null, array $relations = array())
{
return new Accessor\DivAccessor($id, $relations, $this->con);
} | php | public function findDiv($id = null, array $relations = array())
{
return new Accessor\DivAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findDiv",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"DivAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"this",
"->",
"con",
... | Find DIV element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\DivAccessor | [
"Find",
"DIV",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L243-L246 | train |
minkphp/SahiClient | src/Client.php | Client.findImage | public function findImage($id = null, array $relations = array())
{
return new Accessor\ImageAccessor($id, $relations, $this->con);
} | php | public function findImage($id = null, array $relations = array())
{
return new Accessor\ImageAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findImage",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"ImageAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"this",
"->",
"con"... | Find img element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\ImageAccessor | [
"Find",
"img",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L282-L285 | train |
minkphp/SahiClient | src/Client.php | Client.findLabel | public function findLabel($id = null, array $relations = array())
{
return new Accessor\LabelAccessor($id, $relations, $this->con);
} | php | public function findLabel($id = null, array $relations = array())
{
return new Accessor\LabelAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findLabel",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"LabelAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"this",
"->",
"con"... | Find label element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\LabelAccessor | [
"Find",
"label",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L295-L298 | train |
minkphp/SahiClient | src/Client.php | Client.findLink | public function findLink($id = null, array $relations = array())
{
return new Accessor\LinkAccessor($id, $relations, $this->con);
} | php | public function findLink($id = null, array $relations = array())
{
return new Accessor\LinkAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findLink",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"LinkAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"this",
"->",
"con",
... | Find a element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\LinkAccessor | [
"Find",
"a",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L308-L311 | train |
minkphp/SahiClient | src/Client.php | Client.findListItem | public function findListItem($id = null, array $relations = array())
{
return new Accessor\ListItemAccessor($id, $relations, $this->con);
} | php | public function findListItem($id = null, array $relations = array())
{
return new Accessor\ListItemAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findListItem",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"ListItemAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"this",
"->",
... | Find li element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\ListItemAccessor | [
"Find",
"li",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L321-L324 | train |
minkphp/SahiClient | src/Client.php | Client.findSpan | public function findSpan($id = null, array $relations = array())
{
return new Accessor\SpanAccessor($id, $relations, $this->con);
} | php | public function findSpan($id = null, array $relations = array())
{
return new Accessor\SpanAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findSpan",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"SpanAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"this",
"->",
"con",
... | Find span element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\SpanAccessor | [
"Find",
"span",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L334-L337 | train |
minkphp/SahiClient | src/Client.php | Client.findButton | public function findButton($id = null, array $relations = array())
{
return new Accessor\Form\ButtonAccessor($id, $relations, $this->con);
} | php | public function findButton($id = null, array $relations = array())
{
return new Accessor\Form\ButtonAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findButton",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"ButtonAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"th... | Find button element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\ButtonAccessor | [
"Find",
"button",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L347-L350 | train |
minkphp/SahiClient | src/Client.php | Client.findCheckbox | public function findCheckbox($id = null, array $relations = array())
{
return new Accessor\Form\CheckboxAccessor($id, $relations, $this->con);
} | php | public function findCheckbox($id = null, array $relations = array())
{
return new Accessor\Form\CheckboxAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findCheckbox",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"CheckboxAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
... | Find checkbox element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\CheckboxAccessor | [
"Find",
"checkbox",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L360-L363 | train |
minkphp/SahiClient | src/Client.php | Client.findFile | public function findFile($id = null, array $relations = array())
{
return new Accessor\Form\FileAccessor($id, $relations, $this->con);
} | php | public function findFile($id = null, array $relations = array())
{
return new Accessor\Form\FileAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findFile",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"FileAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"this",... | Find file element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\FileAccessor | [
"Find",
"file",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L373-L376 | train |
minkphp/SahiClient | src/Client.php | Client.findHidden | public function findHidden($id = null, array $relations = array())
{
return new Accessor\Form\HiddenAccessor($id, $relations, $this->con);
} | php | public function findHidden($id = null, array $relations = array())
{
return new Accessor\Form\HiddenAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findHidden",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"HiddenAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"th... | Find hidden element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\HiddenAccessor | [
"Find",
"hidden",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L386-L389 | train |
minkphp/SahiClient | src/Client.php | Client.findImageSubmitButton | public function findImageSubmitButton($id = null, array $relations = array())
{
return new Accessor\Form\ImageSubmitButtonAccessor($id, $relations, $this->con);
} | php | public function findImageSubmitButton($id = null, array $relations = array())
{
return new Accessor\Form\ImageSubmitButtonAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findImageSubmitButton",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"ImageSubmitButtonAccessor",
"(",
"$",
"id",
",",
"$",
"relations... | Find image submit button element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\ImageSubmitButtonAccessor | [
"Find",
"image",
"submit",
"button",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L399-L402 | train |
minkphp/SahiClient | src/Client.php | Client.findOption | public function findOption($id = null, array $relations = array())
{
return new Accessor\Form\OptionAccessor($id, $relations, $this->con);
} | php | public function findOption($id = null, array $relations = array())
{
return new Accessor\Form\OptionAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findOption",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"OptionAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"th... | Find select option element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\OptionAccessor | [
"Find",
"select",
"option",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L412-L415 | train |
minkphp/SahiClient | src/Client.php | Client.findPassword | public function findPassword($id = null, array $relations = array())
{
return new Accessor\Form\PasswordAccessor($id, $relations, $this->con);
} | php | public function findPassword($id = null, array $relations = array())
{
return new Accessor\Form\PasswordAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findPassword",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"PasswordAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
... | Find password element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\PasswordAccessor | [
"Find",
"password",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L425-L428 | train |
minkphp/SahiClient | src/Client.php | Client.findRadio | public function findRadio($id = null, array $relations = array())
{
return new Accessor\Form\RadioAccessor($id, $relations, $this->con);
} | php | public function findRadio($id = null, array $relations = array())
{
return new Accessor\Form\RadioAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findRadio",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"RadioAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"this... | Find radio button element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\RadioAccessor | [
"Find",
"radio",
"button",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L438-L441 | train |
minkphp/SahiClient | src/Client.php | Client.findReset | public function findReset($id = null, array $relations = array())
{
return new Accessor\Form\ResetAccessor($id, $relations, $this->con);
} | php | public function findReset($id = null, array $relations = array())
{
return new Accessor\Form\ResetAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findReset",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"ResetAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"this... | Find reset button element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\ResetAccessor | [
"Find",
"reset",
"button",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L451-L454 | train |
minkphp/SahiClient | src/Client.php | Client.findSelect | public function findSelect($id = null, array $relations = array())
{
return new Accessor\Form\SelectAccessor($id, $relations, $this->con);
} | php | public function findSelect($id = null, array $relations = array())
{
return new Accessor\Form\SelectAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findSelect",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"SelectAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"th... | Find select element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\SelectAccessor | [
"Find",
"select",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L464-L467 | train |
minkphp/SahiClient | src/Client.php | Client.findSubmit | public function findSubmit($id = null, array $relations = array())
{
return new Accessor\Form\SubmitAccessor($id, $relations, $this->con);
} | php | public function findSubmit($id = null, array $relations = array())
{
return new Accessor\Form\SubmitAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findSubmit",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"SubmitAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"th... | Find submit element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\SubmitAccessor | [
"Find",
"submit",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L477-L480 | train |
minkphp/SahiClient | src/Client.php | Client.findTextarea | public function findTextarea($id = null, array $relations = array())
{
return new Accessor\Form\TextareaAccessor($id, $relations, $this->con);
} | php | public function findTextarea($id = null, array $relations = array())
{
return new Accessor\Form\TextareaAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findTextarea",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"TextareaAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
... | Find textarea element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\TextareaAccessor | [
"Find",
"textarea",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L490-L493 | train |
minkphp/SahiClient | src/Client.php | Client.findTextbox | public function findTextbox($id = null, array $relations = array())
{
return new Accessor\Form\TextboxAccessor($id, $relations, $this->con);
} | php | public function findTextbox($id = null, array $relations = array())
{
return new Accessor\Form\TextboxAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findTextbox",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Form",
"\\",
"TextboxAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"... | Find textbox element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Form\TextboxAccessor | [
"Find",
"textbox",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L503-L506 | train |
minkphp/SahiClient | src/Client.php | Client.findCell | public function findCell($id = null, array $relations = array())
{
return new Accessor\Table\CellAccessor($id, $relations, $this->con);
} | php | public function findCell($id = null, array $relations = array())
{
return new Accessor\Table\CellAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findCell",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Table",
"\\",
"CellAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"this"... | Find table cell element.
@param string|array $id simple element identifier or array of (Table, rowText, colText)
@param array $relations tag relations (near, in, under)
@return Accessor\Table\CellAccessor | [
"Find",
"table",
"cell",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L516-L519 | train |
minkphp/SahiClient | src/Client.php | Client.findRow | public function findRow($id = null, array $relations = array())
{
return new Accessor\Table\RowAccessor($id, $relations, $this->con);
} | php | public function findRow($id = null, array $relations = array())
{
return new Accessor\Table\RowAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findRow",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Table",
"\\",
"RowAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
"$",
"this",
... | Find table row element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Table\RowAccessor | [
"Find",
"table",
"row",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L529-L532 | train |
minkphp/SahiClient | src/Client.php | Client.findTableHeader | public function findTableHeader($id = null, array $relations = array())
{
return new Accessor\Table\TableHeaderAccessor($id, $relations, $this->con);
} | php | public function findTableHeader($id = null, array $relations = array())
{
return new Accessor\Table\TableHeaderAccessor($id, $relations, $this->con);
} | [
"public",
"function",
"findTableHeader",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"return",
"new",
"Accessor",
"\\",
"Table",
"\\",
"TableHeaderAccessor",
"(",
"$",
"id",
",",
"$",
"relations",
",",
... | Find table header element.
@param string $id element identifier
@param array $relations tag relations (near, in, under)
@return Accessor\Table\TableHeaderAccessor | [
"Find",
"table",
"header",
"element",
"."
] | edd87e8445c4a1c28233eeae5f226fac7afc5ed8 | https://github.com/minkphp/SahiClient/blob/edd87e8445c4a1c28233eeae5f226fac7afc5ed8/src/Client.php#L542-L545 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.