repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
web-token/jwt-framework | src/Component/Signature/Signature.php | Signature.getHeaderParameter | public function getHeaderParameter(string $key)
{
if ($this->hasHeaderParameter($key)) {
return $this->header[$key];
}
throw new \InvalidArgumentException(\sprintf('The header "%s" does not exist', $key));
} | php | public function getHeaderParameter(string $key)
{
if ($this->hasHeaderParameter($key)) {
return $this->header[$key];
}
throw new \InvalidArgumentException(\sprintf('The header "%s" does not exist', $key));
} | [
"public",
"function",
"getHeaderParameter",
"(",
"string",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasHeaderParameter",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"header",
"[",
"$",
"key",
"]",
";",
"}",
"throw",
"new"... | Returns the value of the unprotected header of the specified key.
@param string $key The key
@return mixed|null Header value | [
"Returns",
"the",
"value",
"of",
"the",
"unprotected",
"header",
"of",
"the",
"specified",
"key",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Signature/Signature.php#L118-L125 |
web-token/jwt-framework | src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php | JWKSetSource.getJWKSetSources | private function getJWKSetSources(): array
{
if (null !== $this->jwkset_sources) {
return $this->jwkset_sources;
}
// load bundled adapter factories
$tempContainer = new ContainerBuilder();
$tempContainer->registerForAutoconfiguration(JWKSetSourceInterface::class... | php | private function getJWKSetSources(): array
{
if (null !== $this->jwkset_sources) {
return $this->jwkset_sources;
}
// load bundled adapter factories
$tempContainer = new ContainerBuilder();
$tempContainer->registerForAutoconfiguration(JWKSetSourceInterface::class... | [
"private",
"function",
"getJWKSetSources",
"(",
")",
":",
"array",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"jwkset_sources",
")",
"{",
"return",
"$",
"this",
"->",
"jwkset_sources",
";",
"}",
"// load bundled adapter factories",
"$",
"tempContainer",
... | @throws \Exception
@return JWKSetSourceInterface[] | [
"@throws",
"\\",
"Exception"
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSetSource.php#L82-L105 |
web-token/jwt-framework | src/Component/Core/Util/ECKey.php | ECKey.createECKey | public static function createECKey(string $curve, array $values = []): JWK
{
try {
$jwk = self::createECKeyUsingOpenSSL($curve);
} catch (Throwable $e) {
$jwk = self::createECKeyUsingPurePhp($curve);
}
$values = array_merge($values, $jwk);
return new ... | php | public static function createECKey(string $curve, array $values = []): JWK
{
try {
$jwk = self::createECKeyUsingOpenSSL($curve);
} catch (Throwable $e) {
$jwk = self::createECKeyUsingPurePhp($curve);
}
$values = array_merge($values, $jwk);
return new ... | [
"public",
"static",
"function",
"createECKey",
"(",
"string",
"$",
"curve",
",",
"array",
"$",
"values",
"=",
"[",
"]",
")",
":",
"JWK",
"{",
"try",
"{",
"$",
"jwk",
"=",
"self",
"::",
"createECKeyUsingOpenSSL",
"(",
"$",
"curve",
")",
";",
"}",
"cat... | Creates a EC key with the given curve and additional values.
@param string $curve The curve
@param array $values values to configure the key | [
"Creates",
"a",
"EC",
"key",
"with",
"the",
"given",
"curve",
"and",
"additional",
"values",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Core/Util/ECKey.php#L96-L106 |
web-token/jwt-framework | src/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCM.php | AESGCM.decryptContent | public function decryptContent(string $data, string $cek, string $iv, ?string $aad, string $encoded_protected_header, string $tag): string
{
$calculated_aad = $encoded_protected_header;
if (null !== $aad) {
$calculated_aad .= '.'.$aad;
}
$P = \openssl_decrypt($data, $thi... | php | public function decryptContent(string $data, string $cek, string $iv, ?string $aad, string $encoded_protected_header, string $tag): string
{
$calculated_aad = $encoded_protected_header;
if (null !== $aad) {
$calculated_aad .= '.'.$aad;
}
$P = \openssl_decrypt($data, $thi... | [
"public",
"function",
"decryptContent",
"(",
"string",
"$",
"data",
",",
"string",
"$",
"cek",
",",
"string",
"$",
"iv",
",",
"?",
"string",
"$",
"aad",
",",
"string",
"$",
"encoded_protected_header",
",",
"string",
"$",
"tag",
")",
":",
"string",
"{",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/EncryptionAlgorithm/ContentEncryption/AESGCM/AESGCM.php#L43-L56 |
web-token/jwt-framework | src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php | JWKSource.getJWKSources | private function getJWKSources(): array
{
if (null !== $this->jwkSources) {
return $this->jwkSources;
}
// load bundled adapter factories
$tempContainer = new ContainerBuilder();
$tempContainer->registerForAutoconfiguration(JWKSourceInterface::class)->addTag('jos... | php | private function getJWKSources(): array
{
if (null !== $this->jwkSources) {
return $this->jwkSources;
}
// load bundled adapter factories
$tempContainer = new ContainerBuilder();
$tempContainer->registerForAutoconfiguration(JWKSourceInterface::class)->addTag('jos... | [
"private",
"function",
"getJWKSources",
"(",
")",
":",
"array",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"jwkSources",
")",
"{",
"return",
"$",
"this",
"->",
"jwkSources",
";",
"}",
"// load bundled adapter factories",
"$",
"tempContainer",
"=",
"ne... | @throws \Exception
@return JWKSourceInterface[] | [
"@throws",
"\\",
"Exception"
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Bundle/JoseFramework/DependencyInjection/Source/KeyManagement/JWKSource.php#L82-L106 |
web-token/jwt-framework | src/Component/Encryption/JWEDecrypter.php | JWEDecrypter.decryptUsingKey | public function decryptUsingKey(JWE &$jwe, JWK $jwk, int $recipient): bool
{
$jwkset = new JWKSet([$jwk]);
return $this->decryptUsingKeySet($jwe, $jwkset, $recipient);
} | php | public function decryptUsingKey(JWE &$jwe, JWK $jwk, int $recipient): bool
{
$jwkset = new JWKSet([$jwk]);
return $this->decryptUsingKeySet($jwe, $jwkset, $recipient);
} | [
"public",
"function",
"decryptUsingKey",
"(",
"JWE",
"&",
"$",
"jwe",
",",
"JWK",
"$",
"jwk",
",",
"int",
"$",
"recipient",
")",
":",
"bool",
"{",
"$",
"jwkset",
"=",
"new",
"JWKSet",
"(",
"[",
"$",
"jwk",
"]",
")",
";",
"return",
"$",
"this",
"-... | This method will try to decrypt the given JWE and recipient using a JWK.
@param JWE $jwe A JWE object to decrypt
@param JWK $jwk The key used to decrypt the input
@param int $recipient The recipient used to decrypt the token | [
"This",
"method",
"will",
"try",
"to",
"decrypt",
"the",
"given",
"JWE",
"and",
"recipient",
"using",
"a",
"JWK",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/JWEDecrypter.php#L89-L94 |
web-token/jwt-framework | src/Component/Encryption/JWEDecrypter.php | JWEDecrypter.decryptUsingKeySet | public function decryptUsingKeySet(JWE &$jwe, JWKSet $jwkset, int $recipient): bool
{
$this->checkJWKSet($jwkset);
$this->checkPayload($jwe);
$this->checkRecipients($jwe);
$plaintext = $this->decryptRecipientKey($jwe, $jwkset, $recipient);
if (null !== $plaintext) {
... | php | public function decryptUsingKeySet(JWE &$jwe, JWKSet $jwkset, int $recipient): bool
{
$this->checkJWKSet($jwkset);
$this->checkPayload($jwe);
$this->checkRecipients($jwe);
$plaintext = $this->decryptRecipientKey($jwe, $jwkset, $recipient);
if (null !== $plaintext) {
... | [
"public",
"function",
"decryptUsingKeySet",
"(",
"JWE",
"&",
"$",
"jwe",
",",
"JWKSet",
"$",
"jwkset",
",",
"int",
"$",
"recipient",
")",
":",
"bool",
"{",
"$",
"this",
"->",
"checkJWKSet",
"(",
"$",
"jwkset",
")",
";",
"$",
"this",
"->",
"checkPayload... | This method will try to decrypt the given JWE and recipient using a JWKSet.
@param JWE $jwe A JWE object to decrypt
@param JWKSet $jwkset The key set used to decrypt the input
@param int $recipient The recipient used to decrypt the token | [
"This",
"method",
"will",
"try",
"to",
"decrypt",
"the",
"given",
"JWE",
"and",
"recipient",
"using",
"a",
"JWKSet",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/JWEDecrypter.php#L103-L117 |
web-token/jwt-framework | src/Component/Encryption/JWEBuilder.php | JWEBuilder.create | public function create(): self
{
$this->payload = null;
$this->aad = null;
$this->recipients = [];
$this->sharedProtectedHeader = [];
$this->sharedHeader = [];
$this->compressionMethod = null;
$this->contentEncryptionAlgorithm = null;
$this->keyManagem... | php | public function create(): self
{
$this->payload = null;
$this->aad = null;
$this->recipients = [];
$this->sharedProtectedHeader = [];
$this->sharedHeader = [];
$this->compressionMethod = null;
$this->contentEncryptionAlgorithm = null;
$this->keyManagem... | [
"public",
"function",
"create",
"(",
")",
":",
"self",
"{",
"$",
"this",
"->",
"payload",
"=",
"null",
";",
"$",
"this",
"->",
"aad",
"=",
"null",
";",
"$",
"this",
"->",
"recipients",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"sharedProtectedHeader",
... | Reset the current data.
@return JWEBuilder | [
"Reset",
"the",
"current",
"data",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/JWEBuilder.php#L109-L121 |
web-token/jwt-framework | src/Component/Encryption/JWEBuilder.php | JWEBuilder.withPayload | public function withPayload($payload): self
{
$payload = \is_string($payload) ? $payload : $this->jsonConverter->encode($payload);
if (false === \mb_detect_encoding($payload, 'UTF-8', true)) {
throw new \InvalidArgumentException('The payload must be encoded in UTF-8');
}
... | php | public function withPayload($payload): self
{
$payload = \is_string($payload) ? $payload : $this->jsonConverter->encode($payload);
if (false === \mb_detect_encoding($payload, 'UTF-8', true)) {
throw new \InvalidArgumentException('The payload must be encoded in UTF-8');
}
... | [
"public",
"function",
"withPayload",
"(",
"$",
"payload",
")",
":",
"self",
"{",
"$",
"payload",
"=",
"\\",
"is_string",
"(",
"$",
"payload",
")",
"?",
"$",
"payload",
":",
"$",
"this",
"->",
"jsonConverter",
"->",
"encode",
"(",
"$",
"payload",
")",
... | Set the payload of the JWE to build.
@return JWEBuilder | [
"Set",
"the",
"payload",
"of",
"the",
"JWE",
"to",
"build",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/JWEBuilder.php#L152-L162 |
web-token/jwt-framework | src/Component/Encryption/JWEBuilder.php | JWEBuilder.withSharedProtectedHeader | public function withSharedProtectedHeader(array $sharedProtectedHeader): self
{
$this->checkDuplicatedHeaderParameters($sharedProtectedHeader, $this->sharedHeader);
foreach ($this->recipients as $recipient) {
$this->checkDuplicatedHeaderParameters($sharedProtectedHeader, $recipient->getH... | php | public function withSharedProtectedHeader(array $sharedProtectedHeader): self
{
$this->checkDuplicatedHeaderParameters($sharedProtectedHeader, $this->sharedHeader);
foreach ($this->recipients as $recipient) {
$this->checkDuplicatedHeaderParameters($sharedProtectedHeader, $recipient->getH... | [
"public",
"function",
"withSharedProtectedHeader",
"(",
"array",
"$",
"sharedProtectedHeader",
")",
":",
"self",
"{",
"$",
"this",
"->",
"checkDuplicatedHeaderParameters",
"(",
"$",
"sharedProtectedHeader",
",",
"$",
"this",
"->",
"sharedHeader",
")",
";",
"foreach"... | Set the shared protected header of the JWE to build.
@return JWEBuilder | [
"Set",
"the",
"shared",
"protected",
"header",
"of",
"the",
"JWE",
"to",
"build",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/JWEBuilder.php#L182-L192 |
web-token/jwt-framework | src/Component/Encryption/JWEBuilder.php | JWEBuilder.withSharedHeader | public function withSharedHeader(array $sharedHeader): self
{
$this->checkDuplicatedHeaderParameters($this->sharedProtectedHeader, $sharedHeader);
foreach ($this->recipients as $recipient) {
$this->checkDuplicatedHeaderParameters($sharedHeader, $recipient->getHeader());
}
... | php | public function withSharedHeader(array $sharedHeader): self
{
$this->checkDuplicatedHeaderParameters($this->sharedProtectedHeader, $sharedHeader);
foreach ($this->recipients as $recipient) {
$this->checkDuplicatedHeaderParameters($sharedHeader, $recipient->getHeader());
}
... | [
"public",
"function",
"withSharedHeader",
"(",
"array",
"$",
"sharedHeader",
")",
":",
"self",
"{",
"$",
"this",
"->",
"checkDuplicatedHeaderParameters",
"(",
"$",
"this",
"->",
"sharedProtectedHeader",
",",
"$",
"sharedHeader",
")",
";",
"foreach",
"(",
"$",
... | Set the shared header of the JWE to build.
@return JWEBuilder | [
"Set",
"the",
"shared",
"header",
"of",
"the",
"JWE",
"to",
"build",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/JWEBuilder.php#L199-L209 |
web-token/jwt-framework | src/Component/Encryption/JWEBuilder.php | JWEBuilder.addRecipient | public function addRecipient(JWK $recipientKey, array $recipientHeader = []): self
{
$this->checkDuplicatedHeaderParameters($this->sharedProtectedHeader, $recipientHeader);
$this->checkDuplicatedHeaderParameters($this->sharedHeader, $recipientHeader);
$clone = clone $this;
$completeH... | php | public function addRecipient(JWK $recipientKey, array $recipientHeader = []): self
{
$this->checkDuplicatedHeaderParameters($this->sharedProtectedHeader, $recipientHeader);
$this->checkDuplicatedHeaderParameters($this->sharedHeader, $recipientHeader);
$clone = clone $this;
$completeH... | [
"public",
"function",
"addRecipient",
"(",
"JWK",
"$",
"recipientKey",
",",
"array",
"$",
"recipientHeader",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"this",
"->",
"checkDuplicatedHeaderParameters",
"(",
"$",
"this",
"->",
"sharedProtectedHeader",
",",
"$",
... | Adds a recipient to the JWE to build.
@return JWEBuilder | [
"Adds",
"a",
"recipient",
"to",
"the",
"JWE",
"to",
"build",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/JWEBuilder.php#L216-L251 |
web-token/jwt-framework | src/Component/Encryption/JWEBuilder.php | JWEBuilder.build | public function build(): JWE
{
if (null === $this->payload) {
throw new \LogicException('Payload not set.');
}
if (0 === \count($this->recipients)) {
throw new \LogicException('No recipient.');
}
$additionalHeader = [];
$cek = $this->determine... | php | public function build(): JWE
{
if (null === $this->payload) {
throw new \LogicException('Payload not set.');
}
if (0 === \count($this->recipients)) {
throw new \LogicException('No recipient.');
}
$additionalHeader = [];
$cek = $this->determine... | [
"public",
"function",
"build",
"(",
")",
":",
"JWE",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"payload",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Payload not set.'",
")",
";",
"}",
"if",
"(",
"0",
"===",
"\\",
"count",
"(",
... | Builds the JWE. | [
"Builds",
"the",
"JWE",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/JWEBuilder.php#L256-L284 |
web-token/jwt-framework | src/Component/Checker/ClaimCheckerManager.php | ClaimCheckerManager.check | public function check(array $claims, array $mandatoryClaims = []): array
{
$this->checkMandatoryClaims($mandatoryClaims, $claims);
$checkedClaims = [];
foreach ($this->checkers as $claim => $checker) {
if (\array_key_exists($claim, $claims)) {
$checker->checkClaim... | php | public function check(array $claims, array $mandatoryClaims = []): array
{
$this->checkMandatoryClaims($mandatoryClaims, $claims);
$checkedClaims = [];
foreach ($this->checkers as $claim => $checker) {
if (\array_key_exists($claim, $claims)) {
$checker->checkClaim... | [
"public",
"function",
"check",
"(",
"array",
"$",
"claims",
",",
"array",
"$",
"mandatoryClaims",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"this",
"->",
"checkMandatoryClaims",
"(",
"$",
"mandatoryClaims",
",",
"$",
"claims",
")",
";",
"$",
"checkedCl... | This method checks all the claims passed as argument.
All claims are checked against the claim checkers.
If one fails, the InvalidClaimException is thrown.
This method returns an array with all checked claims.
It is up to the implementor to decide use the claims that have not been checked.
@param string[] $mandatoryC... | [
"This",
"method",
"checks",
"all",
"the",
"claims",
"passed",
"as",
"argument",
".",
"All",
"claims",
"are",
"checked",
"against",
"the",
"claim",
"checkers",
".",
"If",
"one",
"fails",
"the",
"InvalidClaimException",
"is",
"thrown",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Checker/ClaimCheckerManager.php#L85-L97 |
web-token/jwt-framework | src/Component/Checker/ClaimCheckerManager.php | ClaimCheckerManager.checkMandatoryClaims | private function checkMandatoryClaims(array $mandatoryClaims, array $claims)
{
if (empty($mandatoryClaims)) {
return;
}
$diff = \array_keys(\array_diff_key(\array_flip($mandatoryClaims), $claims));
if (!empty($diff)) {
throw new MissingMandatoryClaimException... | php | private function checkMandatoryClaims(array $mandatoryClaims, array $claims)
{
if (empty($mandatoryClaims)) {
return;
}
$diff = \array_keys(\array_diff_key(\array_flip($mandatoryClaims), $claims));
if (!empty($diff)) {
throw new MissingMandatoryClaimException... | [
"private",
"function",
"checkMandatoryClaims",
"(",
"array",
"$",
"mandatoryClaims",
",",
"array",
"$",
"claims",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"mandatoryClaims",
")",
")",
"{",
"return",
";",
"}",
"$",
"diff",
"=",
"\\",
"array_keys",
"(",
"\\... | @param string[] $mandatoryClaims
@throws MissingMandatoryClaimException | [
"@param",
"string",
"[]",
"$mandatoryClaims"
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Checker/ClaimCheckerManager.php#L104-L114 |
web-token/jwt-framework | src/Component/Encryption/NestedTokenLoader.php | NestedTokenLoader.load | public function load(string $token, JWKSet $encryptionKeySet, JWKSet $signatureKeySet, ?int &$signature = null): JWS
{
$recipient = null;
$jwe = $this->jweLoader->loadAndDecryptWithKeySet($token, $encryptionKeySet, $recipient);
$this->checkContentTypeHeader($jwe, $recipient);
if (nul... | php | public function load(string $token, JWKSet $encryptionKeySet, JWKSet $signatureKeySet, ?int &$signature = null): JWS
{
$recipient = null;
$jwe = $this->jweLoader->loadAndDecryptWithKeySet($token, $encryptionKeySet, $recipient);
$this->checkContentTypeHeader($jwe, $recipient);
if (nul... | [
"public",
"function",
"load",
"(",
"string",
"$",
"token",
",",
"JWKSet",
"$",
"encryptionKeySet",
",",
"JWKSet",
"$",
"signatureKeySet",
",",
"?",
"int",
"&",
"$",
"signature",
"=",
"null",
")",
":",
"JWS",
"{",
"$",
"recipient",
"=",
"null",
";",
"$"... | This method will try to load, decrypt and verify the token.
In case of failure, an exception is thrown, otherwise returns the JWS and populates the $signature variable.
@throws \Exception | [
"This",
"method",
"will",
"try",
"to",
"load",
"decrypt",
"and",
"verify",
"the",
"token",
".",
"In",
"case",
"of",
"failure",
"an",
"exception",
"is",
"thrown",
"otherwise",
"returns",
"the",
"JWS",
"and",
"populates",
"the",
"$signature",
"variable",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/NestedTokenLoader.php#L47-L57 |
web-token/jwt-framework | src/Component/KeyManagement/JKUFactory.php | JKUFactory.loadFromUrl | public function loadFromUrl(string $url, array $header = []): JWKSet
{
$content = $this->getContent($url, $header);
$data = $this->jsonConverter->decode($content);
if (!\is_array($data)) {
throw new \RuntimeException('Invalid content.');
}
return JWKSet::createFr... | php | public function loadFromUrl(string $url, array $header = []): JWKSet
{
$content = $this->getContent($url, $header);
$data = $this->jsonConverter->decode($content);
if (!\is_array($data)) {
throw new \RuntimeException('Invalid content.');
}
return JWKSet::createFr... | [
"public",
"function",
"loadFromUrl",
"(",
"string",
"$",
"url",
",",
"array",
"$",
"header",
"=",
"[",
"]",
")",
":",
"JWKSet",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
"$",
"url",
",",
"$",
"header",
")",
";",
"$",
"data",
... | This method will try to fetch the url a retrieve the key set.
Throws an exception in case of failure.
@throws \InvalidArgumentException | [
"This",
"method",
"will",
"try",
"to",
"fetch",
"the",
"url",
"a",
"retrieve",
"the",
"key",
"set",
".",
"Throws",
"an",
"exception",
"in",
"case",
"of",
"failure",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/KeyManagement/JKUFactory.php#L40-L49 |
web-token/jwt-framework | src/Component/KeyManagement/KeyConverter/ECKey.php | ECKey.toPublic | public static function toPublic(self $private): self
{
$data = $private->toArray();
if (\array_key_exists('d', $data)) {
unset($data['d']);
}
return new self($data);
} | php | public static function toPublic(self $private): self
{
$data = $private->toArray();
if (\array_key_exists('d', $data)) {
unset($data['d']);
}
return new self($data);
} | [
"public",
"static",
"function",
"toPublic",
"(",
"self",
"$",
"private",
")",
":",
"self",
"{",
"$",
"data",
"=",
"$",
"private",
"->",
"toArray",
"(",
")",
";",
"if",
"(",
"\\",
"array_key_exists",
"(",
"'d'",
",",
"$",
"data",
")",
")",
"{",
"uns... | @param ECKey $private
@return ECKey | [
"@param",
"ECKey",
"$private"
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/KeyManagement/KeyConverter/ECKey.php#L236-L244 |
web-token/jwt-framework | src/Component/Signature/JWS.php | JWS.create | public static function create(?string $payload, ?string $encodedPayload = null, bool $isPayloadDetached = false): self
{
return new self($payload, $encodedPayload, $isPayloadDetached);
} | php | public static function create(?string $payload, ?string $encodedPayload = null, bool $isPayloadDetached = false): self
{
return new self($payload, $encodedPayload, $isPayloadDetached);
} | [
"public",
"static",
"function",
"create",
"(",
"?",
"string",
"$",
"payload",
",",
"?",
"string",
"$",
"encodedPayload",
"=",
"null",
",",
"bool",
"$",
"isPayloadDetached",
"=",
"false",
")",
":",
"self",
"{",
"return",
"new",
"self",
"(",
"$",
"payload"... | Creates a JWS object.
@return JWS | [
"Creates",
"a",
"JWS",
"object",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Signature/JWS.php#L55-L58 |
web-token/jwt-framework | src/Component/Signature/JWS.php | JWS.getSignature | public function getSignature(int $id): Signature
{
if (isset($this->signatures[$id])) {
return $this->signatures[$id];
}
throw new \InvalidArgumentException('The signature does not exist.');
} | php | public function getSignature(int $id): Signature
{
if (isset($this->signatures[$id])) {
return $this->signatures[$id];
}
throw new \InvalidArgumentException('The signature does not exist.');
} | [
"public",
"function",
"getSignature",
"(",
"int",
"$",
"id",
")",
":",
"Signature",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"signatures",
"[",
"$",
"id",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"signatures",
"[",
"$",
"id",
"]",
... | Returns the signature at the given index. | [
"Returns",
"the",
"signature",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Signature/JWS.php#L99-L106 |
web-token/jwt-framework | src/Component/Signature/JWS.php | JWS.addSignature | public function addSignature(string $signature, array $protectedHeader, ?string $encodedProtectedHeader, array $header = []): self
{
$jws = clone $this;
$jws->signatures[] = Signature::create($signature, $protectedHeader, $encodedProtectedHeader, $header);
return $jws;
} | php | public function addSignature(string $signature, array $protectedHeader, ?string $encodedProtectedHeader, array $header = []): self
{
$jws = clone $this;
$jws->signatures[] = Signature::create($signature, $protectedHeader, $encodedProtectedHeader, $header);
return $jws;
} | [
"public",
"function",
"addSignature",
"(",
"string",
"$",
"signature",
",",
"array",
"$",
"protectedHeader",
",",
"?",
"string",
"$",
"encodedProtectedHeader",
",",
"array",
"$",
"header",
"=",
"[",
"]",
")",
":",
"self",
"{",
"$",
"jws",
"=",
"clone",
"... | This method adds a signature to the JWS object.
Its returns a new JWS object.
@internal
@return JWS | [
"This",
"method",
"adds",
"a",
"signature",
"to",
"the",
"JWS",
"object",
".",
"Its",
"returns",
"a",
"new",
"JWS",
"object",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Signature/JWS.php#L116-L122 |
web-token/jwt-framework | src/Component/Signature/JWS.php | JWS.split | public function split(): array
{
$result = [];
foreach ($this->signatures as $signature) {
$jws = self::create(
$this->payload,
$this->encodedPayload,
$this->isPayloadDetached
);
$jws = $jws->addSignature(
... | php | public function split(): array
{
$result = [];
foreach ($this->signatures as $signature) {
$jws = self::create(
$this->payload,
$this->encodedPayload,
$this->isPayloadDetached
);
$jws = $jws->addSignature(
... | [
"public",
"function",
"split",
"(",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"signatures",
"as",
"$",
"signature",
")",
"{",
"$",
"jws",
"=",
"self",
"::",
"create",
"(",
"$",
"this",
"->",
"pa... | This method splits the JWS into a list of JWSs.
It is only useful when the JWS contains more than one signature (JSON General Serialization).
@return JWS[] | [
"This",
"method",
"splits",
"the",
"JWS",
"into",
"a",
"list",
"of",
"JWSs",
".",
"It",
"is",
"only",
"useful",
"when",
"the",
"JWS",
"contains",
"more",
"than",
"one",
"signature",
"(",
"JSON",
"General",
"Serialization",
")",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Signature/JWS.php#L138-L158 |
web-token/jwt-framework | src/Component/Encryption/NestedTokenLoaderFactory.php | NestedTokenLoaderFactory.create | public function create(array $jweSerializers, array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithms, array $compressionMethods, array $jweHeaderCheckers, array $jwsSerializers, array $signatureAlgorithms, array $jwsHeaderCheckers): NestedTokenLoader
{
$jweLoader = $this->jweLoaderFactory->creat... | php | public function create(array $jweSerializers, array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithms, array $compressionMethods, array $jweHeaderCheckers, array $jwsSerializers, array $signatureAlgorithms, array $jwsHeaderCheckers): NestedTokenLoader
{
$jweLoader = $this->jweLoaderFactory->creat... | [
"public",
"function",
"create",
"(",
"array",
"$",
"jweSerializers",
",",
"array",
"$",
"keyEncryptionAlgorithms",
",",
"array",
"$",
"contentEncryptionAlgorithms",
",",
"array",
"$",
"compressionMethods",
",",
"array",
"$",
"jweHeaderCheckers",
",",
"array",
"$",
... | This method creates a Nested Token Loader with the given encryption/signature algorithms, serializers, compression methods and header checkers. | [
"This",
"method",
"creates",
"a",
"Nested",
"Token",
"Loader",
"with",
"the",
"given",
"encryption",
"/",
"signature",
"algorithms",
"serializers",
"compression",
"methods",
"and",
"header",
"checkers",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/NestedTokenLoaderFactory.php#L42-L48 |
web-token/jwt-framework | src/Component/Encryption/JWEBuilderFactory.php | JWEBuilderFactory.create | public function create(array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithm, array $compressionMethods): JWEBuilder
{
$keyEncryptionAlgorithmManager = $this->algorithmManagerFactory->create($keyEncryptionAlgorithms);
$contentEncryptionAlgorithmManager = $this->algorithmManagerFactory->c... | php | public function create(array $keyEncryptionAlgorithms, array $contentEncryptionAlgorithm, array $compressionMethods): JWEBuilder
{
$keyEncryptionAlgorithmManager = $this->algorithmManagerFactory->create($keyEncryptionAlgorithms);
$contentEncryptionAlgorithmManager = $this->algorithmManagerFactory->c... | [
"public",
"function",
"create",
"(",
"array",
"$",
"keyEncryptionAlgorithms",
",",
"array",
"$",
"contentEncryptionAlgorithm",
",",
"array",
"$",
"compressionMethods",
")",
":",
"JWEBuilder",
"{",
"$",
"keyEncryptionAlgorithmManager",
"=",
"$",
"this",
"->",
"algori... | Creates a JWE Builder object using the given key encryption algorithms, content encryption algorithms and compression methods.
@param string[] $keyEncryptionAlgorithms
@param string[] $contentEncryptionAlgorithm
@param string[] $compressionMethods | [
"Creates",
"a",
"JWE",
"Builder",
"object",
"using",
"the",
"given",
"key",
"encryption",
"algorithms",
"content",
"encryption",
"algorithms",
"and",
"compression",
"methods",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/JWEBuilderFactory.php#L54-L61 |
web-token/jwt-framework | src/Component/KeyManagement/KeyConverter/KeyConverter.php | KeyConverter.loadKeyFromX509Resource | public static function loadKeyFromX509Resource($res): array
{
$key = \openssl_get_publickey($res);
$details = \openssl_pkey_get_details($key);
if (isset($details['key'])) {
$values = self::loadKeyFromPEM($details['key']);
\openssl_x509_export($res, $out);
... | php | public static function loadKeyFromX509Resource($res): array
{
$key = \openssl_get_publickey($res);
$details = \openssl_pkey_get_details($key);
if (isset($details['key'])) {
$values = self::loadKeyFromPEM($details['key']);
\openssl_x509_export($res, $out);
... | [
"public",
"static",
"function",
"loadKeyFromX509Resource",
"(",
"$",
"res",
")",
":",
"array",
"{",
"$",
"key",
"=",
"\\",
"openssl_get_publickey",
"(",
"$",
"res",
")",
";",
"$",
"details",
"=",
"\\",
"openssl_pkey_get_details",
"(",
"$",
"key",
")",
";",... | @param resource $res
@throws \Exception | [
"@param",
"resource",
"$res"
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/KeyManagement/KeyConverter/KeyConverter.php#L62-L82 |
web-token/jwt-framework | src/Component/Core/AlgorithmManagerFactory.php | AlgorithmManagerFactory.add | public function add(string $alias, Algorithm $algorithm): self
{
$this->algorithms[$alias] = $algorithm;
return $this;
} | php | public function add(string $alias, Algorithm $algorithm): self
{
$this->algorithms[$alias] = $algorithm;
return $this;
} | [
"public",
"function",
"add",
"(",
"string",
"$",
"alias",
",",
"Algorithm",
"$",
"algorithm",
")",
":",
"self",
"{",
"$",
"this",
"->",
"algorithms",
"[",
"$",
"alias",
"]",
"=",
"$",
"algorithm",
";",
"return",
"$",
"this",
";",
"}"
] | Adds an algorithm.
Each algorithm is identified by an alias hence it is allowed to have the same algorithm twice (or more).
This can be helpful when an algorithm have several configuration options.
@return AlgorithmManagerFactory | [
"Adds",
"an",
"algorithm",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Core/AlgorithmManagerFactory.php#L31-L36 |
web-token/jwt-framework | src/Component/Core/AlgorithmManagerFactory.php | AlgorithmManagerFactory.create | public function create(array $aliases): AlgorithmManager
{
$algorithms = [];
foreach ($aliases as $alias) {
if (\array_key_exists($alias, $this->algorithms)) {
$algorithms[] = $this->algorithms[$alias];
} else {
throw new \InvalidArgumentExcept... | php | public function create(array $aliases): AlgorithmManager
{
$algorithms = [];
foreach ($aliases as $alias) {
if (\array_key_exists($alias, $this->algorithms)) {
$algorithms[] = $this->algorithms[$alias];
} else {
throw new \InvalidArgumentExcept... | [
"public",
"function",
"create",
"(",
"array",
"$",
"aliases",
")",
":",
"AlgorithmManager",
"{",
"$",
"algorithms",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"aliases",
"as",
"$",
"alias",
")",
"{",
"if",
"(",
"\\",
"array_key_exists",
"(",
"$",
"alias"... | Create an algorithm manager using the given aliases.
@param string[] $aliases | [
"Create",
"an",
"algorithm",
"manager",
"using",
"the",
"given",
"aliases",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Core/AlgorithmManagerFactory.php#L64-L76 |
web-token/jwt-framework | src/Component/Encryption/Util/RSACrypt.php | RSACrypt.encryptWithRSAOAEP | public static function encryptWithRSAOAEP(RSAKey $key, string $plaintext, string $hash_algorithm): string
{
/** @var Hash $hash */
$hash = Hash::$hash_algorithm();
$length = $key->getModulusLength() - 2 * $hash->getLength() - 2;
if (0 >= $length) {
throw new \RuntimeExcep... | php | public static function encryptWithRSAOAEP(RSAKey $key, string $plaintext, string $hash_algorithm): string
{
/** @var Hash $hash */
$hash = Hash::$hash_algorithm();
$length = $key->getModulusLength() - 2 * $hash->getLength() - 2;
if (0 >= $length) {
throw new \RuntimeExcep... | [
"public",
"static",
"function",
"encryptWithRSAOAEP",
"(",
"RSAKey",
"$",
"key",
",",
"string",
"$",
"plaintext",
",",
"string",
"$",
"hash_algorithm",
")",
":",
"string",
"{",
"/** @var Hash $hash */",
"$",
"hash",
"=",
"Hash",
"::",
"$",
"hash_algorithm",
"(... | Encryption. | [
"Encryption",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/Util/RSACrypt.php#L111-L126 |
web-token/jwt-framework | src/Component/Encryption/Util/RSACrypt.php | RSACrypt.decryptWithRSAOAEP | public static function decryptWithRSAOAEP(RSAKey $key, string $ciphertext, string $hash_algorithm): string
{
if (0 >= $key->getModulusLength()) {
throw new \RuntimeException();
}
$hash = Hash::$hash_algorithm();
$ciphertext = \str_split($ciphertext, $key->getModulusLength... | php | public static function decryptWithRSAOAEP(RSAKey $key, string $ciphertext, string $hash_algorithm): string
{
if (0 >= $key->getModulusLength()) {
throw new \RuntimeException();
}
$hash = Hash::$hash_algorithm();
$ciphertext = \str_split($ciphertext, $key->getModulusLength... | [
"public",
"static",
"function",
"decryptWithRSAOAEP",
"(",
"RSAKey",
"$",
"key",
",",
"string",
"$",
"ciphertext",
",",
"string",
"$",
"hash_algorithm",
")",
":",
"string",
"{",
"if",
"(",
"0",
">=",
"$",
"key",
"->",
"getModulusLength",
"(",
")",
")",
"... | Decryption. | [
"Decryption",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/Util/RSACrypt.php#L131-L146 |
web-token/jwt-framework | src/Component/Encryption/Util/RSACrypt.php | RSACrypt.getRSAEP | private static function getRSAEP(RSAKey $key, BigInteger $m): BigInteger
{
if ($m->compare(BigInteger::createFromDecimal(0)) < 0 || $m->compare($key->getModulus()) > 0) {
throw new \RuntimeException();
}
return RSAKey::exponentiate($key, $m);
} | php | private static function getRSAEP(RSAKey $key, BigInteger $m): BigInteger
{
if ($m->compare(BigInteger::createFromDecimal(0)) < 0 || $m->compare($key->getModulus()) > 0) {
throw new \RuntimeException();
}
return RSAKey::exponentiate($key, $m);
} | [
"private",
"static",
"function",
"getRSAEP",
"(",
"RSAKey",
"$",
"key",
",",
"BigInteger",
"$",
"m",
")",
":",
"BigInteger",
"{",
"if",
"(",
"$",
"m",
"->",
"compare",
"(",
"BigInteger",
"::",
"createFromDecimal",
"(",
"0",
")",
")",
"<",
"0",
"||",
... | RSA EP. | [
"RSA",
"EP",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/Util/RSACrypt.php#L169-L176 |
web-token/jwt-framework | src/Component/Encryption/Util/RSACrypt.php | RSACrypt.getRSADP | private static function getRSADP(RSAKey $key, BigInteger $c): BigInteger
{
if ($c->compare(BigInteger::createFromDecimal(0)) < 0 || $c->compare($key->getModulus()) > 0) {
throw new \RuntimeException();
}
return RSAKey::exponentiate($key, $c);
} | php | private static function getRSADP(RSAKey $key, BigInteger $c): BigInteger
{
if ($c->compare(BigInteger::createFromDecimal(0)) < 0 || $c->compare($key->getModulus()) > 0) {
throw new \RuntimeException();
}
return RSAKey::exponentiate($key, $c);
} | [
"private",
"static",
"function",
"getRSADP",
"(",
"RSAKey",
"$",
"key",
",",
"BigInteger",
"$",
"c",
")",
":",
"BigInteger",
"{",
"if",
"(",
"$",
"c",
"->",
"compare",
"(",
"BigInteger",
"::",
"createFromDecimal",
"(",
"0",
")",
")",
"<",
"0",
"||",
... | RSA DP. | [
"RSA",
"DP",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/Util/RSACrypt.php#L181-L188 |
web-token/jwt-framework | src/Component/Encryption/Util/RSACrypt.php | RSACrypt.getRSAESOAEP | private static function getRSAESOAEP(RSAKey $key, string $c, Hash $hash): string
{
$c = self::convertOctetStringToInteger($c);
$m = self::getRSADP($key, $c);
$em = self::convertIntegerToOctetString($m, $key->getModulusLength());
$lHash = $hash->hash('');
$maskedSeed = \mb_sub... | php | private static function getRSAESOAEP(RSAKey $key, string $c, Hash $hash): string
{
$c = self::convertOctetStringToInteger($c);
$m = self::getRSADP($key, $c);
$em = self::convertIntegerToOctetString($m, $key->getModulusLength());
$lHash = $hash->hash('');
$maskedSeed = \mb_sub... | [
"private",
"static",
"function",
"getRSAESOAEP",
"(",
"RSAKey",
"$",
"key",
",",
"string",
"$",
"c",
",",
"Hash",
"$",
"hash",
")",
":",
"string",
"{",
"$",
"c",
"=",
"self",
"::",
"convertOctetStringToInteger",
"(",
"$",
"c",
")",
";",
"$",
"m",
"="... | RSAES-OAEP-DECRYPT. | [
"RSAES",
"-",
"OAEP",
"-",
"DECRYPT",
"."
] | train | https://github.com/web-token/jwt-framework/blob/b819220dbcb71dc40f3d1ffc076eec0636536fb7/src/Component/Encryption/Util/RSACrypt.php#L231-L254 |
doctrine/DoctrineBundle | Command/ImportMappingDoctrineCommand.php | ImportMappingDoctrineCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$type = $input->getArgument('mapping-type') ?: 'xml';
if ($type === 'yaml') {
$type = 'yml';
}
$namespaceOrBundle = $input->getArgument('name');
if (isset($this->bundles[$namespaceOrBund... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$type = $input->getArgument('mapping-type') ?: 'xml';
if ($type === 'yaml') {
$type = 'yml';
}
$namespaceOrBundle = $input->getArgument('name');
if (isset($this->bundles[$namespaceOrBund... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"type",
"=",
"$",
"input",
"->",
"getArgument",
"(",
"'mapping-type'",
")",
"?",
":",
"'xml'",
";",
"if",
"(",
"$",
"type",
"==... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Command/ImportMappingDoctrineCommand.php#L85-L160 |
doctrine/DoctrineBundle | DependencyInjection/DoctrineExtension.php | DoctrineExtension.load | public function load(array $configs, ContainerBuilder $container)
{
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
$this->adapter->loadServicesConfiguration($container);
if (! empty($config['db... | php | public function load(array $configs, ContainerBuilder $container)
{
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);
$this->adapter->loadServicesConfiguration($container);
if (! empty($config['db... | [
"public",
"function",
"load",
"(",
"array",
"$",
"configs",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configuration",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
"$",
"configs",
",",
"$",
"container",
")",
";",
"$",
"config",
"=",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/DoctrineExtension.php#L52-L76 |
doctrine/DoctrineBundle | DependencyInjection/DoctrineExtension.php | DoctrineExtension.dbalLoad | protected function dbalLoad(array $config, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('dbal.xml');
if (empty($config['default_connection'])) {
$keys = array_keys... | php | protected function dbalLoad(array $config, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('dbal.xml');
if (empty($config['default_connection'])) {
$keys = array_keys... | [
"protected",
"function",
"dbalLoad",
"(",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"loader",
"=",
"new",
"XmlFileLoader",
"(",
"$",
"container",
",",
"new",
"FileLocator",
"(",
"__DIR__",
".",
"'/../Resources/config'",
... | Loads the DBAL configuration.
Usage example:
<doctrine:dbal id="myconn" dbname="sfweb" user="root" />
@param array $config An array of configuration settings
@param ContainerBuilder $container A ContainerBuilder instance | [
"Loads",
"the",
"DBAL",
"configuration",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/DoctrineExtension.php#L88-L118 |
doctrine/DoctrineBundle | DependencyInjection/DoctrineExtension.php | DoctrineExtension.loadDbalConnection | protected function loadDbalConnection($name, array $connection, ContainerBuilder $container)
{
$configuration = $container->setDefinition(sprintf('doctrine.dbal.%s_connection.configuration', $name), new ChildDefinition('doctrine.dbal.connection.configuration'));
$logger = null;
if ($c... | php | protected function loadDbalConnection($name, array $connection, ContainerBuilder $container)
{
$configuration = $container->setDefinition(sprintf('doctrine.dbal.%s_connection.configuration', $name), new ChildDefinition('doctrine.dbal.connection.configuration'));
$logger = null;
if ($c... | [
"protected",
"function",
"loadDbalConnection",
"(",
"$",
"name",
",",
"array",
"$",
"connection",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"configuration",
"=",
"$",
"container",
"->",
"setDefinition",
"(",
"sprintf",
"(",
"'doctrine.dbal.%s_conne... | Loads a configured DBAL connection.
@param string $name The name of the connection
@param array $connection A dbal connection configuration.
@param ContainerBuilder $container A ContainerBuilder instance | [
"Loads",
"a",
"configured",
"DBAL",
"connection",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/DoctrineExtension.php#L127-L209 |
doctrine/DoctrineBundle | DependencyInjection/DoctrineExtension.php | DoctrineExtension.ormLoad | protected function ormLoad(array $config, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('orm.xml');
$entityManagers = [];
foreach (array_keys($config['entity_managers']) as $name) {
... | php | protected function ormLoad(array $config, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('orm.xml');
$entityManagers = [];
foreach (array_keys($config['entity_managers']) as $name) {
... | [
"protected",
"function",
"ormLoad",
"(",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"loader",
"=",
"new",
"XmlFileLoader",
"(",
"$",
"container",
",",
"new",
"FileLocator",
"(",
"__DIR__",
".",
"'/../Resources/config'",
"... | Loads the Doctrine ORM configuration.
Usage example:
<doctrine:orm id="mydm" connection="myconn" />
@param array $config An array of configuration settings
@param ContainerBuilder $container A ContainerBuilder instance | [
"Loads",
"the",
"Doctrine",
"ORM",
"configuration",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/DoctrineExtension.php#L335-L393 |
doctrine/DoctrineBundle | DependencyInjection/DoctrineExtension.php | DoctrineExtension.loadOrmEntityManager | protected function loadOrmEntityManager(array $entityManager, ContainerBuilder $container)
{
$ormConfigDef = $container->setDefinition(sprintf('doctrine.orm.%s_configuration', $entityManager['name']), new ChildDefinition('doctrine.orm.configuration'));
$this->loadOrmEntityManagerMappingInformation(... | php | protected function loadOrmEntityManager(array $entityManager, ContainerBuilder $container)
{
$ormConfigDef = $container->setDefinition(sprintf('doctrine.orm.%s_configuration', $entityManager['name']), new ChildDefinition('doctrine.orm.configuration'));
$this->loadOrmEntityManagerMappingInformation(... | [
"protected",
"function",
"loadOrmEntityManager",
"(",
"array",
"$",
"entityManager",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"ormConfigDef",
"=",
"$",
"container",
"->",
"setDefinition",
"(",
"sprintf",
"(",
"'doctrine.orm.%s_configuration'",
",",
... | Loads a configured ORM entity manager.
@param array $entityManager A configured ORM entity manager.
@param ContainerBuilder $container A ContainerBuilder instance | [
"Loads",
"a",
"configured",
"ORM",
"entity",
"manager",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/DoctrineExtension.php#L401-L530 |
doctrine/DoctrineBundle | DependencyInjection/DoctrineExtension.php | DoctrineExtension.loadOrmEntityManagerMappingInformation | protected function loadOrmEntityManagerMappingInformation(array $entityManager, Definition $ormConfigDef, ContainerBuilder $container)
{
// reset state of drivers and alias map. They are only used by this methods and children.
$this->drivers = [];
$this->aliasMap = [];
$this->loadM... | php | protected function loadOrmEntityManagerMappingInformation(array $entityManager, Definition $ormConfigDef, ContainerBuilder $container)
{
// reset state of drivers and alias map. They are only used by this methods and children.
$this->drivers = [];
$this->aliasMap = [];
$this->loadM... | [
"protected",
"function",
"loadOrmEntityManagerMappingInformation",
"(",
"array",
"$",
"entityManager",
",",
"Definition",
"$",
"ormConfigDef",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// reset state of drivers and alias map. They are only used by this methods and child... | Loads an ORM entity managers bundle mapping information.
There are two distinct configuration possibilities for mapping information:
1. Specify a bundle and optionally details where the entity and mapping information reside.
2. Specify an arbitrary mapping location.
@param array $entityManager A configure... | [
"Loads",
"an",
"ORM",
"entity",
"managers",
"bundle",
"mapping",
"information",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/DoctrineExtension.php#L565-L575 |
doctrine/DoctrineBundle | DependencyInjection/DoctrineExtension.php | DoctrineExtension.loadOrmSecondLevelCache | protected function loadOrmSecondLevelCache(array $entityManager, Definition $ormConfigDef, ContainerBuilder $container)
{
$driverId = null;
$enabled = $entityManager['second_level_cache']['enabled'];
if (isset($entityManager['second_level_cache']['region_cache_driver'])) {
$dri... | php | protected function loadOrmSecondLevelCache(array $entityManager, Definition $ormConfigDef, ContainerBuilder $container)
{
$driverId = null;
$enabled = $entityManager['second_level_cache']['enabled'];
if (isset($entityManager['second_level_cache']['region_cache_driver'])) {
$dri... | [
"protected",
"function",
"loadOrmSecondLevelCache",
"(",
"array",
"$",
"entityManager",
",",
"Definition",
"$",
"ormConfigDef",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"driverId",
"=",
"null",
";",
"$",
"enabled",
"=",
"$",
"entityManager",
"["... | Loads an ORM second level cache bundle mapping information.
@param array $entityManager A configured ORM entity manager
@param Definition $ormConfigDef A Definition instance
@param ContainerBuilder $container A ContainerBuilder instance
@example
entity_managers:
default:
second_level_cache:
regi... | [
"Loads",
"an",
"ORM",
"second",
"level",
"cache",
"bundle",
"mapping",
"information",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/DoctrineExtension.php#L605-L692 |
doctrine/DoctrineBundle | DependencyInjection/DoctrineExtension.php | DoctrineExtension.loadCacheDriver | protected function loadCacheDriver($driverName, $entityManagerName, array $driverMap, ContainerBuilder $container)
{
$serviceId = null;
$aliasId = $this->getObjectManagerElementName(sprintf('%s_%s', $entityManagerName, $driverName));
switch ($driverMap['type']) {
case 'service... | php | protected function loadCacheDriver($driverName, $entityManagerName, array $driverMap, ContainerBuilder $container)
{
$serviceId = null;
$aliasId = $this->getObjectManagerElementName(sprintf('%s_%s', $entityManagerName, $driverName));
switch ($driverMap['type']) {
case 'service... | [
"protected",
"function",
"loadCacheDriver",
"(",
"$",
"driverName",
",",
"$",
"entityManagerName",
",",
"array",
"$",
"driverMap",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"serviceId",
"=",
"null",
";",
"$",
"aliasId",
"=",
"$",
"this",
"->"... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/DoctrineExtension.php#L726-L752 |
doctrine/DoctrineBundle | DependencyInjection/DoctrineExtension.php | DoctrineExtension.loadOrmCacheDrivers | protected function loadOrmCacheDrivers(array $entityManager, ContainerBuilder $container)
{
$this->loadCacheDriver('metadata_cache', $entityManager['name'], $entityManager['metadata_cache_driver'], $container);
$this->loadCacheDriver('result_cache', $entityManager['name'], $entityManager['result_cac... | php | protected function loadOrmCacheDrivers(array $entityManager, ContainerBuilder $container)
{
$this->loadCacheDriver('metadata_cache', $entityManager['name'], $entityManager['metadata_cache_driver'], $container);
$this->loadCacheDriver('result_cache', $entityManager['name'], $entityManager['result_cac... | [
"protected",
"function",
"loadOrmCacheDrivers",
"(",
"array",
"$",
"entityManager",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"this",
"->",
"loadCacheDriver",
"(",
"'metadata_cache'",
",",
"$",
"entityManager",
"[",
"'name'",
"]",
",",
"$",
"enti... | Loads a configured entity managers cache drivers.
@param array $entityManager A configured ORM entity manager.
@param ContainerBuilder $container A ContainerBuilder instance | [
"Loads",
"a",
"configured",
"entity",
"managers",
"cache",
"drivers",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/DoctrineExtension.php#L760-L765 |
doctrine/DoctrineBundle | DependencyInjection/DoctrineExtension.php | DoctrineExtension.loadPropertyInfoExtractor | private function loadPropertyInfoExtractor($entityManagerName, ContainerBuilder $container)
{
$propertyExtractorDefinition = $container->register(sprintf('doctrine.orm.%s_entity_manager.property_info_extractor', $entityManagerName), DoctrineExtractor::class);
if (property_exists(DoctrineExtractor::c... | php | private function loadPropertyInfoExtractor($entityManagerName, ContainerBuilder $container)
{
$propertyExtractorDefinition = $container->register(sprintf('doctrine.orm.%s_entity_manager.property_info_extractor', $entityManagerName), DoctrineExtractor::class);
if (property_exists(DoctrineExtractor::c... | [
"private",
"function",
"loadPropertyInfoExtractor",
"(",
"$",
"entityManagerName",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"propertyExtractorDefinition",
"=",
"$",
"container",
"->",
"register",
"(",
"sprintf",
"(",
"'doctrine.orm.%s_entity_manager.prope... | Loads a property info extractor for each defined entity manager.
@param string $entityManagerName | [
"Loads",
"a",
"property",
"info",
"extractor",
"for",
"each",
"defined",
"entity",
"manager",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/DoctrineExtension.php#L772-L792 |
doctrine/DoctrineBundle | DependencyInjection/DoctrineExtension.php | DoctrineExtension.loadValidatorLoader | private function loadValidatorLoader(string $entityManagerName, ContainerBuilder $container) : void
{
if (! interface_exists(LoaderInterface::class) || ! class_exists(DoctrineLoader::class)) {
return;
}
$validatorLoaderDefinition = $container->register(sprintf('doctrine.orm.%s_e... | php | private function loadValidatorLoader(string $entityManagerName, ContainerBuilder $container) : void
{
if (! interface_exists(LoaderInterface::class) || ! class_exists(DoctrineLoader::class)) {
return;
}
$validatorLoaderDefinition = $container->register(sprintf('doctrine.orm.%s_e... | [
"private",
"function",
"loadValidatorLoader",
"(",
"string",
"$",
"entityManagerName",
",",
"ContainerBuilder",
"$",
"container",
")",
":",
"void",
"{",
"if",
"(",
"!",
"interface_exists",
"(",
"LoaderInterface",
"::",
"class",
")",
"||",
"!",
"class_exists",
"(... | Loads a validator loader for each defined entity manager. | [
"Loads",
"a",
"validator",
"loader",
"for",
"each",
"defined",
"entity",
"manager",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/DoctrineExtension.php#L797-L807 |
doctrine/DoctrineBundle | DoctrineBundle.php | DoctrineBundle.build | public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new RegisterEventListenersAndSubscribersPass('doctrine.connections', 'doctrine.dbal.%s_connection.event_manager', 'doctrine'), PassConfig::TYPE_BEFORE_OPTIMIZATION);
if ($container->... | php | public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new RegisterEventListenersAndSubscribersPass('doctrine.connections', 'doctrine.dbal.%s_connection.event_manager', 'doctrine'), PassConfig::TYPE_BEFORE_OPTIMIZATION);
if ($container->... | [
"public",
"function",
"build",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"parent",
"::",
"build",
"(",
"$",
"container",
")",
";",
"$",
"container",
"->",
"addCompilerPass",
"(",
"new",
"RegisterEventListenersAndSubscribersPass",
"(",
"'doctrine.connectio... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DoctrineBundle.php#L26-L39 |
doctrine/DoctrineBundle | DoctrineBundle.php | DoctrineBundle.boot | public function boot()
{
// Register an autoloader for proxies to avoid issues when unserializing them
// when the ORM is used.
if (! $this->container->hasParameter('doctrine.orm.proxy_namespace')) {
return;
}
$namespace = $this->container->getParameter('doc... | php | public function boot()
{
// Register an autoloader for proxies to avoid issues when unserializing them
// when the ORM is used.
if (! $this->container->hasParameter('doctrine.orm.proxy_namespace')) {
return;
}
$namespace = $this->container->getParameter('doc... | [
"public",
"function",
"boot",
"(",
")",
"{",
"// Register an autoloader for proxies to avoid issues when unserializing them",
"// when the ORM is used.",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"->",
"hasParameter",
"(",
"'doctrine.orm.proxy_namespace'",
")",
")",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DoctrineBundle.php#L44-L90 |
doctrine/DoctrineBundle | DoctrineBundle.php | DoctrineBundle.shutdown | public function shutdown()
{
if ($this->autoloader !== null) {
spl_autoload_unregister($this->autoloader);
$this->autoloader = null;
}
// Clear all entity managers to clear references to entities for GC
if ($this->container->hasParameter('doctrine.entity_mana... | php | public function shutdown()
{
if ($this->autoloader !== null) {
spl_autoload_unregister($this->autoloader);
$this->autoloader = null;
}
// Clear all entity managers to clear references to entities for GC
if ($this->container->hasParameter('doctrine.entity_mana... | [
"public",
"function",
"shutdown",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"autoloader",
"!==",
"null",
")",
"{",
"spl_autoload_unregister",
"(",
"$",
"this",
"->",
"autoloader",
")",
";",
"$",
"this",
"->",
"autoloader",
"=",
"null",
";",
"}",
"//... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DoctrineBundle.php#L95-L125 |
doctrine/DoctrineBundle | DependencyInjection/Compiler/DbalSchemaFilterPass.php | DbalSchemaFilterPass.process | public function process(ContainerBuilder $container)
{
$filters = $container->findTaggedServiceIds('doctrine.dbal.schema_filter');
if (count($filters) > 0 && ! method_exists(Configuration::class, 'setSchemaAssetsFilter')) {
throw new LogicException('The doctrine.dbal.schema_filter tag i... | php | public function process(ContainerBuilder $container)
{
$filters = $container->findTaggedServiceIds('doctrine.dbal.schema_filter');
if (count($filters) > 0 && ! method_exists(Configuration::class, 'setSchemaAssetsFilter')) {
throw new LogicException('The doctrine.dbal.schema_filter tag i... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"filters",
"=",
"$",
"container",
"->",
"findTaggedServiceIds",
"(",
"'doctrine.dbal.schema_filter'",
")",
";",
"if",
"(",
"count",
"(",
"$",
"filters",
")",
">",
"0",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Compiler/DbalSchemaFilterPass.php#L20-L56 |
doctrine/DoctrineBundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('doctrine');
if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder-... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('doctrine');
if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode = $treeBuilder-... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"'doctrine'",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"treeBuilder",
",",
"'getRootNode'",
")",
")",
"{",
"$",
"rootNode",
"=",
"$",
"t... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Configuration.php#L37-L52 |
doctrine/DoctrineBundle | DependencyInjection/Configuration.php | Configuration.addDbalSection | private function addDbalSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('dbal')
->beforeNormalization()
->ifTrue(static function ($v) {
return is_array($v) && ! array_key_exists('connections', $v) && ! ar... | php | private function addDbalSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('dbal')
->beforeNormalization()
->ifTrue(static function ($v) {
return is_array($v) && ! array_key_exists('connections', $v) && ! ar... | [
"private",
"function",
"addDbalSection",
"(",
"ArrayNodeDefinition",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'dbal'",
")",
"->",
"beforeNormalization",
"(",
")",
"->",
"ifTrue",
"(",
"static",
"function",
"(",... | Add DBAL section to configuration tree | [
"Add",
"DBAL",
"section",
"to",
"configuration",
"tree"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Configuration.php#L57-L107 |
doctrine/DoctrineBundle | DependencyInjection/Configuration.php | Configuration.getDbalConnectionsNode | private function getDbalConnectionsNode()
{
$treeBuilder = new TreeBuilder('connections');
if (method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$node = $treeBuilder->r... | php | private function getDbalConnectionsNode()
{
$treeBuilder = new TreeBuilder('connections');
if (method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$node = $treeBuilder->r... | [
"private",
"function",
"getDbalConnectionsNode",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"'connections'",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"treeBuilder",
",",
"'getRootNode'",
")",
")",
"{",
"$",
"node",
"=",
"$",
... | Return the dbal connections node
@return ArrayNodeDefinition | [
"Return",
"the",
"dbal",
"connections",
"node"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Configuration.php#L114-L188 |
doctrine/DoctrineBundle | DependencyInjection/Configuration.php | Configuration.configureDbalDriverNode | private function configureDbalDriverNode(ArrayNodeDefinition $node)
{
$node
->children()
->scalarNode('url')->info('A URL with connection information; any parameter value parsed from this string will override explicitly set parameters')->end()
->scalarNode('dbname... | php | private function configureDbalDriverNode(ArrayNodeDefinition $node)
{
$node
->children()
->scalarNode('url')->info('A URL with connection information; any parameter value parsed from this string will override explicitly set parameters')->end()
->scalarNode('dbname... | [
"private",
"function",
"configureDbalDriverNode",
"(",
"ArrayNodeDefinition",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"children",
"(",
")",
"->",
"scalarNode",
"(",
"'url'",
")",
"->",
"info",
"(",
"'A URL with connection information; any parameter value parsed from t... | Adds config keys related to params processed by the DBAL drivers
These keys are available for slave configurations too. | [
"Adds",
"config",
"keys",
"related",
"to",
"params",
"processed",
"by",
"the",
"DBAL",
"drivers"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Configuration.php#L195-L300 |
doctrine/DoctrineBundle | DependencyInjection/Configuration.php | Configuration.addOrmSection | private function addOrmSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('orm')
->beforeNormalization()
->ifTrue(static function ($v) {
if (! empty($v) && ! class_exists(EntityManager::class... | php | private function addOrmSection(ArrayNodeDefinition $node)
{
$node
->children()
->arrayNode('orm')
->beforeNormalization()
->ifTrue(static function ($v) {
if (! empty($v) && ! class_exists(EntityManager::class... | [
"private",
"function",
"addOrmSection",
"(",
"ArrayNodeDefinition",
"$",
"node",
")",
"{",
"$",
"node",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'orm'",
")",
"->",
"beforeNormalization",
"(",
")",
"->",
"ifTrue",
"(",
"static",
"function",
"(",
... | Add the ORM section to configuration tree | [
"Add",
"the",
"ORM",
"section",
"to",
"configuration",
"tree"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Configuration.php#L305-L383 |
doctrine/DoctrineBundle | DependencyInjection/Configuration.php | Configuration.getOrmTargetEntityResolverNode | private function getOrmTargetEntityResolverNode()
{
$treeBuilder = new TreeBuilder('resolve_target_entities');
if (method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$no... | php | private function getOrmTargetEntityResolverNode()
{
$treeBuilder = new TreeBuilder('resolve_target_entities');
if (method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$no... | [
"private",
"function",
"getOrmTargetEntityResolverNode",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"'resolve_target_entities'",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"treeBuilder",
",",
"'getRootNode'",
")",
")",
"{",
"$",
"nod... | Return ORM target entity resolver node
@return NodeDefinition | [
"Return",
"ORM",
"target",
"entity",
"resolver",
"node"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Configuration.php#L390-L408 |
doctrine/DoctrineBundle | DependencyInjection/Configuration.php | Configuration.getOrmEntityListenersNode | private function getOrmEntityListenersNode()
{
$treeBuilder = new TreeBuilder('entity_listeners');
if (method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$node = $treeBu... | php | private function getOrmEntityListenersNode()
{
$treeBuilder = new TreeBuilder('entity_listeners');
if (method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$node = $treeBu... | [
"private",
"function",
"getOrmEntityListenersNode",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"'entity_listeners'",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"treeBuilder",
",",
"'getRootNode'",
")",
")",
"{",
"$",
"node",
"=",
... | Return ORM entity listener node
@return NodeDefinition | [
"Return",
"ORM",
"entity",
"listener",
"node"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Configuration.php#L415-L500 |
doctrine/DoctrineBundle | DependencyInjection/Configuration.php | Configuration.getOrmEntityManagersNode | private function getOrmEntityManagersNode()
{
$treeBuilder = new TreeBuilder('entity_managers');
if (method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$node = $treeBuil... | php | private function getOrmEntityManagersNode()
{
$treeBuilder = new TreeBuilder('entity_managers');
if (method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$node = $treeBuil... | [
"private",
"function",
"getOrmEntityManagersNode",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"'entity_managers'",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"treeBuilder",
",",
"'getRootNode'",
")",
")",
"{",
"$",
"node",
"=",
"... | Return ORM entity manager node
@return ArrayNodeDefinition | [
"Return",
"ORM",
"entity",
"manager",
"node"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Configuration.php#L507-L668 |
doctrine/DoctrineBundle | DependencyInjection/Configuration.php | Configuration.getOrmCacheDriverNode | private function getOrmCacheDriverNode($name)
{
$treeBuilder = new TreeBuilder($name);
if (method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$node = $treeBuilder->root(... | php | private function getOrmCacheDriverNode($name)
{
$treeBuilder = new TreeBuilder($name);
if (method_exists($treeBuilder, 'getRootNode')) {
$node = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$node = $treeBuilder->root(... | [
"private",
"function",
"getOrmCacheDriverNode",
"(",
"$",
"name",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"$",
"name",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"treeBuilder",
",",
"'getRootNode'",
")",
")",
"{",
"$",
"node",
... | Return a ORM cache driver node for an given entity manager
@param string $name
@return ArrayNodeDefinition | [
"Return",
"a",
"ORM",
"cache",
"driver",
"node",
"for",
"an",
"given",
"entity",
"manager"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Configuration.php#L677-L718 |
doctrine/DoctrineBundle | DependencyInjection/Configuration.php | Configuration.getAutoGenerateModes | private function getAutoGenerateModes()
{
$constPrefix = 'AUTOGENERATE_';
$prefixLen = strlen($constPrefix);
$refClass = new ReflectionClass('Doctrine\Common\Proxy\AbstractProxyFactory');
$constsArray = $refClass->getConstants();
$namesArray = [];
$valuesArray =... | php | private function getAutoGenerateModes()
{
$constPrefix = 'AUTOGENERATE_';
$prefixLen = strlen($constPrefix);
$refClass = new ReflectionClass('Doctrine\Common\Proxy\AbstractProxyFactory');
$constsArray = $refClass->getConstants();
$namesArray = [];
$valuesArray =... | [
"private",
"function",
"getAutoGenerateModes",
"(",
")",
"{",
"$",
"constPrefix",
"=",
"'AUTOGENERATE_'",
";",
"$",
"prefixLen",
"=",
"strlen",
"(",
"$",
"constPrefix",
")",
";",
"$",
"refClass",
"=",
"new",
"ReflectionClass",
"(",
"'Doctrine\\Common\\Proxy\\Abstr... | Find proxy auto generate modes for their names and int values
@return array | [
"Find",
"proxy",
"auto",
"generate",
"modes",
"for",
"their",
"names",
"and",
"int",
"values"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Configuration.php#L725-L747 |
doctrine/DoctrineBundle | Twig/DoctrineExtension.php | DoctrineExtension.getPossibleCombinations | private function getPossibleCombinations(array $elements, $combinationsLevel)
{
$baseCount = count($elements);
$result = [];
if ($combinationsLevel === 1) {
foreach ($elements as $element) {
$result[] = [$element];
}
return $result;
... | php | private function getPossibleCombinations(array $elements, $combinationsLevel)
{
$baseCount = count($elements);
$result = [];
if ($combinationsLevel === 1) {
foreach ($elements as $element) {
$result[] = [$element];
}
return $result;
... | [
"private",
"function",
"getPossibleCombinations",
"(",
"array",
"$",
"elements",
",",
"$",
"combinationsLevel",
")",
"{",
"$",
"baseCount",
"=",
"count",
"(",
"$",
"elements",
")",
";",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"combinationsLevel"... | Get the possible combinations of elements from the given array
@param array $elements
@param int $combinationsLevel
@return array | [
"Get",
"the",
"possible",
"combinations",
"of",
"elements",
"from",
"the",
"given",
"array"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Twig/DoctrineExtension.php#L44-L81 |
doctrine/DoctrineBundle | Twig/DoctrineExtension.php | DoctrineExtension.shrinkParameters | private function shrinkParameters(array $parameters, array $combination)
{
array_shift($parameters);
$result = '';
$maxLength = $this->maxCharWidth;
$maxLength -= count($parameters) * 5;
$maxLength /= count($parameters);
foreach ($parameters as $key => $value) {
... | php | private function shrinkParameters(array $parameters, array $combination)
{
array_shift($parameters);
$result = '';
$maxLength = $this->maxCharWidth;
$maxLength -= count($parameters) * 5;
$maxLength /= count($parameters);
foreach ($parameters as $key => $value) {
... | [
"private",
"function",
"shrinkParameters",
"(",
"array",
"$",
"parameters",
",",
"array",
"$",
"combination",
")",
"{",
"array_shift",
"(",
"$",
"parameters",
")",
";",
"$",
"result",
"=",
"''",
";",
"$",
"maxLength",
"=",
"$",
"this",
"->",
"maxCharWidth"... | Shrink the values of parameters from a combination
@param array $parameters
@param array $combination
@return string | [
"Shrink",
"the",
"values",
"of",
"parameters",
"from",
"a",
"combination"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Twig/DoctrineExtension.php#L91-L124 |
doctrine/DoctrineBundle | Twig/DoctrineExtension.php | DoctrineExtension.composeMiniQuery | private function composeMiniQuery($query, array $keywords, $required)
{
// Extract the mandatory keywords and consider the rest as optional keywords
$mandatoryKeywords = array_splice($keywords, 0, $required);
$combinations = [];
$combinationsCount = count($keywords);
/... | php | private function composeMiniQuery($query, array $keywords, $required)
{
// Extract the mandatory keywords and consider the rest as optional keywords
$mandatoryKeywords = array_splice($keywords, 0, $required);
$combinations = [];
$combinationsCount = count($keywords);
/... | [
"private",
"function",
"composeMiniQuery",
"(",
"$",
"query",
",",
"array",
"$",
"keywords",
",",
"$",
"required",
")",
"{",
"// Extract the mandatory keywords and consider the rest as optional keywords",
"$",
"mandatoryKeywords",
"=",
"array_splice",
"(",
"$",
"keywords"... | Attempt to compose the best scenario minified query so that a user could find it without expanding it
@param string $query
@param array $keywords
@param int $required
@return string | [
"Attempt",
"to",
"compose",
"the",
"best",
"scenario",
"minified",
"query",
"so",
"that",
"a",
"user",
"could",
"find",
"it",
"without",
"expanding",
"it"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Twig/DoctrineExtension.php#L135-L171 |
doctrine/DoctrineBundle | Twig/DoctrineExtension.php | DoctrineExtension.replaceQueryParameters | public function replaceQueryParameters($query, $parameters)
{
if ($parameters instanceof Data) {
$parameters = $parameters->getValue(true);
}
$i = 0;
if (! array_key_exists(0, $parameters) && array_key_exists(1, $parameters)) {
$i = 1;
}
ret... | php | public function replaceQueryParameters($query, $parameters)
{
if ($parameters instanceof Data) {
$parameters = $parameters->getValue(true);
}
$i = 0;
if (! array_key_exists(0, $parameters) && array_key_exists(1, $parameters)) {
$i = 1;
}
ret... | [
"public",
"function",
"replaceQueryParameters",
"(",
"$",
"query",
",",
"$",
"parameters",
")",
"{",
"if",
"(",
"$",
"parameters",
"instanceof",
"Data",
")",
"{",
"$",
"parameters",
"=",
"$",
"parameters",
"->",
"getValue",
"(",
"true",
")",
";",
"}",
"$... | Return a query with the parameters replaced
@param string $query
@param array|Data $parameters
@return string | [
"Return",
"a",
"query",
"with",
"the",
"parameters",
"replaced"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Twig/DoctrineExtension.php#L277-L306 |
doctrine/DoctrineBundle | Twig/DoctrineExtension.php | DoctrineExtension.formatQuery | public function formatQuery($sql, $highlightOnly = false)
{
SqlFormatter::$pre_attributes = 'class="highlight highlight-sql"';
SqlFormatter::$quote_attributes = 'class="string"';
SqlFormatter::$backtick_quote_attributes = 'class="string"';
SqlFormatter::$reserved_... | php | public function formatQuery($sql, $highlightOnly = false)
{
SqlFormatter::$pre_attributes = 'class="highlight highlight-sql"';
SqlFormatter::$quote_attributes = 'class="string"';
SqlFormatter::$backtick_quote_attributes = 'class="string"';
SqlFormatter::$reserved_... | [
"public",
"function",
"formatQuery",
"(",
"$",
"sql",
",",
"$",
"highlightOnly",
"=",
"false",
")",
"{",
"SqlFormatter",
"::",
"$",
"pre_attributes",
"=",
"'class=\"highlight highlight-sql\"'",
";",
"SqlFormatter",
"::",
"$",
"quote_attributes",
"=",
"'class=\"strin... | Formats and/or highlights the given SQL statement.
@param string $sql
@param bool $highlightOnly If true the query is not formatted, just highlighted
@return string | [
"Formats",
"and",
"/",
"or",
"highlights",
"the",
"given",
"SQL",
"statement",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Twig/DoctrineExtension.php#L316-L338 |
doctrine/DoctrineBundle | DataCollector/DoctrineDataCollector.php | DoctrineDataCollector.collect | public function collect(Request $request, Response $response, Exception $exception = null)
{
parent::collect($request, $response, $exception);
$errors = [];
$entities = [];
$caches = [
'enabled' => false,
'log_enabled' => false,
'counts' => [
... | php | public function collect(Request $request, Response $response, Exception $exception = null)
{
parent::collect($request, $response, $exception);
$errors = [];
$entities = [];
$caches = [
'enabled' => false,
'log_enabled' => false,
'counts' => [
... | [
"public",
"function",
"collect",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"Exception",
"$",
"exception",
"=",
"null",
")",
"{",
"parent",
"::",
"collect",
"(",
"$",
"request",
",",
"$",
"response",
",",
"$",
"exception",
")"... | {@inheritdoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DataCollector/DoctrineDataCollector.php#L39-L147 |
doctrine/DoctrineBundle | DependencyInjection/Compiler/DoctrineOrmMappingsPass.php | DoctrineOrmMappingsPass.createXmlMappingDriver | public static function createXmlMappingDriver(array $namespaces, array $managerParameters = [], $enabledParameter = false, array $aliasMap = [])
{
$locator = new Definition('Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator', [$namespaces, '.orm.xml']);
$driver = new Definition('Doctrin... | php | public static function createXmlMappingDriver(array $namespaces, array $managerParameters = [], $enabledParameter = false, array $aliasMap = [])
{
$locator = new Definition('Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator', [$namespaces, '.orm.xml']);
$driver = new Definition('Doctrin... | [
"public",
"static",
"function",
"createXmlMappingDriver",
"(",
"array",
"$",
"namespaces",
",",
"array",
"$",
"managerParameters",
"=",
"[",
"]",
",",
"$",
"enabledParameter",
"=",
"false",
",",
"array",
"$",
"aliasMap",
"=",
"[",
"]",
")",
"{",
"$",
"loca... | @param array $namespaces Hashmap of directory path to namespace.
@param string[] $managerParameters List of parameters that could which object manager name
your bundle uses. This compiler pass will automatically
append the parameter name for the default entity manager
to this list.
@param string|false... | [
"@param",
"array",
"$namespaces",
"Hashmap",
"of",
"directory",
"path",
"to",
"namespace",
".",
"@param",
"string",
"[]",
"$managerParameters",
"List",
"of",
"parameters",
"that",
"could",
"which",
"object",
"manager",
"name",
"your",
"bundle",
"uses",
".",
"Thi... | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Compiler/DoctrineOrmMappingsPass.php#L60-L66 |
doctrine/DoctrineBundle | DependencyInjection/Compiler/DoctrineOrmMappingsPass.php | DoctrineOrmMappingsPass.createAnnotationMappingDriver | public static function createAnnotationMappingDriver(array $namespaces, array $directories, array $managerParameters = [], $enabledParameter = false, array $aliasMap = [])
{
$reader = new Reference('annotation_reader');
$driver = new Definition('Doctrine\ORM\Mapping\Driver\AnnotationDriver', [$reade... | php | public static function createAnnotationMappingDriver(array $namespaces, array $directories, array $managerParameters = [], $enabledParameter = false, array $aliasMap = [])
{
$reader = new Reference('annotation_reader');
$driver = new Definition('Doctrine\ORM\Mapping\Driver\AnnotationDriver', [$reade... | [
"public",
"static",
"function",
"createAnnotationMappingDriver",
"(",
"array",
"$",
"namespaces",
",",
"array",
"$",
"directories",
",",
"array",
"$",
"managerParameters",
"=",
"[",
"]",
",",
"$",
"enabledParameter",
"=",
"false",
",",
"array",
"$",
"aliasMap",
... | @param array $namespaces List of namespaces that are handled with annotation mapping
@param array $directories List of directories to look for annotated classes
@param string[] $managerParameters List of parameters that could which object manager name
your bundle uses. This compiler pass ... | [
"@param",
"array",
"$namespaces",
"List",
"of",
"namespaces",
"that",
"are",
"handled",
"with",
"annotation",
"mapping",
"@param",
"array",
"$directories",
"List",
"of",
"directories",
"to",
"look",
"for",
"annotated",
"classes",
"@param",
"string",
"[]",
"$manage... | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Compiler/DoctrineOrmMappingsPass.php#L124-L130 |
doctrine/DoctrineBundle | Registry.php | Registry.getAliasNamespace | public function getAliasNamespace($alias)
{
foreach (array_keys($this->getManagers()) as $name) {
try {
return $this->getManager($name)->getConfiguration()->getEntityNamespace($alias);
} catch (ORMException $e) {
}
}
throw ORMException::un... | php | public function getAliasNamespace($alias)
{
foreach (array_keys($this->getManagers()) as $name) {
try {
return $this->getManager($name)->getConfiguration()->getEntityNamespace($alias);
} catch (ORMException $e) {
}
}
throw ORMException::un... | [
"public",
"function",
"getAliasNamespace",
"(",
"$",
"alias",
")",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"getManagers",
"(",
")",
")",
"as",
"$",
"name",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"getManager",
"(",
"$",
... | Resolves a registered namespace alias to the full namespace.
This method looks for the alias in all registered entity managers.
@see Configuration::getEntityNamespace
@param string $alias The alias
@return string The full namespace | [
"Resolves",
"a",
"registered",
"namespace",
"alias",
"to",
"the",
"full",
"namespace",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Registry.php#L128-L138 |
doctrine/DoctrineBundle | Command/Proxy/DelegateCommand.php | DelegateCommand.wrapCommand | protected function wrapCommand($entityManagerName)
{
if (! $this->isVersionCompatible()) {
throw new RuntimeException(sprintf('"%s" requires doctrine-orm "%s" or newer', $this->getName(), $this->getMinimalVersion()));
}
DoctrineCommandHelper::setApplicationEntityManager($this->g... | php | protected function wrapCommand($entityManagerName)
{
if (! $this->isVersionCompatible()) {
throw new RuntimeException(sprintf('"%s" requires doctrine-orm "%s" or newer', $this->getName(), $this->getMinimalVersion()));
}
DoctrineCommandHelper::setApplicationEntityManager($this->g... | [
"protected",
"function",
"wrapCommand",
"(",
"$",
"entityManagerName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isVersionCompatible",
"(",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"sprintf",
"(",
"'\"%s\" requires doctrine-orm \"%s\" or newer'",
... | @param string $entityManagerName
@return Command | [
"@param",
"string",
"$entityManagerName"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Command/Proxy/DelegateCommand.php#L54-L64 |
doctrine/DoctrineBundle | Command/Proxy/DelegateCommand.php | DelegateCommand.configure | protected function configure()
{
if ($this->isVersionCompatible()) {
$this->command = $this->createCommand();
$this->setHelp($this->command->getHelp());
$this->setDefinition($this->command->getDefinition());
$this->setDescription($this->command->getDescriptio... | php | protected function configure()
{
if ($this->isVersionCompatible()) {
$this->command = $this->createCommand();
$this->setHelp($this->command->getHelp());
$this->setDefinition($this->command->getDefinition());
$this->setDescription($this->command->getDescriptio... | [
"protected",
"function",
"configure",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isVersionCompatible",
"(",
")",
")",
"{",
"$",
"this",
"->",
"command",
"=",
"$",
"this",
"->",
"createCommand",
"(",
")",
";",
"$",
"this",
"->",
"setHelp",
"(",
"$"... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Command/Proxy/DelegateCommand.php#L69-L80 |
doctrine/DoctrineBundle | Command/Proxy/DelegateCommand.php | DelegateCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
return $this->wrapCommand($input->getOption('em'))->execute($input, $output);
} | php | protected function execute(InputInterface $input, OutputInterface $output)
{
return $this->wrapCommand($input->getOption('em'))->execute($input, $output);
} | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"return",
"$",
"this",
"->",
"wrapCommand",
"(",
"$",
"input",
"->",
"getOption",
"(",
"'em'",
")",
")",
"->",
"execute",
"(",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Command/Proxy/DelegateCommand.php#L85-L88 |
doctrine/DoctrineBundle | Command/Proxy/DelegateCommand.php | DelegateCommand.interact | protected function interact(InputInterface $input, OutputInterface $output)
{
$this->wrapCommand($input->getOption('em'))->interact($input, $output);
} | php | protected function interact(InputInterface $input, OutputInterface $output)
{
$this->wrapCommand($input->getOption('em'))->interact($input, $output);
} | [
"protected",
"function",
"interact",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"wrapCommand",
"(",
"$",
"input",
"->",
"getOption",
"(",
"'em'",
")",
")",
"->",
"interact",
"(",
"$",
"input",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Command/Proxy/DelegateCommand.php#L93-L96 |
doctrine/DoctrineBundle | Command/Proxy/DelegateCommand.php | DelegateCommand.initialize | protected function initialize(InputInterface $input, OutputInterface $output)
{
$this->wrapCommand($input->getOption('em'))->initialize($input, $output);
} | php | protected function initialize(InputInterface $input, OutputInterface $output)
{
$this->wrapCommand($input->getOption('em'))->initialize($input, $output);
} | [
"protected",
"function",
"initialize",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"wrapCommand",
"(",
"$",
"input",
"->",
"getOption",
"(",
"'em'",
")",
")",
"->",
"initialize",
"(",
"$",
"input... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Command/Proxy/DelegateCommand.php#L101-L104 |
doctrine/DoctrineBundle | Mapping/ContainerEntityListenerResolver.php | ContainerEntityListenerResolver.clear | public function clear($className = null)
{
if ($className === null) {
$this->instances = [];
return;
}
$className = $this->normalizeClassName($className);
unset($this->instances[$className]);
} | php | public function clear($className = null)
{
if ($className === null) {
$this->instances = [];
return;
}
$className = $this->normalizeClassName($className);
unset($this->instances[$className]);
} | [
"public",
"function",
"clear",
"(",
"$",
"className",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"className",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"instances",
"=",
"[",
"]",
";",
"return",
";",
"}",
"$",
"className",
"=",
"$",
"this",
"->",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Mapping/ContainerEntityListenerResolver.php#L34-L45 |
doctrine/DoctrineBundle | Mapping/ContainerEntityListenerResolver.php | ContainerEntityListenerResolver.resolve | public function resolve($className)
{
$className = $this->normalizeClassName($className);
if (! isset($this->instances[$className])) {
if (isset($this->serviceIds[$className])) {
$this->instances[$className] = $this->resolveService($this->serviceIds[$className]);
... | php | public function resolve($className)
{
$className = $this->normalizeClassName($className);
if (! isset($this->instances[$className])) {
if (isset($this->serviceIds[$className])) {
$this->instances[$className] = $this->resolveService($this->serviceIds[$className]);
... | [
"public",
"function",
"resolve",
"(",
"$",
"className",
")",
"{",
"$",
"className",
"=",
"$",
"this",
"->",
"normalizeClassName",
"(",
"$",
"className",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"instances",
"[",
"$",
"className",
"]",... | {@inheritdoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Mapping/ContainerEntityListenerResolver.php#L72-L85 |
doctrine/DoctrineBundle | ConnectionFactory.php | ConnectionFactory.createConnection | public function createConnection(array $params, Configuration $config = null, EventManager $eventManager = null, array $mappingTypes = [])
{
if (! $this->initialized) {
$this->initializeTypes();
}
$connection = DriverManager::getConnection($params, $config, $eventManager);
... | php | public function createConnection(array $params, Configuration $config = null, EventManager $eventManager = null, array $mappingTypes = [])
{
if (! $this->initialized) {
$this->initializeTypes();
}
$connection = DriverManager::getConnection($params, $config, $eventManager);
... | [
"public",
"function",
"createConnection",
"(",
"array",
"$",
"params",
",",
"Configuration",
"$",
"config",
"=",
"null",
",",
"EventManager",
"$",
"eventManager",
"=",
"null",
",",
"array",
"$",
"mappingTypes",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"$... | Create a connection by name.
@param mixed[] $params
@param string[]|Type[] $mappingTypes
@return Connection | [
"Create",
"a",
"connection",
"by",
"name",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/ConnectionFactory.php#L41-L61 |
doctrine/DoctrineBundle | ConnectionFactory.php | ConnectionFactory.getDatabasePlatform | private function getDatabasePlatform(Connection $connection)
{
try {
return $connection->getDatabasePlatform();
} catch (DriverException $driverException) {
throw new DBALException(
'An exception occured while establishing a connection to figure out your platf... | php | private function getDatabasePlatform(Connection $connection)
{
try {
return $connection->getDatabasePlatform();
} catch (DriverException $driverException) {
throw new DBALException(
'An exception occured while establishing a connection to figure out your platf... | [
"private",
"function",
"getDatabasePlatform",
"(",
"Connection",
"$",
"connection",
")",
"{",
"try",
"{",
"return",
"$",
"connection",
"->",
"getDatabasePlatform",
"(",
")",
";",
"}",
"catch",
"(",
"DriverException",
"$",
"driverException",
")",
"{",
"throw",
... | Try to get the database platform.
This could fail if types should be registered to an predefined/unused connection
and the platform version is unknown.
For details have a look at DoctrineBundle issue #673.
@return AbstractPlatform
@throws DBALException | [
"Try",
"to",
"get",
"the",
"database",
"platform",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/ConnectionFactory.php#L74-L88 |
doctrine/DoctrineBundle | ConnectionFactory.php | ConnectionFactory.initializeTypes | private function initializeTypes()
{
foreach ($this->typesConfig as $typeName => $typeConfig) {
if (Type::hasType($typeName)) {
Type::overrideType($typeName, $typeConfig['class']);
} else {
Type::addType($typeName, $typeConfig['class']);
}
... | php | private function initializeTypes()
{
foreach ($this->typesConfig as $typeName => $typeConfig) {
if (Type::hasType($typeName)) {
Type::overrideType($typeName, $typeConfig['class']);
} else {
Type::addType($typeName, $typeConfig['class']);
}
... | [
"private",
"function",
"initializeTypes",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"typesConfig",
"as",
"$",
"typeName",
"=>",
"$",
"typeConfig",
")",
"{",
"if",
"(",
"Type",
"::",
"hasType",
"(",
"$",
"typeName",
")",
")",
"{",
"Type",
"::",
... | initialize the types | [
"initialize",
"the",
"types"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/ConnectionFactory.php#L93-L104 |
doctrine/DoctrineBundle | ManagerConfigurator.php | ManagerConfigurator.enableFilters | private function enableFilters(EntityManagerInterface $entityManager)
{
if (empty($this->enabledFilters)) {
return;
}
$filterCollection = $entityManager->getFilters();
foreach ($this->enabledFilters as $filter) {
$filterObject = $filterCollection->enable($fil... | php | private function enableFilters(EntityManagerInterface $entityManager)
{
if (empty($this->enabledFilters)) {
return;
}
$filterCollection = $entityManager->getFilters();
foreach ($this->enabledFilters as $filter) {
$filterObject = $filterCollection->enable($fil... | [
"private",
"function",
"enableFilters",
"(",
"EntityManagerInterface",
"$",
"entityManager",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"enabledFilters",
")",
")",
"{",
"return",
";",
"}",
"$",
"filterCollection",
"=",
"$",
"entityManager",
"->",
... | Enables filters for a given entity manager | [
"Enables",
"filters",
"for",
"a",
"given",
"entity",
"manager"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/ManagerConfigurator.php#L40-L55 |
doctrine/DoctrineBundle | ManagerConfigurator.php | ManagerConfigurator.setFilterParameters | private function setFilterParameters($name, SQLFilter $filter)
{
if (empty($this->filtersParameters[$name])) {
return;
}
$parameters = $this->filtersParameters[$name];
foreach ($parameters as $paramName => $paramValue) {
$filter->setParameter($paramName, $par... | php | private function setFilterParameters($name, SQLFilter $filter)
{
if (empty($this->filtersParameters[$name])) {
return;
}
$parameters = $this->filtersParameters[$name];
foreach ($parameters as $paramName => $paramValue) {
$filter->setParameter($paramName, $par... | [
"private",
"function",
"setFilterParameters",
"(",
"$",
"name",
",",
"SQLFilter",
"$",
"filter",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"filtersParameters",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"parameters",
"="... | Sets default parameters for a given filter
@param string $name Filter name
@param SQLFilter $filter Filter object | [
"Sets",
"default",
"parameters",
"for",
"a",
"given",
"filter"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/ManagerConfigurator.php#L63-L73 |
doctrine/DoctrineBundle | Repository/ContainerRepositoryFactory.php | ContainerRepositoryFactory.getRepository | public function getRepository(EntityManagerInterface $entityManager, $entityName)
{
$metadata = $entityManager->getClassMetadata($entityName);
$repositoryServiceId = $metadata->customRepositoryClassName;
$customRepositoryName = $metadata->customRepositoryClassName;
if ($c... | php | public function getRepository(EntityManagerInterface $entityManager, $entityName)
{
$metadata = $entityManager->getClassMetadata($entityName);
$repositoryServiceId = $metadata->customRepositoryClassName;
$customRepositoryName = $metadata->customRepositoryClassName;
if ($c... | [
"public",
"function",
"getRepository",
"(",
"EntityManagerInterface",
"$",
"entityManager",
",",
"$",
"entityName",
")",
"{",
"$",
"metadata",
"=",
"$",
"entityManager",
"->",
"getClassMetadata",
"(",
"$",
"entityName",
")",
";",
"$",
"repositoryServiceId",
"=",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Repository/ContainerRepositoryFactory.php#L42-L73 |
doctrine/DoctrineBundle | Mapping/DisconnectedMetadataFactory.php | DisconnectedMetadataFactory.getClassMetadata | public function getClassMetadata($class, $path = null)
{
$metadata = $this->getMetadataForClass($class);
if (! $metadata->getMetadata()) {
throw MappingException::classIsNotAValidEntityOrMappedSuperClass($class);
}
$this->findNamespaceAndPathForMetadata($metadata, $path)... | php | public function getClassMetadata($class, $path = null)
{
$metadata = $this->getMetadataForClass($class);
if (! $metadata->getMetadata()) {
throw MappingException::classIsNotAValidEntityOrMappedSuperClass($class);
}
$this->findNamespaceAndPathForMetadata($metadata, $path)... | [
"public",
"function",
"getClassMetadata",
"(",
"$",
"class",
",",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"metadata",
"=",
"$",
"this",
"->",
"getMetadataForClass",
"(",
"$",
"class",
")",
";",
"if",
"(",
"!",
"$",
"metadata",
"->",
"getMetadata",
"("... | Gets the metadata of a class.
@param string $class A class name
@param string $path The path where the class is stored (if known)
@return ClassMetadataCollection A ClassMetadataCollection instance
@throws MappingException When class is not valid entity or mapped superclass. | [
"Gets",
"the",
"metadata",
"of",
"a",
"class",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Mapping/DisconnectedMetadataFactory.php#L65-L75 |
doctrine/DoctrineBundle | Mapping/DisconnectedMetadataFactory.php | DisconnectedMetadataFactory.getBasePathForClass | private function getBasePathForClass($name, $namespace, $path)
{
$namespace = str_replace('\\', '/', $namespace);
$search = str_replace('\\', '/', $path);
$destination = str_replace('/' . $namespace, '', $search, $c);
if ($c !== 1) {
throw new RuntimeException(spr... | php | private function getBasePathForClass($name, $namespace, $path)
{
$namespace = str_replace('\\', '/', $namespace);
$search = str_replace('\\', '/', $path);
$destination = str_replace('/' . $namespace, '', $search, $c);
if ($c !== 1) {
throw new RuntimeException(spr... | [
"private",
"function",
"getBasePathForClass",
"(",
"$",
"name",
",",
"$",
"namespace",
",",
"$",
"path",
")",
"{",
"$",
"namespace",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"$",
"namespace",
")",
";",
"$",
"search",
"=",
"str_replace",
"(",
... | Get a base path for a class
@param string $name class name
@param string $namespace class namespace
@param string $path class path
@return string
@throws RuntimeException When base path not found. | [
"Get",
"a",
"base",
"path",
"for",
"a",
"class"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Mapping/DisconnectedMetadataFactory.php#L137-L148 |
doctrine/DoctrineBundle | Mapping/DisconnectedMetadataFactory.php | DisconnectedMetadataFactory.getMetadataForNamespace | private function getMetadataForNamespace($namespace)
{
$metadata = [];
foreach ($this->getAllMetadata() as $m) {
if (strpos($m->name, $namespace) !== 0) {
continue;
}
$metadata[] = $m;
}
return new ClassMetadataCollection($metadat... | php | private function getMetadataForNamespace($namespace)
{
$metadata = [];
foreach ($this->getAllMetadata() as $m) {
if (strpos($m->name, $namespace) !== 0) {
continue;
}
$metadata[] = $m;
}
return new ClassMetadataCollection($metadat... | [
"private",
"function",
"getMetadataForNamespace",
"(",
"$",
"namespace",
")",
"{",
"$",
"metadata",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAllMetadata",
"(",
")",
"as",
"$",
"m",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"m",
"->",... | @param string $namespace
@return ClassMetadataCollection | [
"@param",
"string",
"$namespace"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Mapping/DisconnectedMetadataFactory.php#L155-L167 |
doctrine/DoctrineBundle | Mapping/DisconnectedMetadataFactory.php | DisconnectedMetadataFactory.getMetadataForClass | private function getMetadataForClass($entity)
{
foreach ($this->registry->getManagers() as $em) {
$cmf = new DisconnectedClassMetadataFactory();
$cmf->setEntityManager($em);
if (! $cmf->isTransient($entity)) {
return new ClassMetadataCollection([$cmf->get... | php | private function getMetadataForClass($entity)
{
foreach ($this->registry->getManagers() as $em) {
$cmf = new DisconnectedClassMetadataFactory();
$cmf->setEntityManager($em);
if (! $cmf->isTransient($entity)) {
return new ClassMetadataCollection([$cmf->get... | [
"private",
"function",
"getMetadataForClass",
"(",
"$",
"entity",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"registry",
"->",
"getManagers",
"(",
")",
"as",
"$",
"em",
")",
"{",
"$",
"cmf",
"=",
"new",
"DisconnectedClassMetadataFactory",
"(",
")",
";",
... | @param string $entity
@return ClassMetadataCollection | [
"@param",
"string",
"$entity"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Mapping/DisconnectedMetadataFactory.php#L174-L186 |
doctrine/DoctrineBundle | Controller/ProfilerController.php | ProfilerController.explainAction | public function explainAction($token, $connectionName, $query)
{
/** @var Profiler $profiler */
$profiler = $this->container->get('profiler');
$profiler->disable();
$profile = $profiler->loadProfile($token);
$queries = $profile->getCollector('db')->getQueries();
if ... | php | public function explainAction($token, $connectionName, $query)
{
/** @var Profiler $profiler */
$profiler = $this->container->get('profiler');
$profiler->disable();
$profile = $profiler->loadProfile($token);
$queries = $profile->getCollector('db')->getQueries();
if ... | [
"public",
"function",
"explainAction",
"(",
"$",
"token",
",",
"$",
"connectionName",
",",
"$",
"query",
")",
"{",
"/** @var Profiler $profiler */",
"$",
"profiler",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'profiler'",
")",
";",
"$",
"profile... | Renders the profiler panel for the given token.
@param string $token The profiler token
@param string $connectionName
@param int $query
@return Response A Response instance | [
"Renders",
"the",
"profiler",
"panel",
"for",
"the",
"given",
"token",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Controller/ProfilerController.php#L37-L71 |
doctrine/DoctrineBundle | Command/DoctrineCommand.php | DoctrineCommand.getContainer | protected function getContainer()
{
@trigger_error(sprintf('The "%s()" method is deprecated and will be removed in DoctrineBundle 2.0.', __METHOD__), E_USER_DEPRECATED);
if ($this->container === null) {
$application = $this->getApplication();
if ($application === null) {
... | php | protected function getContainer()
{
@trigger_error(sprintf('The "%s()" method is deprecated and will be removed in DoctrineBundle 2.0.', __METHOD__), E_USER_DEPRECATED);
if ($this->container === null) {
$application = $this->getApplication();
if ($application === null) {
... | [
"protected",
"function",
"getContainer",
"(",
")",
"{",
"@",
"trigger_error",
"(",
"sprintf",
"(",
"'The \"%s()\" method is deprecated and will be removed in DoctrineBundle 2.0.'",
",",
"__METHOD__",
")",
",",
"E_USER_DEPRECATED",
")",
";",
"if",
"(",
"$",
"this",
"->",... | @deprecated
@return ContainerInterface
@throws LogicException | [
"@deprecated"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Command/DoctrineCommand.php#L59-L73 |
doctrine/DoctrineBundle | Command/DoctrineCommand.php | DoctrineCommand.getEntityManager | protected function getEntityManager($name, $shardId = null)
{
$manager = $this->getDoctrine()->getManager($name);
if ($shardId) {
if (! $manager->getConnection() instanceof PoolingShardConnection) {
throw new LogicException(sprintf("Connection of EntityManager '%s' must ... | php | protected function getEntityManager($name, $shardId = null)
{
$manager = $this->getDoctrine()->getManager($name);
if ($shardId) {
if (! $manager->getConnection() instanceof PoolingShardConnection) {
throw new LogicException(sprintf("Connection of EntityManager '%s' must ... | [
"protected",
"function",
"getEntityManager",
"(",
"$",
"name",
",",
"$",
"shardId",
"=",
"null",
")",
"{",
"$",
"manager",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"shardId",
")"... | Get a doctrine entity manager by symfony name.
@param string $name
@param int|null $shardId
@return EntityManager | [
"Get",
"a",
"doctrine",
"entity",
"manager",
"by",
"symfony",
"name",
"."
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/Command/DoctrineCommand.php#L101-L114 |
doctrine/DoctrineBundle | DependencyInjection/Compiler/EntityListenerPass.php | EntityListenerPass.process | public function process(ContainerBuilder $container)
{
$resolvers = $container->findTaggedServiceIds('doctrine.orm.entity_listener');
$lazyServiceReferencesByResolver = [];
foreach ($resolvers as $id => $tagAttributes) {
foreach ($tagAttributes as $attributes) {
... | php | public function process(ContainerBuilder $container)
{
$resolvers = $container->findTaggedServiceIds('doctrine.orm.entity_listener');
$lazyServiceReferencesByResolver = [];
foreach ($resolvers as $id => $tagAttributes) {
foreach ($tagAttributes as $attributes) {
... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"resolvers",
"=",
"$",
"container",
"->",
"findTaggedServiceIds",
"(",
"'doctrine.orm.entity_listener'",
")",
";",
"$",
"lazyServiceReferencesByResolver",
"=",
"[",
"]",
";",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/doctrine/DoctrineBundle/blob/5cb0c8835e1b7c0571e69be3d89fb8a357c780c5/DependencyInjection/Compiler/EntityListenerPass.php#L22-L88 |
Adldap2/Adldap2-Laravel | src/Middleware/WindowsAuthenticate.php | WindowsAuthenticate.handle | public function handle(Request $request, Closure $next)
{
if (! $this->auth->check()) {
// Retrieve the users account name from the request.
if ($account = $this->account($request)) {
// Retrieve the users username from their account name.
$username = ... | php | public function handle(Request $request, Closure $next)
{
if (! $this->auth->check()) {
// Retrieve the users account name from the request.
if ($account = $this->account($request)) {
// Retrieve the users username from their account name.
$username = ... | [
"public",
"function",
"handle",
"(",
"Request",
"$",
"request",
",",
"Closure",
"$",
"next",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"auth",
"->",
"check",
"(",
")",
")",
"{",
"// Retrieve the users account name from the request.",
"if",
"(",
"$",
"ac... | Handle an incoming request.
@param Request $request
@param Closure $next
@return mixed | [
"Handle",
"an",
"incoming",
"request",
"."
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Middleware/WindowsAuthenticate.php#L46-L62 |
Adldap2/Adldap2-Laravel | src/Middleware/WindowsAuthenticate.php | WindowsAuthenticate.retrieveAuthenticatedUser | protected function retrieveAuthenticatedUser($username)
{
// Find the user in LDAP.
if ($user = $this->resolveUserByUsername($username)) {
$provider = $this->auth->getProvider();
if ($provider instanceof NoDatabaseUserProvider) {
$this->fireAuthenticatedEvent... | php | protected function retrieveAuthenticatedUser($username)
{
// Find the user in LDAP.
if ($user = $this->resolveUserByUsername($username)) {
$provider = $this->auth->getProvider();
if ($provider instanceof NoDatabaseUserProvider) {
$this->fireAuthenticatedEvent... | [
"protected",
"function",
"retrieveAuthenticatedUser",
"(",
"$",
"username",
")",
"{",
"// Find the user in LDAP.",
"if",
"(",
"$",
"user",
"=",
"$",
"this",
"->",
"resolveUserByUsername",
"(",
"$",
"username",
")",
")",
"{",
"$",
"provider",
"=",
"$",
"this",
... | Returns the authenticatable user instance if found.
@param string $username
@return \Illuminate\Contracts\Auth\Authenticatable|null | [
"Returns",
"the",
"authenticatable",
"user",
"instance",
"if",
"found",
"."
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Middleware/WindowsAuthenticate.php#L71-L101 |
Adldap2/Adldap2-Laravel | src/Middleware/WindowsAuthenticate.php | WindowsAuthenticate.fireAuthenticatedEvent | protected function fireAuthenticatedEvent(User $user, $model = null)
{
Event::dispatch(new AuthenticatedWithWindows($user, $model));
} | php | protected function fireAuthenticatedEvent(User $user, $model = null)
{
Event::dispatch(new AuthenticatedWithWindows($user, $model));
} | [
"protected",
"function",
"fireAuthenticatedEvent",
"(",
"User",
"$",
"user",
",",
"$",
"model",
"=",
"null",
")",
"{",
"Event",
"::",
"dispatch",
"(",
"new",
"AuthenticatedWithWindows",
"(",
"$",
"user",
",",
"$",
"model",
")",
")",
";",
"}"
] | Fires the windows authentication event.
@param User $user
@param mixed|null $model
@return void | [
"Fires",
"the",
"windows",
"authentication",
"event",
"."
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Middleware/WindowsAuthenticate.php#L111-L114 |
Adldap2/Adldap2-Laravel | src/Middleware/WindowsAuthenticate.php | WindowsAuthenticate.username | protected function username($account)
{
// Username's may be prefixed with their domain,
// we just need their account name.
$username = explode('\\', $account);
if (count($username) === 2) {
list($domain, $username) = $username;
} else {
$username = ... | php | protected function username($account)
{
// Username's may be prefixed with their domain,
// we just need their account name.
$username = explode('\\', $account);
if (count($username) === 2) {
list($domain, $username) = $username;
} else {
$username = ... | [
"protected",
"function",
"username",
"(",
"$",
"account",
")",
"{",
"// Username's may be prefixed with their domain,",
"// we just need their account name.",
"$",
"username",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"account",
")",
";",
"if",
"(",
"count",
"(",
"$"... | Retrieves the users username from their full account name.
@param string $account
@return string | [
"Retrieves",
"the",
"users",
"username",
"from",
"their",
"full",
"account",
"name",
"."
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Middleware/WindowsAuthenticate.php#L157-L170 |
Adldap2/Adldap2-Laravel | src/Commands/UserImportScope.php | UserImportScope.user | protected function user(Builder $query)
{
// We'll try to locate the user by their object guid,
// otherwise we'll locate them by their username.
$query
->where(Resolver::getDatabaseIdColumn(), '=', $this->getGuid())
->orWhere(Resolver::getDatabaseUsernameColumn(), '=... | php | protected function user(Builder $query)
{
// We'll try to locate the user by their object guid,
// otherwise we'll locate them by their username.
$query
->where(Resolver::getDatabaseIdColumn(), '=', $this->getGuid())
->orWhere(Resolver::getDatabaseUsernameColumn(), '=... | [
"protected",
"function",
"user",
"(",
"Builder",
"$",
"query",
")",
"{",
"// We'll try to locate the user by their object guid,",
"// otherwise we'll locate them by their username.",
"$",
"query",
"->",
"where",
"(",
"Resolver",
"::",
"getDatabaseIdColumn",
"(",
")",
",",
... | Applies the user scope to the given Eloquent query builder.
@param Builder $query | [
"Applies",
"the",
"user",
"scope",
"to",
"the",
"given",
"Eloquent",
"query",
"builder",
"."
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Commands/UserImportScope.php#L56-L63 |
Adldap2/Adldap2-Laravel | src/Auth/DatabaseUserProvider.php | DatabaseUserProvider.retrieveByCredentials | public function retrieveByCredentials(array $credentials)
{
// Retrieve the LDAP user who is authenticating.
$user = Resolver::byCredentials($credentials);
if ($user instanceof User) {
// Set the currently authenticating LDAP user.
$this->user = $user;
E... | php | public function retrieveByCredentials(array $credentials)
{
// Retrieve the LDAP user who is authenticating.
$user = Resolver::byCredentials($credentials);
if ($user instanceof User) {
// Set the currently authenticating LDAP user.
$this->user = $user;
E... | [
"public",
"function",
"retrieveByCredentials",
"(",
"array",
"$",
"credentials",
")",
"{",
"// Retrieve the LDAP user who is authenticating.",
"$",
"user",
"=",
"Resolver",
"::",
"byCredentials",
"(",
"$",
"credentials",
")",
";",
"if",
"(",
"$",
"user",
"instanceof... | {@inheritdoc} | [
"{"
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Auth/DatabaseUserProvider.php#L35-L55 |
Adldap2/Adldap2-Laravel | src/Auth/DatabaseUserProvider.php | DatabaseUserProvider.validateCredentials | public function validateCredentials(Authenticatable $model, array $credentials)
{
if ($this->user instanceof User) {
// If an LDAP user was discovered, we can go
// ahead and try to authenticate them.
if (Resolver::authenticate($this->user, $credentials)) {
... | php | public function validateCredentials(Authenticatable $model, array $credentials)
{
if ($this->user instanceof User) {
// If an LDAP user was discovered, we can go
// ahead and try to authenticate them.
if (Resolver::authenticate($this->user, $credentials)) {
... | [
"public",
"function",
"validateCredentials",
"(",
"Authenticatable",
"$",
"model",
",",
"array",
"$",
"credentials",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"user",
"instanceof",
"User",
")",
"{",
"// If an LDAP user was discovered, we can go",
"// ahead and try to au... | {@inheritdoc} | [
"{"
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Auth/DatabaseUserProvider.php#L60-L104 |
Adldap2/Adldap2-Laravel | src/Resolvers/UserResolver.php | UserResolver.byCredentials | public function byCredentials(array $credentials = [])
{
if (empty($credentials)) {
return;
}
// Depending on the configured user provider, the
// username field will differ for retrieving
// users by their credentials.
$attribute = $this->getAppAuthProvi... | php | public function byCredentials(array $credentials = [])
{
if (empty($credentials)) {
return;
}
// Depending on the configured user provider, the
// username field will differ for retrieving
// users by their credentials.
$attribute = $this->getAppAuthProvi... | [
"public",
"function",
"byCredentials",
"(",
"array",
"$",
"credentials",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"credentials",
")",
")",
"{",
"return",
";",
"}",
"// Depending on the configured user provider, the",
"// username field will differ for ... | {@inheritdoc} | [
"{"
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Resolvers/UserResolver.php#L65-L88 |
Adldap2/Adldap2-Laravel | src/Resolvers/UserResolver.php | UserResolver.authenticate | public function authenticate(User $user, array $credentials = [])
{
$attribute = $this->getLdapAuthAttribute();
// If the developer has inserted 'dn' as their LDAP
// authentication attribute, we'll convert it to
// the full attribute name for convenience.
if ($attribute == ... | php | public function authenticate(User $user, array $credentials = [])
{
$attribute = $this->getLdapAuthAttribute();
// If the developer has inserted 'dn' as their LDAP
// authentication attribute, we'll convert it to
// the full attribute name for convenience.
if ($attribute == ... | [
"public",
"function",
"authenticate",
"(",
"User",
"$",
"user",
",",
"array",
"$",
"credentials",
"=",
"[",
"]",
")",
"{",
"$",
"attribute",
"=",
"$",
"this",
"->",
"getLdapAuthAttribute",
"(",
")",
";",
"// If the developer has inserted 'dn' as their LDAP",
"//... | {@inheritdoc} | [
"{"
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Resolvers/UserResolver.php#L101-L127 |
Adldap2/Adldap2-Laravel | src/Resolvers/UserResolver.php | UserResolver.query | public function query() : Builder
{
$query = $this->getLdapAuthProvider()->search()->users();
// We will ensure our object GUID attribute is always selected
// along will all attributes. Otherwise, if the object GUID
// attribute is virtual, it may not be returned.
$selects ... | php | public function query() : Builder
{
$query = $this->getLdapAuthProvider()->search()->users();
// We will ensure our object GUID attribute is always selected
// along will all attributes. Otherwise, if the object GUID
// attribute is virtual, it may not be returned.
$selects ... | [
"public",
"function",
"query",
"(",
")",
":",
"Builder",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getLdapAuthProvider",
"(",
")",
"->",
"search",
"(",
")",
"->",
"users",
"(",
")",
";",
"// We will ensure our object GUID attribute is always selected",
"// alo... | {@inheritdoc} | [
"{"
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Resolvers/UserResolver.php#L132-L160 |
Adldap2/Adldap2-Laravel | src/Commands/Import.php | Import.handle | public function handle()
{
// Here we'll try to locate our local user model from
// the LDAP users model. If one isn't located,
// we'll create a new one for them.
$model = $this->findUser() ?: $this->model->newInstance();
if (! $model->exists) {
Event::dispatch(... | php | public function handle()
{
// Here we'll try to locate our local user model from
// the LDAP users model. If one isn't located,
// we'll create a new one for them.
$model = $this->findUser() ?: $this->model->newInstance();
if (! $model->exists) {
Event::dispatch(... | [
"public",
"function",
"handle",
"(",
")",
"{",
"// Here we'll try to locate our local user model from",
"// the LDAP users model. If one isn't located,",
"// we'll create a new one for them.",
"$",
"model",
"=",
"$",
"this",
"->",
"findUser",
"(",
")",
"?",
":",
"$",
"this"... | Imports the current LDAP user.
@return Model | [
"Imports",
"the",
"current",
"LDAP",
"user",
"."
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Commands/Import.php#L65-L83 |
Adldap2/Adldap2-Laravel | src/Commands/Import.php | Import.findUser | protected function findUser()
{
$query = $this->model->newQuery();
if ($query->getMacro('withTrashed')) {
// If the withTrashed macro exists on our User model, then we must be
// using soft deletes. We need to make sure we include these
// results so we don't cre... | php | protected function findUser()
{
$query = $this->model->newQuery();
if ($query->getMacro('withTrashed')) {
// If the withTrashed macro exists on our User model, then we must be
// using soft deletes. We need to make sure we include these
// results so we don't cre... | [
"protected",
"function",
"findUser",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"model",
"->",
"newQuery",
"(",
")",
";",
"if",
"(",
"$",
"query",
"->",
"getMacro",
"(",
"'withTrashed'",
")",
")",
"{",
"// If the withTrashed macro exists on our Use... | Retrieves an eloquent user by their GUID or their username.
@return Model|null
@throws UnexpectedValueException | [
"Retrieves",
"an",
"eloquent",
"user",
"by",
"their",
"GUID",
"or",
"their",
"username",
"."
] | train | https://github.com/Adldap2/Adldap2-Laravel/blob/a14d5040bfec62a2e57718d3565341333e4068f2/src/Commands/Import.php#L92-L112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.