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
arangodb/arangodb-php
lib/ArangoDBClient/HttpHelper.php
HttpHelper.buildRequest
public static function buildRequest(ConnectionOptions $options, $connectionHeader, $method, $url, $body, array $customHeaders = []) { if (!is_string($body)) { throw new ClientException('Invalid value for body. Expecting string, got ' . gettype($body)); } $length = strlen($body); if ($options[ConnectionOptions::OPTION_BATCH] === true) { $contentType = 'Content-Type: multipart/form-data; boundary=' . self::MIME_BOUNDARY . self::EOL; } else { $contentType = ''; if ($length > 0 && $options[ConnectionOptions::OPTION_BATCHPART] === false) { // if body is set, we should set a content-type header $contentType = 'Content-Type: application/json' . self::EOL; } } $customHeader = ''; foreach ($customHeaders as $headerKey => $headerValue) { $customHeader .= $headerKey . ': ' . $headerValue . self::EOL; } // finally assemble the request $request = sprintf('%s %s %s', $method, $url, self::PROTOCOL) . $connectionHeader . // note: this one starts with an EOL $customHeader . $contentType . sprintf('Content-Length: %s', $length) . self::EOL . self::EOL . $body; return $request; }
php
public static function buildRequest(ConnectionOptions $options, $connectionHeader, $method, $url, $body, array $customHeaders = []) { if (!is_string($body)) { throw new ClientException('Invalid value for body. Expecting string, got ' . gettype($body)); } $length = strlen($body); if ($options[ConnectionOptions::OPTION_BATCH] === true) { $contentType = 'Content-Type: multipart/form-data; boundary=' . self::MIME_BOUNDARY . self::EOL; } else { $contentType = ''; if ($length > 0 && $options[ConnectionOptions::OPTION_BATCHPART] === false) { // if body is set, we should set a content-type header $contentType = 'Content-Type: application/json' . self::EOL; } } $customHeader = ''; foreach ($customHeaders as $headerKey => $headerValue) { $customHeader .= $headerKey . ': ' . $headerValue . self::EOL; } // finally assemble the request $request = sprintf('%s %s %s', $method, $url, self::PROTOCOL) . $connectionHeader . // note: this one starts with an EOL $customHeader . $contentType . sprintf('Content-Length: %s', $length) . self::EOL . self::EOL . $body; return $request; }
[ "public", "static", "function", "buildRequest", "(", "ConnectionOptions", "$", "options", ",", "$", "connectionHeader", ",", "$", "method", ",", "$", "url", ",", "$", "body", ",", "array", "$", "customHeaders", "=", "[", "]", ")", "{", "if", "(", "!", ...
Create a request string (header and body) @param ConnectionOptions $options - connection options @param string $connectionHeader - pre-assembled header string for connection @param string $method - HTTP method @param string $url - HTTP URL @param string $body - optional body to post @param array $customHeaders - any array containing header elements @return string - assembled HTTP request string @throws ClientException
[ "Create", "a", "request", "string", "(", "header", "and", "body", ")" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/HttpHelper.php#L144-L177
arangodb/arangodb-php
lib/ArangoDBClient/HttpHelper.php
HttpHelper.validateMethod
public static function validateMethod($method) { if ($method === self::METHOD_POST || $method === self::METHOD_PUT || $method === self::METHOD_DELETE || $method === self::METHOD_GET || $method === self::METHOD_HEAD || $method === self::METHOD_PATCH ) { return true; } throw new ClientException('Invalid request method \'' . $method . '\''); }
php
public static function validateMethod($method) { if ($method === self::METHOD_POST || $method === self::METHOD_PUT || $method === self::METHOD_DELETE || $method === self::METHOD_GET || $method === self::METHOD_HEAD || $method === self::METHOD_PATCH ) { return true; } throw new ClientException('Invalid request method \'' . $method . '\''); }
[ "public", "static", "function", "validateMethod", "(", "$", "method", ")", "{", "if", "(", "$", "method", "===", "self", "::", "METHOD_POST", "||", "$", "method", "===", "self", "::", "METHOD_PUT", "||", "$", "method", "===", "self", "::", "METHOD_DELETE",...
Validate an HTTP request method name @throws ClientException @param string $method - method name @return bool - always true, will throw if an invalid method name is supplied
[ "Validate", "an", "HTTP", "request", "method", "name" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/HttpHelper.php#L188-L201
arangodb/arangodb-php
lib/ArangoDBClient/HttpHelper.php
HttpHelper.transfer
public static function transfer($socket, $request, $method) { if (!is_resource($socket)) { throw new ClientException('Invalid socket used'); } assert(is_string($request)); @fwrite($socket, $request); @fflush($socket); $contentLength = null; $expectedLength = null; $totalRead = 0; $contentLengthPos = 0; $result = ''; $first = true; while ($first || !feof($socket)) { $read = @fread($socket, self::CHUNK_SIZE); if ($read === false || $read === '') { break; } $totalRead += strlen($read); if ($first) { $result = $read; $first = false; } else { $result .= $read; } if ($contentLength === null) { // check if content-length header is present // 12 = minimum offset (i.e. strlen("HTTP/1.1 xxx") - // after that we could see "content-length:" $pos = stripos($result, 'content-length: ', 12); if ($pos !== false) { $contentLength = (int) substr($result, $pos + 16, 10); // 16 = strlen("content-length: ") $contentLengthPos = $pos + 17; // 17 = 16 + 1 one digit if ($method === 'HEAD') { // for HTTP HEAD requests, the server will respond // with the proper Content-Length value, but will // NOT return the body. $contentLength = 0; } } } if ($contentLength !== null && $expectedLength === null) { $bodyStart = strpos($result, "\r\n\r\n", $contentLengthPos); if ($bodyStart !== false) { $bodyStart += 4; // 4 = strlen("\r\n\r\n") $expectedLength = $bodyStart + $contentLength; } } if ($expectedLength !== null && $totalRead >= $expectedLength) { break; } } return $result; }
php
public static function transfer($socket, $request, $method) { if (!is_resource($socket)) { throw new ClientException('Invalid socket used'); } assert(is_string($request)); @fwrite($socket, $request); @fflush($socket); $contentLength = null; $expectedLength = null; $totalRead = 0; $contentLengthPos = 0; $result = ''; $first = true; while ($first || !feof($socket)) { $read = @fread($socket, self::CHUNK_SIZE); if ($read === false || $read === '') { break; } $totalRead += strlen($read); if ($first) { $result = $read; $first = false; } else { $result .= $read; } if ($contentLength === null) { // check if content-length header is present // 12 = minimum offset (i.e. strlen("HTTP/1.1 xxx") - // after that we could see "content-length:" $pos = stripos($result, 'content-length: ', 12); if ($pos !== false) { $contentLength = (int) substr($result, $pos + 16, 10); // 16 = strlen("content-length: ") $contentLengthPos = $pos + 17; // 17 = 16 + 1 one digit if ($method === 'HEAD') { // for HTTP HEAD requests, the server will respond // with the proper Content-Length value, but will // NOT return the body. $contentLength = 0; } } } if ($contentLength !== null && $expectedLength === null) { $bodyStart = strpos($result, "\r\n\r\n", $contentLengthPos); if ($bodyStart !== false) { $bodyStart += 4; // 4 = strlen("\r\n\r\n") $expectedLength = $bodyStart + $contentLength; } } if ($expectedLength !== null && $totalRead >= $expectedLength) { break; } } return $result; }
[ "public", "static", "function", "transfer", "(", "$", "socket", ",", "$", "request", ",", "$", "method", ")", "{", "if", "(", "!", "is_resource", "(", "$", "socket", ")", ")", "{", "throw", "new", "ClientException", "(", "'Invalid socket used'", ")", ";"...
Execute an HTTP request on an opened socket It is the caller's responsibility to close the socket @param resource $socket - connection socket (must be open) @param string $request - complete HTTP request as a string @param string $method - HTTP method used (e.g. "HEAD") @throws ClientException @return string - HTTP response string as provided by the server
[ "Execute", "an", "HTTP", "request", "on", "an", "opened", "socket" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/HttpHelper.php#L215-L283
arangodb/arangodb-php
lib/ArangoDBClient/HttpHelper.php
HttpHelper.parseHttpMessage
public static function parseHttpMessage($httpMessage, $originUrl = null, $originMethod = null) { return explode(self::SEPARATOR, $httpMessage, 2); }
php
public static function parseHttpMessage($httpMessage, $originUrl = null, $originMethod = null) { return explode(self::SEPARATOR, $httpMessage, 2); }
[ "public", "static", "function", "parseHttpMessage", "(", "$", "httpMessage", ",", "$", "originUrl", "=", "null", ",", "$", "originMethod", "=", "null", ")", "{", "return", "explode", "(", "self", "::", "SEPARATOR", ",", "$", "httpMessage", ",", "2", ")", ...
Splits an http message into its header and body. @param string $httpMessage The http message string. @param string $originUrl The original URL the response is coming from @param string $originMethod The HTTP method that was used when sending data to the origin URL @throws ClientException @return array
[ "Splits", "an", "http", "message", "into", "its", "header", "and", "body", "." ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/HttpHelper.php#L295-L298
arangodb/arangodb-php
lib/ArangoDBClient/HttpHelper.php
HttpHelper.parseHeaders
public static function parseHeaders($headers) { $httpCode = null; $result = null; $processed = []; foreach (explode(HttpHelper::EOL, $headers) as $lineNumber => $line) { if ($lineNumber === 0) { // first line of result is special if (preg_match("/^HTTP\/\d+\.\d+\s+(\d+)/", $line, $matches)) { $httpCode = (int) $matches[1]; } $result = $line; } else { // other lines contain key:value-like headers // the following is a performance optimization to get rid of // the two trims (which are expensive as they are executed over and over) if (strpos($line, ': ') !== false) { list($key, $value) = explode(': ', $line, 2); } else { list($key, $value) = explode(':', $line, 2); } $processed[strtolower($key)] = $value; } } return [$httpCode, $result, $processed]; }
php
public static function parseHeaders($headers) { $httpCode = null; $result = null; $processed = []; foreach (explode(HttpHelper::EOL, $headers) as $lineNumber => $line) { if ($lineNumber === 0) { // first line of result is special if (preg_match("/^HTTP\/\d+\.\d+\s+(\d+)/", $line, $matches)) { $httpCode = (int) $matches[1]; } $result = $line; } else { // other lines contain key:value-like headers // the following is a performance optimization to get rid of // the two trims (which are expensive as they are executed over and over) if (strpos($line, ': ') !== false) { list($key, $value) = explode(': ', $line, 2); } else { list($key, $value) = explode(':', $line, 2); } $processed[strtolower($key)] = $value; } } return [$httpCode, $result, $processed]; }
[ "public", "static", "function", "parseHeaders", "(", "$", "headers", ")", "{", "$", "httpCode", "=", "null", ";", "$", "result", "=", "null", ";", "$", "processed", "=", "[", "]", ";", "foreach", "(", "explode", "(", "HttpHelper", "::", "EOL", ",", "...
Process a string of HTTP headers into an array of header => values. @param string $headers - the headers string @return array
[ "Process", "a", "string", "of", "HTTP", "headers", "into", "an", "array", "of", "header", "=", ">", "values", "." ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/HttpHelper.php#L307-L334
arangodb/arangodb-php
lib/ArangoDBClient/BindVars.php
BindVars.set
public function set($name, $value = null) { if (is_array($name)) { foreach ($name as $value) { ValueValidator::validate($value); } $this->_values = $name; } else { if (is_int($name) || is_string($name)) { $this->_values[(string) $name] = $value; ValueValidator::validate($value); } else { throw new ClientException('Bind variable name should be string or int'); } } }
php
public function set($name, $value = null) { if (is_array($name)) { foreach ($name as $value) { ValueValidator::validate($value); } $this->_values = $name; } else { if (is_int($name) || is_string($name)) { $this->_values[(string) $name] = $value; ValueValidator::validate($value); } else { throw new ClientException('Bind variable name should be string or int'); } } }
[ "public", "function", "set", "(", "$", "name", ",", "$", "value", "=", "null", ")", "{", "if", "(", "is_array", "(", "$", "name", ")", ")", "{", "foreach", "(", "$", "name", "as", "$", "value", ")", "{", "ValueValidator", "::", "validate", "(", "...
Set the value of a single bind variable or set all bind variables at once This will also validate the bind values. Allowed value types for bind parameters are string, int, double, bool and array. Arrays must not contain any other than these types. @throws ClientException @param string|int|array $name - name of bind variable OR an array with all bind variables @param string $value - value for bind variable @return void
[ "Set", "the", "value", "of", "a", "single", "bind", "variable", "or", "set", "all", "bind", "variables", "at", "once" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/BindVars.php#L67-L82
arangodb/arangodb-php
lib/ArangoDBClient/BindVars.php
BindVars.get
public function get($name) { if (!array_key_exists($name, $this->_values)) { return null; } return $this->_values[$name]; }
php
public function get($name) { if (!array_key_exists($name, $this->_values)) { return null; } return $this->_values[$name]; }
[ "public", "function", "get", "(", "$", "name", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "_values", ")", ")", "{", "return", "null", ";", "}", "return", "$", "this", "->", "_values", "[", "$", "name", ...
Get the value of a bind variable with a specific name @param string $name - name of bind variable @return mixed - value of bind variable
[ "Get", "the", "value", "of", "a", "bind", "variable", "with", "a", "specific", "name" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/BindVars.php#L91-L98
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.has
public function has($collection, $documentId) { try { // will throw ServerException if entry could not be retrieved $this->get($collection, $documentId); return true; } catch (ServerException $e) { // we are expecting a 404 to return boolean false if ($e->getCode() === 404) { return false; } // just rethrow throw $e; } }
php
public function has($collection, $documentId) { try { // will throw ServerException if entry could not be retrieved $this->get($collection, $documentId); return true; } catch (ServerException $e) { // we are expecting a 404 to return boolean false if ($e->getCode() === 404) { return false; } // just rethrow throw $e; } }
[ "public", "function", "has", "(", "$", "collection", ",", "$", "documentId", ")", "{", "try", "{", "// will throw ServerException if entry could not be retrieved", "$", "this", "->", "get", "(", "$", "collection", ",", "$", "documentId", ")", ";", "return", "tru...
Check if a document exists This will call self::get() internally and checks if there was an exception thrown which represents an 404 request. @throws Exception When any other error than a 404 occurs @param string $collection - collection id as a string or number @param mixed $documentId - document identifier @return boolean
[ "Check", "if", "a", "document", "exists" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L98-L115
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.getById
public function getById($collection, $documentId, array $options = []) { if (strpos($documentId, '/') !== false) { @list($collection ,$documentId) = explode('/', $documentId); } $data = $this->getDocument(Urls::URL_DOCUMENT, $collection, $documentId, $options); $options['_isNew'] = false; return $this->createFromArrayWithContext($data, $options); }
php
public function getById($collection, $documentId, array $options = []) { if (strpos($documentId, '/') !== false) { @list($collection ,$documentId) = explode('/', $documentId); } $data = $this->getDocument(Urls::URL_DOCUMENT, $collection, $documentId, $options); $options['_isNew'] = false; return $this->createFromArrayWithContext($data, $options); }
[ "public", "function", "getById", "(", "$", "collection", ",", "$", "documentId", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "strpos", "(", "$", "documentId", ",", "'/'", ")", "!==", "false", ")", "{", "@", "list", "(", "$", ...
Get a single document from a collection This will throw if the document cannot be fetched from the server. @throws Exception @param string $collection - collection id as a string or number @param mixed $documentId - document identifier @param array $options - optional, array of options <p>Options are : <li>'_includeInternals' - true to include the internal attributes. Defaults to false</li> <li>'_ignoreHiddenAttributes' - true to show hidden attributes. Defaults to false</li> <li>'ifMatch' - boolean if given revision should match or not</li> <li>'revision' - The document is returned if it matches/not matches revision.</li> </p> @return Document - the document fetched from the server
[ "Get", "a", "single", "document", "from", "a", "collection" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L137-L146
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.getDocument
protected function getDocument($url, $collection, $documentId, array $options = []) { $collection = $this->makeCollection($collection); $url = UrlHelper::buildUrl($url, [$collection, $documentId]); $headerElements = []; if (array_key_exists('ifMatch', $options) && array_key_exists('revision', $options)) { if ($options['ifMatch'] === true) { $headerElements['If-Match'] = '"' . $options['revision'] . '"'; } else { $headerElements['If-None-Match'] = '"' . $options['revision'] . '"'; } } $response = $this->getConnection()->get($url, $headerElements); if ($response->getHttpCode() === 304) { throw new ClientException('Document has not changed.'); } return $response->getJson(); }
php
protected function getDocument($url, $collection, $documentId, array $options = []) { $collection = $this->makeCollection($collection); $url = UrlHelper::buildUrl($url, [$collection, $documentId]); $headerElements = []; if (array_key_exists('ifMatch', $options) && array_key_exists('revision', $options)) { if ($options['ifMatch'] === true) { $headerElements['If-Match'] = '"' . $options['revision'] . '"'; } else { $headerElements['If-None-Match'] = '"' . $options['revision'] . '"'; } } $response = $this->getConnection()->get($url, $headerElements); if ($response->getHttpCode() === 304) { throw new ClientException('Document has not changed.'); } return $response->getJson(); }
[ "protected", "function", "getDocument", "(", "$", "url", ",", "$", "collection", ",", "$", "documentId", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "collection", "=", "$", "this", "->", "makeCollection", "(", "$", "collection", ")", ";...
Get a single document (internal method) This method is the workhorse for getById() in this handler and the edges handler @throws Exception @param string $url - the server-side URL being called @param string $collection - collection id as a string or number @param mixed $documentId - document identifier @param array $options - optional, array of options <p>Options are : <li>'_includeInternals' - true to include the internal attributes. Defaults to false</li> <li>'_ignoreHiddenAttributes' - true to show hidden attributes. Defaults to false</li> <li>'ifMatch' - boolean if given revision should match or not</li> <li>'revision' - The document is returned if it matches/not matches revision.</li> </p> @internal @return array - the document fetched from the server
[ "Get", "a", "single", "document", "(", "internal", "method", ")" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L171-L192
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.getHead
public function getHead($collection, $documentId, $revision = null, $ifMatch = null) { return $this->head(Urls::URL_DOCUMENT, $collection, $documentId, $revision, $ifMatch); }
php
public function getHead($collection, $documentId, $revision = null, $ifMatch = null) { return $this->head(Urls::URL_DOCUMENT, $collection, $documentId, $revision, $ifMatch); }
[ "public", "function", "getHead", "(", "$", "collection", ",", "$", "documentId", ",", "$", "revision", "=", "null", ",", "$", "ifMatch", "=", "null", ")", "{", "return", "$", "this", "->", "head", "(", "Urls", "::", "URL_DOCUMENT", ",", "$", "collectio...
Gets information about a single documents from a collection This will throw if the document cannot be fetched from the server @throws Exception @param string $collection - collection id as a string or number. @param mixed $documentId - document identifier. @param boolean $ifMatch - boolean if given revision should match or not. @param string $revision - The document is returned if it matches/not matches revision. @return array - an array containing the complete header including the key httpCode.
[ "Gets", "information", "about", "a", "single", "documents", "from", "a", "collection" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L210-L213
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.head
protected function head($url, $collection, $documentId, $revision = null, $ifMatch = null) { $collection = $this->makeCollection($collection); $url = UrlHelper::buildUrl($url, [$collection, $documentId]); $headerElements = []; if ($revision !== null && $ifMatch !== null) { if ($ifMatch) { $headerElements['If-Match'] = '"' . $revision . '"'; } else { $headerElements['If-None-Match'] = '"' . $revision . '"'; } } $response = $this->getConnection()->head($url, $headerElements); $headers = $response->getHeaders(); $headers['httpCode'] = $response->getHttpCode(); return $headers; }
php
protected function head($url, $collection, $documentId, $revision = null, $ifMatch = null) { $collection = $this->makeCollection($collection); $url = UrlHelper::buildUrl($url, [$collection, $documentId]); $headerElements = []; if ($revision !== null && $ifMatch !== null) { if ($ifMatch) { $headerElements['If-Match'] = '"' . $revision . '"'; } else { $headerElements['If-None-Match'] = '"' . $revision . '"'; } } $response = $this->getConnection()->head($url, $headerElements); $headers = $response->getHeaders(); $headers['httpCode'] = $response->getHttpCode(); return $headers; }
[ "protected", "function", "head", "(", "$", "url", ",", "$", "collection", ",", "$", "documentId", ",", "$", "revision", "=", "null", ",", "$", "ifMatch", "=", "null", ")", "{", "$", "collection", "=", "$", "this", "->", "makeCollection", "(", "$", "c...
Get meta-data for a single document (internal method) This method is the workhorse for getHead() in this handler and the edges handler @throws Exception @param string $url - the server-side URL being called @param string $collection - collection id as a string or number @param mixed $documentId - document identifier @param mixed $revision - optional document revision @param boolean $ifMatch - boolean if given revision should match or not. @internal @return array - the document meta-data
[ "Get", "meta", "-", "data", "for", "a", "single", "document", "(", "internal", "method", ")" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L233-L252
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.createFromArrayWithContext
protected function createFromArrayWithContext($data, $options) { $_documentClass = $this->_documentClass; return $_documentClass::createFromArray($data, $options); }
php
protected function createFromArrayWithContext($data, $options) { $_documentClass = $this->_documentClass; return $_documentClass::createFromArray($data, $options); }
[ "protected", "function", "createFromArrayWithContext", "(", "$", "data", ",", "$", "options", ")", "{", "$", "_documentClass", "=", "$", "this", "->", "_documentClass", ";", "return", "$", "_documentClass", "::", "createFromArray", "(", "$", "data", ",", "$", ...
Intermediate function to call the createFromArray function from the right context @param $data @param $options @return Document @throws \ArangoDBClient\ClientException
[ "Intermediate", "function", "to", "call", "the", "createFromArray", "function", "from", "the", "right", "context" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L264-L269
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.store
public function store(Document $document, $collection = null, array $options = []) { if ($document->getIsNew()) { if ($collection === null) { throw new ClientException('A collection id is required to store a new document.'); } $result = $this->save($collection, $document, $options); $document->setIsNew(false); return $result; } if ($collection) { throw new ClientException('An existing document cannot be stored into a new collection'); } return $this->replace($document, $options); }
php
public function store(Document $document, $collection = null, array $options = []) { if ($document->getIsNew()) { if ($collection === null) { throw new ClientException('A collection id is required to store a new document.'); } $result = $this->save($collection, $document, $options); $document->setIsNew(false); return $result; } if ($collection) { throw new ClientException('An existing document cannot be stored into a new collection'); } return $this->replace($document, $options); }
[ "public", "function", "store", "(", "Document", "$", "document", ",", "$", "collection", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", "{", "if", "(", "$", "document", "->", "getIsNew", "(", ")", ")", "{", "if", "(", "$", "collecti...
Store a document to a collection This is an alias/shortcut to save() and replace(). Instead of having to determine which of the 3 functions to use, simply pass the document to store() and it will figure out which one to call. This will throw if the document cannot be saved or replaced. @throws Exception @param Document $document - the document to be added, can be passed as a document or an array @param mixed $collection - collection id as string or number @param array $options - optional, array of options <p>Options are :<br> <li>'createCollection' - create the collection if it does not yet exist.</li> <li>'waitForSync' - if set to true, then all removal operations will instantly be synchronised to disk / If this is not specified, then the collection's default sync behavior will be applied.</li> </p> @return mixed - id of document created @since 1.0
[ "Store", "a", "document", "to", "a", "collection" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L293-L312
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.save
public function save($collection, $document, array $options = []) { $collection = $this->makeCollection($collection); $_documentClass = $this->_documentClass; $params = $this->includeOptionsInParams( $options, [ 'waitForSync' => null, 'silent' => false, 'createCollection' => $this->getConnection()->getOption(ConnectionOptions::OPTION_CREATE), 'overwrite' => (bool) @$options[self::OPTION_OVERWRITE], 'returnOld' => (bool) @$options[self::OPTION_RETURN_OLD], 'returnNew' => (bool) @$options[self::OPTION_RETURN_NEW], ] ); $this->createCollectionIfOptions($collection, $params); $url = UrlHelper::appendParamsUrl(Urls::URL_DOCUMENT . '/' . $collection, $params); if (is_array($document)) { $data = $document; } else { $data = $document->getAllForInsertUpdate(); } $response = $this->getConnection()->post($url, $this->json_encode_wrapper($data)); $json = $response->getJson(); // This makes sure that if we're in batch mode, it will not go further and choke on the checks below. // Caution: Instead of a document ID, we are returning the batchpart object // The Id of the BatchPart can be retrieved by calling getId() on it. // We're basically returning an object here, in order not to accidentally use the batch part id as the document id if ($batchPart = $response->getBatchPart()) { return $batchPart; } if (@$options[self::OPTION_RETURN_OLD] || @$options[self::OPTION_RETURN_NEW]) { return $json; } if (is_array($document)) { return $json[$_documentClass::ENTRY_KEY]; } $location = $response->getLocationHeader(); if (!$location) { throw new ClientException('Did not find location header in server response'); } $id = UrlHelper::getDocumentIdFromLocation($location); $document->setInternalId($json[$_documentClass::ENTRY_ID]); $document->setRevision($json[$_documentClass::ENTRY_REV]); if ($id !== $document->getId()) { throw new ClientException('Got an invalid response from the server'); } $document->setIsNew(false); return $document->getId(); }
php
public function save($collection, $document, array $options = []) { $collection = $this->makeCollection($collection); $_documentClass = $this->_documentClass; $params = $this->includeOptionsInParams( $options, [ 'waitForSync' => null, 'silent' => false, 'createCollection' => $this->getConnection()->getOption(ConnectionOptions::OPTION_CREATE), 'overwrite' => (bool) @$options[self::OPTION_OVERWRITE], 'returnOld' => (bool) @$options[self::OPTION_RETURN_OLD], 'returnNew' => (bool) @$options[self::OPTION_RETURN_NEW], ] ); $this->createCollectionIfOptions($collection, $params); $url = UrlHelper::appendParamsUrl(Urls::URL_DOCUMENT . '/' . $collection, $params); if (is_array($document)) { $data = $document; } else { $data = $document->getAllForInsertUpdate(); } $response = $this->getConnection()->post($url, $this->json_encode_wrapper($data)); $json = $response->getJson(); // This makes sure that if we're in batch mode, it will not go further and choke on the checks below. // Caution: Instead of a document ID, we are returning the batchpart object // The Id of the BatchPart can be retrieved by calling getId() on it. // We're basically returning an object here, in order not to accidentally use the batch part id as the document id if ($batchPart = $response->getBatchPart()) { return $batchPart; } if (@$options[self::OPTION_RETURN_OLD] || @$options[self::OPTION_RETURN_NEW]) { return $json; } if (is_array($document)) { return $json[$_documentClass::ENTRY_KEY]; } $location = $response->getLocationHeader(); if (!$location) { throw new ClientException('Did not find location header in server response'); } $id = UrlHelper::getDocumentIdFromLocation($location); $document->setInternalId($json[$_documentClass::ENTRY_ID]); $document->setRevision($json[$_documentClass::ENTRY_REV]); if ($id !== $document->getId()) { throw new ClientException('Got an invalid response from the server'); } $document->setIsNew(false); return $document->getId(); }
[ "public", "function", "save", "(", "$", "collection", ",", "$", "document", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "collection", "=", "$", "this", "->", "makeCollection", "(", "$", "collection", ")", ";", "$", "_documentClass", "="...
save a document to a collection This will add the document to the collection and return the document's id This will throw if the document cannot be saved @throws Exception @param mixed $collection - collection id as string or number @param Document|array $document - the document to be added, can be passed as a document or an array @param array $options - optional, array of options <p>Options are :<br> <li>'createCollection' - create the collection if it does not yet exist.</li> <li>'waitForSync' - if set to true, then all removal operations will instantly be synchronised to disk / If this is not specified, then the collection's default sync behavior will be applied.</li> <li>'overwrite' - if set to true, will turn the insert into a replace operation if a document with the specified key already exists.</li> <li>'returnNew' - if set to true, then the newly created document will be returned.</li> <li>'returnOld' - if set to true, then the replaced document will be returned - useful only when using overwrite = true.</li> </p> @return mixed - id of document created @since 1.0
[ "save", "a", "document", "to", "a", "collection" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L338-L400
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.update
public function update(Document $document, array $options = []) { return $this->updateById($document->getCollectionId(), $this->getDocumentId($document), $document, $options); }
php
public function update(Document $document, array $options = []) { return $this->updateById($document->getCollectionId(), $this->getDocumentId($document), $document, $options); }
[ "public", "function", "update", "(", "Document", "$", "document", ",", "array", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "updateById", "(", "$", "document", "->", "getCollectionId", "(", ")", ",", "$", "this", "->", "getDoc...
Update an existing document in a collection, identified by the including _id and optionally _rev in the patch document. Attention - The behavior of this method has changed since version 1.1 This will update the document on the server This will throw if the document cannot be updated If policy is set to error (locally or globally through the ConnectionOptions) and the passed document has a _rev value set, the database will check that the revision of the document to-be-replaced is the same as the one given. @throws Exception @param Document $document - The patch document that will update the document in question @param array $options - optional, array of options <p>Options are : <li>'policy' - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li> <li>'keepNull' - can be used to instruct ArangoDB to delete existing attributes instead setting their values to null. Defaults to true (keep attributes when set to null)</li> <li>'waitForSync' - can be used to force synchronisation of the document update operation to disk even in case that the waitForSync flag had been disabled for the entire collection</li> </p> @return bool - always true, will throw if there is an error
[ "Update", "an", "existing", "document", "in", "a", "collection", "identified", "by", "the", "including", "_id", "and", "optionally", "_rev", "in", "the", "patch", "document", ".", "Attention", "-", "The", "behavior", "of", "this", "method", "has", "changed", ...
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L436-L439
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.updateById
public function updateById($collection, $documentId, Document $document, array $options = []) { return $this->patch(Urls::URL_DOCUMENT, $collection, $documentId, $document, $options); }
php
public function updateById($collection, $documentId, Document $document, array $options = []) { return $this->patch(Urls::URL_DOCUMENT, $collection, $documentId, $document, $options); }
[ "public", "function", "updateById", "(", "$", "collection", ",", "$", "documentId", ",", "Document", "$", "document", ",", "array", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "patch", "(", "Urls", "::", "URL_DOCUMENT", ",", "...
Update an existing document in a collection, identified by collection id and document id Attention - The behavior of this method has changed since version 1.1 This will update the document on the server This will throw if the document cannot be updated If policy is set to error (locally or globally through the ConnectionOptions) and the passed document has a _rev value set, the database will check that the revision of the document to-be-updated is the same as the one given. @throws Exception @param string $collection - collection id as string or number @param mixed $documentId - document id as string or number @param Document $document - patch document which contains the attributes and values to be updated @param array $options - optional, array of options <p>Options are : <li>'policy' - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li> <li>'keepNull' - can be used to instruct ArangoDB to delete existing attributes instead setting their values to null. Defaults to true (keep attributes when set to null)</li> <li>'waitForSync' - can be used to force synchronisation of the document update operation to disk even in case that the waitForSync flag had been disabled for the entire collection</li> </p> @return bool - always true, will throw if there is an error
[ "Update", "an", "existing", "document", "in", "a", "collection", "identified", "by", "collection", "id", "and", "document", "id", "Attention", "-", "The", "behavior", "of", "this", "method", "has", "changed", "since", "version", "1", ".", "1" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L468-L471
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.patch
protected function patch($url, $collection, $documentId, Document $document, array $options = []) { $collection = $this->makeCollection($collection); $_documentClass = $this->_documentClass; $params = $this->includeOptionsInParams( $options, [ 'waitForSync' => $this->getConnectionOption(ConnectionOptions::OPTION_WAIT_SYNC), 'keepNull' => true, 'silent' => false, 'ignoreRevs' => true, 'policy' => $this->getConnectionOption(ConnectionOptions::OPTION_UPDATE_POLICY), 'returnOld' => (bool) @$options[self::OPTION_RETURN_OLD], 'returnNew' => (bool) @$options[self::OPTION_RETURN_NEW], ] ); $headers = []; if (isset($params[ConnectionOptions::OPTION_UPDATE_POLICY]) && $params[ConnectionOptions::OPTION_UPDATE_POLICY] === UpdatePolicy::ERROR ) { $revision = $document->getRevision(); if (null !== $revision) { $params['ignoreRevs'] = false; $headers['if-match'] = '"' . $revision . '"'; } } $url = UrlHelper::buildUrl($url, [$collection, $documentId]); $url = UrlHelper::appendParamsUrl($url, $params); $result = $this->getConnection()->patch($url, $this->json_encode_wrapper($document->getAllForInsertUpdate()), $headers); $json = $result->getJson(); $document->setRevision($json[$_documentClass::ENTRY_REV]); if (@$options[self::OPTION_RETURN_OLD] || @$options[self::OPTION_RETURN_NEW]) { return $json; } return true; }
php
protected function patch($url, $collection, $documentId, Document $document, array $options = []) { $collection = $this->makeCollection($collection); $_documentClass = $this->_documentClass; $params = $this->includeOptionsInParams( $options, [ 'waitForSync' => $this->getConnectionOption(ConnectionOptions::OPTION_WAIT_SYNC), 'keepNull' => true, 'silent' => false, 'ignoreRevs' => true, 'policy' => $this->getConnectionOption(ConnectionOptions::OPTION_UPDATE_POLICY), 'returnOld' => (bool) @$options[self::OPTION_RETURN_OLD], 'returnNew' => (bool) @$options[self::OPTION_RETURN_NEW], ] ); $headers = []; if (isset($params[ConnectionOptions::OPTION_UPDATE_POLICY]) && $params[ConnectionOptions::OPTION_UPDATE_POLICY] === UpdatePolicy::ERROR ) { $revision = $document->getRevision(); if (null !== $revision) { $params['ignoreRevs'] = false; $headers['if-match'] = '"' . $revision . '"'; } } $url = UrlHelper::buildUrl($url, [$collection, $documentId]); $url = UrlHelper::appendParamsUrl($url, $params); $result = $this->getConnection()->patch($url, $this->json_encode_wrapper($document->getAllForInsertUpdate()), $headers); $json = $result->getJson(); $document->setRevision($json[$_documentClass::ENTRY_REV]); if (@$options[self::OPTION_RETURN_OLD] || @$options[self::OPTION_RETURN_NEW]) { return $json; } return true; }
[ "protected", "function", "patch", "(", "$", "url", ",", "$", "collection", ",", "$", "documentId", ",", "Document", "$", "document", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "collection", "=", "$", "this", "->", "makeCollection", "("...
Update an existing document in a collection (internal method) @throws Exception @param string $url - server-side URL being called @param string $collection - collection id as string or number @param mixed $documentId - document id as string or number @param Document $document - patch document which contains the attributes and values to be updated @param array $options - optional, array of options <p>Options are : <li>'policy' - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li> <li>'keepNull' - can be used to instruct ArangoDB to delete existing attributes instead setting their values to null. Defaults to true (keep attributes when set to null)</li> <li>'waitForSync' - can be used to force synchronisation of the document update operation to disk even in case that the waitForSync flag had been disabled for the entire collection</li> </p> @internal @return bool - always true, will throw if there is an error
[ "Update", "an", "existing", "document", "in", "a", "collection", "(", "internal", "method", ")" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L494-L536
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.replace
public function replace(Document $document, array $options = []) { $documentId = $this->getDocumentId($document); return $this->replaceById($document, $documentId, $document, $options); }
php
public function replace(Document $document, array $options = []) { $documentId = $this->getDocumentId($document); return $this->replaceById($document, $documentId, $document, $options); }
[ "public", "function", "replace", "(", "Document", "$", "document", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "documentId", "=", "$", "this", "->", "getDocumentId", "(", "$", "document", ")", ";", "return", "$", "this", "->", "replaceB...
Replace an existing document in a collection, identified by the document itself This will update the document on the server This will throw if the document cannot be updated If policy is set to error (locally or globally through the ConnectionOptions) and the passed document has a _rev value set, the database will check that the revision of the to-be-replaced document is the same as the one given. @throws Exception @param Document $document - document to be updated @param array $options - optional, array of options <p>Options are : <li>'policy' - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li> <li>'waitForSync' - can be used to force synchronisation of the document update operation to disk even in case that the waitForSync flag had been disabled for the entire collection</li> </p> @return bool - always true, will throw if there is an error
[ "Replace", "an", "existing", "document", "in", "a", "collection", "identified", "by", "the", "document", "itself" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L561-L566
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.replaceById
public function replaceById($collection, $documentId, Document $document, array $options = []) { return $this->put(Urls::URL_DOCUMENT, $collection, $documentId, $document, $options); }
php
public function replaceById($collection, $documentId, Document $document, array $options = []) { return $this->put(Urls::URL_DOCUMENT, $collection, $documentId, $document, $options); }
[ "public", "function", "replaceById", "(", "$", "collection", ",", "$", "documentId", ",", "Document", "$", "document", ",", "array", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "put", "(", "Urls", "::", "URL_DOCUMENT", ",", "$...
Replace an existing document in a collection, identified by collection id and document id This will update the document on the server This will throw if the document cannot be Replaced If policy is set to error (locally or globally through the ConnectionOptions) and the passed document has a _rev value set, the database will check that the revision of the to-be-replaced document is the same as the one given. @throws Exception @param mixed $collection - collection id as string or number @param mixed $documentId - document id as string or number @param Document $document - document to be updated @param array $options - optional, array of options <p>Options are : <li>'policy' - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li> <li>'waitForSync' - can be used to force synchronisation of the document replacement operation to disk even in case that the waitForSync flag had been disabled for the entire collection</li> </p> @return bool - always true, will throw if there is an error
[ "Replace", "an", "existing", "document", "in", "a", "collection", "identified", "by", "collection", "id", "and", "document", "id" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L593-L596
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.remove
public function remove(Document $document, array $options = []) { $documentId = $this->getDocumentId($document); $revision = $this->getRevision($document); return $this->removeById($document, $documentId, $revision, $options); }
php
public function remove(Document $document, array $options = []) { $documentId = $this->getDocumentId($document); $revision = $this->getRevision($document); return $this->removeById($document, $documentId, $revision, $options); }
[ "public", "function", "remove", "(", "Document", "$", "document", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "documentId", "=", "$", "this", "->", "getDocumentId", "(", "$", "document", ")", ";", "$", "revision", "=", "$", "this", "-...
Remove a document from a collection, identified by the document itself @throws Exception @param Document $document - document to be removed @param array $options - optional, array of options <p>Options are : <li>'policy' - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li> <li>'waitForSync' - can be used to force synchronisation of the document removal operation to disk even in case that the waitForSync flag had been disabled for the entire collection</li> </p> @return bool - always true, will throw if there is an error
[ "Remove", "a", "document", "from", "a", "collection", "identified", "by", "the", "document", "itself" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L675-L682
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.removeById
public function removeById($collection, $documentId, $revision = null, array $options = []) { return $this->erase(Urls::URL_DOCUMENT, $collection, $documentId, $revision, $options); }
php
public function removeById($collection, $documentId, $revision = null, array $options = []) { return $this->erase(Urls::URL_DOCUMENT, $collection, $documentId, $revision, $options); }
[ "public", "function", "removeById", "(", "$", "collection", ",", "$", "documentId", ",", "$", "revision", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "erase", "(", "Urls", "::", "URL_DOCUMENT", ",", ...
Remove a document from a collection, identified by the collection id and document id @throws Exception @param mixed $collection - collection id as string or number @param mixed $documentId - document id as string or number @param mixed $revision - optional revision of the document to be deleted @param array $options - optional, array of options <p>Options are : <li>'policy' - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li> <li>'waitForSync' - can be used to force synchronisation of the document removal operation to disk even in case that the waitForSync flag had been disabled for the entire collection</li> </p> @return bool - always true, will throw if there is an error
[ "Remove", "a", "document", "from", "a", "collection", "identified", "by", "the", "collection", "id", "and", "document", "id" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L701-L704
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.erase
protected function erase($url, $collection, $documentId, $revision = null, array $options = []) { $collection = $this->makeCollection($collection); $params = $this->includeOptionsInParams( $options, [ 'waitForSync' => $this->getConnectionOption(ConnectionOptions::OPTION_WAIT_SYNC), 'silent' => false, 'ignoreRevs' => true, 'policy' => $this->getConnectionOption(ConnectionOptions::OPTION_DELETE_POLICY), 'returnOld' => (bool) @$options[self::OPTION_RETURN_OLD], ] ); $headers = []; if (isset($params[ConnectionOptions::OPTION_DELETE_POLICY]) && $params[ConnectionOptions::OPTION_DELETE_POLICY] === UpdatePolicy::ERROR ) { if (null !== $revision) { $params['ignoreRevs'] = false; $headers['if-match'] = '"' . $revision . '"'; } } $url = UrlHelper::buildUrl($url, [$collection, $documentId]); $url = UrlHelper::appendParamsUrl($url, $params); if (@$options[self::OPTION_RETURN_OLD]) { $result = $this->getConnection()->delete($url, $headers); $json = $result->getJson(); return $json; } $this->getConnection()->delete($url, $headers); return true; }
php
protected function erase($url, $collection, $documentId, $revision = null, array $options = []) { $collection = $this->makeCollection($collection); $params = $this->includeOptionsInParams( $options, [ 'waitForSync' => $this->getConnectionOption(ConnectionOptions::OPTION_WAIT_SYNC), 'silent' => false, 'ignoreRevs' => true, 'policy' => $this->getConnectionOption(ConnectionOptions::OPTION_DELETE_POLICY), 'returnOld' => (bool) @$options[self::OPTION_RETURN_OLD], ] ); $headers = []; if (isset($params[ConnectionOptions::OPTION_DELETE_POLICY]) && $params[ConnectionOptions::OPTION_DELETE_POLICY] === UpdatePolicy::ERROR ) { if (null !== $revision) { $params['ignoreRevs'] = false; $headers['if-match'] = '"' . $revision . '"'; } } $url = UrlHelper::buildUrl($url, [$collection, $documentId]); $url = UrlHelper::appendParamsUrl($url, $params); if (@$options[self::OPTION_RETURN_OLD]) { $result = $this->getConnection()->delete($url, $headers); $json = $result->getJson(); return $json; } $this->getConnection()->delete($url, $headers); return true; }
[ "protected", "function", "erase", "(", "$", "url", ",", "$", "collection", ",", "$", "documentId", ",", "$", "revision", "=", "null", ",", "array", "$", "options", "=", "[", "]", ")", "{", "$", "collection", "=", "$", "this", "->", "makeCollection", ...
Remove a document from a collection (internal method) @throws Exception @param string $url - the server-side URL being called @param string $collection - collection id as string or number @param mixed $documentId - document id as string or number @param mixed $revision - optional revision of the document to be deleted @param array $options - optional, array of options <p>Options are : <li>'policy' - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li> <li>'waitForSync' - can be used to force synchronisation of the document removal operation to disk even in case that the waitForSync flag had been disabled for the entire collection</li> </p> @internal @return bool - always true, will throw if there is an error
[ "Remove", "a", "document", "from", "a", "collection", "(", "internal", "method", ")" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L726-L762
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.getDocumentId
private function getDocumentId($document) { $documentId = $document; if ($document instanceof Document) { $documentId = $document->getId(); } if (!(is_int($documentId) || is_string($documentId) || is_float($documentId) || trim($documentId) === '')) { throw new ClientException('Cannot alter a document without a document id'); } return $documentId; }
php
private function getDocumentId($document) { $documentId = $document; if ($document instanceof Document) { $documentId = $document->getId(); } if (!(is_int($documentId) || is_string($documentId) || is_float($documentId) || trim($documentId) === '')) { throw new ClientException('Cannot alter a document without a document id'); } return $documentId; }
[ "private", "function", "getDocumentId", "(", "$", "document", ")", "{", "$", "documentId", "=", "$", "document", ";", "if", "(", "$", "document", "instanceof", "Document", ")", "{", "$", "documentId", "=", "$", "document", "->", "getId", "(", ")", ";", ...
Helper function to get a document id from a document or a document id value @throws ClientException @param mixed $document - document id OR document to be updated @return mixed - document id, will throw if there is an error
[ "Helper", "function", "to", "get", "a", "document", "id", "from", "a", "document", "or", "a", "document", "id", "value" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L774-L786
arangodb/arangodb-php
lib/ArangoDBClient/DocumentHandler.php
DocumentHandler.getRevision
private function getRevision($document) { $revision = null; if ($document instanceof Document) { $revision = $document->getRevision(); } return $revision; }
php
private function getRevision($document) { $revision = null; if ($document instanceof Document) { $revision = $document->getRevision(); } return $revision; }
[ "private", "function", "getRevision", "(", "$", "document", ")", "{", "$", "revision", "=", "null", ";", "if", "(", "$", "document", "instanceof", "Document", ")", "{", "$", "revision", "=", "$", "document", "->", "getRevision", "(", ")", ";", "}", "re...
Helper function to get a document id from a document or a document id value @throws ClientException @param mixed $document - document id OR document to be updated @return mixed - document id, will throw if there is an error
[ "Helper", "function", "to", "get", "a", "document", "id", "from", "a", "document", "or", "a", "document", "id", "value" ]
train
https://github.com/arangodb/arangodb-php/blob/89fac3fc9ab21ec8cf0a5dc35118abfaa3d49b02/lib/ArangoDBClient/DocumentHandler.php#L798-L807
zrashwani/arachnid
src/Arachnid/Adapters/GoutteAdapter.php
GoutteAdapter.prepareOptions
protected function prepareOptions(array $options = []) { $cookieName = time()."_".substr(md5(microtime()), 0, 5).".txt"; $defaultConfig = array( 'curl' => array( CURLOPT_COOKIEJAR => $cookieName, CURLOPT_COOKIEFILE => $cookieName, ), ); $configOptions = array_merge_recursive($options, $defaultConfig); return $configOptions; }
php
protected function prepareOptions(array $options = []) { $cookieName = time()."_".substr(md5(microtime()), 0, 5).".txt"; $defaultConfig = array( 'curl' => array( CURLOPT_COOKIEJAR => $cookieName, CURLOPT_COOKIEFILE => $cookieName, ), ); $configOptions = array_merge_recursive($options, $defaultConfig); return $configOptions; }
[ "protected", "function", "prepareOptions", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "cookieName", "=", "time", "(", ")", ".", "\"_\"", ".", "substr", "(", "md5", "(", "microtime", "(", ")", ")", ",", "0", ",", "5", ")", ".", "\...
get default configuration options for guzzle @return array
[ "get", "default", "configuration", "options", "for", "guzzle" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Adapters/GoutteAdapter.php#L33-L46
zrashwani/arachnid
src/Arachnid/Link.php
Link.getAbsoluteUrl
public function getAbsoluteUrl($withFragment=true) { if($this->isCrawlable() === false && empty($this->getFragment())){ $absolutePath = $this->getOriginalUrl(); }else{ if($this->parentLink !==null){ $newUri = \GuzzleHttp\Psr7\UriResolver::resolve($this->parentLink,$this); }else{ $newUri = $this; } $absolutePath = GuzzleUri::composeComponents( $newUri->getScheme(), $newUri->getAuthority(), $newUri->getPath(), $newUri->getQuery(), $withFragment===true?$this->getFragment():"" ); } return $absolutePath; }
php
public function getAbsoluteUrl($withFragment=true) { if($this->isCrawlable() === false && empty($this->getFragment())){ $absolutePath = $this->getOriginalUrl(); }else{ if($this->parentLink !==null){ $newUri = \GuzzleHttp\Psr7\UriResolver::resolve($this->parentLink,$this); }else{ $newUri = $this; } $absolutePath = GuzzleUri::composeComponents( $newUri->getScheme(), $newUri->getAuthority(), $newUri->getPath(), $newUri->getQuery(), $withFragment===true?$this->getFragment():"" ); } return $absolutePath; }
[ "public", "function", "getAbsoluteUrl", "(", "$", "withFragment", "=", "true", ")", "{", "if", "(", "$", "this", "->", "isCrawlable", "(", ")", "===", "false", "&&", "empty", "(", "$", "this", "->", "getFragment", "(", ")", ")", ")", "{", "$", "absol...
converting nodeUrl to absolute Url form @param boolean $withFragment @return string
[ "converting", "nodeUrl", "to", "absolute", "Url", "form" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Link.php#L154-L175
zrashwani/arachnid
src/Arachnid/Link.php
Link.isCrawlable
public function isCrawlable() { if (empty($this->getPath()) === true && ($this->parentLink && empty($this->parentLink->getPath()))) { return false; } $stop_links = array( '@^javascript\:.*$@i', '@^mailto\:.*@i', '@^tel\:.*@i', '@^skype\:.*@i', '@^fax\:.*@i', ); foreach ($stop_links as $ptrn) { if (preg_match($ptrn, $this->getOriginalUrl()) === 1) { return false; } } return true; }
php
public function isCrawlable() { if (empty($this->getPath()) === true && ($this->parentLink && empty($this->parentLink->getPath()))) { return false; } $stop_links = array( '@^javascript\:.*$@i', '@^mailto\:.*@i', '@^tel\:.*@i', '@^skype\:.*@i', '@^fax\:.*@i', ); foreach ($stop_links as $ptrn) { if (preg_match($ptrn, $this->getOriginalUrl()) === 1) { return false; } } return true; }
[ "public", "function", "isCrawlable", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "getPath", "(", ")", ")", "===", "true", "&&", "(", "$", "this", "->", "parentLink", "&&", "empty", "(", "$", "this", "->", "parentLink", "->", "getPath",...
Is a given URL crawlable? @param string $url @return bool
[ "Is", "a", "given", "URL", "crawlable?" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Link.php#L182-L204
zrashwani/arachnid
src/Arachnid/Link.php
Link.isExternal
public function isExternal() { $parentLink = $this->parentLink; if($parentLink===null){ //parentLink is null in case of baseUrl return false; } $isExternal = $this->getHost() !== "" && ($this->getHost() != $parentLink->getHost()); return $isExternal; }
php
public function isExternal() { $parentLink = $this->parentLink; if($parentLink===null){ //parentLink is null in case of baseUrl return false; } $isExternal = $this->getHost() !== "" && ($this->getHost() != $parentLink->getHost()); return $isExternal; }
[ "public", "function", "isExternal", "(", ")", "{", "$", "parentLink", "=", "$", "this", "->", "parentLink", ";", "if", "(", "$", "parentLink", "===", "null", ")", "{", "//parentLink is null in case of baseUrl", "return", "false", ";", "}", "$", "isExternal", ...
Is URL external? @param bool $localFile is the link from local file? @return bool
[ "Is", "URL", "external?" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Link.php#L211-L222
zrashwani/arachnid
src/Arachnid/Link.php
Link.extractHeaders
public function extractHeaders(){ $absoluteUrl = $this->getAbsoluteUrl(); $headersArrRaw = get_headers($absoluteUrl, 1); if($headersArrRaw === false){ throw new \Exception("cannot get headers for {$absoluteUrl}"); } $headersArr = array_change_key_case($headersArrRaw, CASE_LOWER); if(isset($headersArr[0]) === true && strpos($headersArr[0], 'HTTP/') !== false){ $statusStmt = $headersArr[0]; $statusParts = explode(' ', $statusStmt); $headersArr['status-code'] = $statusParts[1]; $statusIndex = strrpos($statusStmt, $statusParts[1])+ strlen($statusParts[1])+1; $headersArr['status'] = trim(substr($statusStmt, $statusIndex)); } if(is_array($headersArr['content-type']) === true){ $headersArr['content-type'] = end($headersArr['content-type']); } return $headersArr; }
php
public function extractHeaders(){ $absoluteUrl = $this->getAbsoluteUrl(); $headersArrRaw = get_headers($absoluteUrl, 1); if($headersArrRaw === false){ throw new \Exception("cannot get headers for {$absoluteUrl}"); } $headersArr = array_change_key_case($headersArrRaw, CASE_LOWER); if(isset($headersArr[0]) === true && strpos($headersArr[0], 'HTTP/') !== false){ $statusStmt = $headersArr[0]; $statusParts = explode(' ', $statusStmt); $headersArr['status-code'] = $statusParts[1]; $statusIndex = strrpos($statusStmt, $statusParts[1])+ strlen($statusParts[1])+1; $headersArr['status'] = trim(substr($statusStmt, $statusIndex)); } if(is_array($headersArr['content-type']) === true){ $headersArr['content-type'] = end($headersArr['content-type']); } return $headersArr; }
[ "public", "function", "extractHeaders", "(", ")", "{", "$", "absoluteUrl", "=", "$", "this", "->", "getAbsoluteUrl", "(", ")", ";", "$", "headersArrRaw", "=", "get_headers", "(", "$", "absoluteUrl", ",", "1", ")", ";", "if", "(", "$", "headersArrRaw", "=...
extract headers array for the link url @return array
[ "extract", "headers", "array", "for", "the", "link", "url" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Link.php#L241-L263
zrashwani/arachnid
src/Arachnid/Link.php
Link.removeDotsFromPath
protected function removeDotsFromPath(){ if($this->parentLink !==null){ $newUri = \GuzzleHttp\Psr7\UriResolver::resolve($this->parentLink,$this); }else{ $newUri = $this; } $finalPath = \GuzzleHttp\Psr7\UriResolver::removeDotSegments($newUri->getPath()); return $finalPath; }
php
protected function removeDotsFromPath(){ if($this->parentLink !==null){ $newUri = \GuzzleHttp\Psr7\UriResolver::resolve($this->parentLink,$this); }else{ $newUri = $this; } $finalPath = \GuzzleHttp\Psr7\UriResolver::removeDotSegments($newUri->getPath()); return $finalPath; }
[ "protected", "function", "removeDotsFromPath", "(", ")", "{", "if", "(", "$", "this", "->", "parentLink", "!==", "null", ")", "{", "$", "newUri", "=", "\\", "GuzzleHttp", "\\", "Psr7", "\\", "UriResolver", "::", "resolve", "(", "$", "this", "->", "parent...
remove dots from uri @return string
[ "remove", "dots", "from", "uri" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Link.php#L284-L293
zrashwani/arachnid
src/Arachnid/Crawler.php
Crawler.traverse
public function traverse(Link $url = null) { if ($url === null) { $url = $this->baseUrl; } $this->links[$url->getAbsoluteUrl(false)] = $url; $this->traverseSingle($url, 0); for($depth=1; $depth< $this->maxDepth; $depth++){ $this->log(LogLevel::DEBUG, "crwaling in depth#".$depth); if(!isset($this->childrenByDepth[$depth])){ $this->log(LogLevel::INFO, "skipping level#".$depth." no items found"); continue; } $count=1; foreach($this->childrenByDepth[$depth] as $parentUrl => $parentChilds){ $this->log(LogLevel::DEBUG, '('.$count."/".count($this->childrenByDepth[$depth]).") crawling links of ".$parentUrl. ' count of links '.count($parentChilds)); $parentLink = $this->links[$parentUrl]; foreach($parentChilds as $childUrl){ $childLink = new Link($childUrl,$parentLink); $this->traverseSingle($childLink, $depth); } $count++; } } return $this; }
php
public function traverse(Link $url = null) { if ($url === null) { $url = $this->baseUrl; } $this->links[$url->getAbsoluteUrl(false)] = $url; $this->traverseSingle($url, 0); for($depth=1; $depth< $this->maxDepth; $depth++){ $this->log(LogLevel::DEBUG, "crwaling in depth#".$depth); if(!isset($this->childrenByDepth[$depth])){ $this->log(LogLevel::INFO, "skipping level#".$depth." no items found"); continue; } $count=1; foreach($this->childrenByDepth[$depth] as $parentUrl => $parentChilds){ $this->log(LogLevel::DEBUG, '('.$count."/".count($this->childrenByDepth[$depth]).") crawling links of ".$parentUrl. ' count of links '.count($parentChilds)); $parentLink = $this->links[$parentUrl]; foreach($parentChilds as $childUrl){ $childLink = new Link($childUrl,$parentLink); $this->traverseSingle($childLink, $depth); } $count++; } } return $this; }
[ "public", "function", "traverse", "(", "Link", "$", "url", "=", "null", ")", "{", "if", "(", "$", "url", "===", "null", ")", "{", "$", "url", "=", "$", "this", "->", "baseUrl", ";", "}", "$", "this", "->", "links", "[", "$", "url", "->", "getAb...
Initiate the crawl @param UriInterface $url @return \Arachnid\Crawler
[ "Initiate", "the", "crawl" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Crawler.php#L107-L137
zrashwani/arachnid
src/Arachnid/Crawler.php
Crawler.getLinks
public function getLinks() { if ($this->filterCallback === null) { $links = $this->links; } else { $links = array_filter($this->links, function (Link $linkObj) { /*@var $linkObj Link */ return $linkObj->shouldNotVisit() === false; }); } return $links; }
php
public function getLinks() { if ($this->filterCallback === null) { $links = $this->links; } else { $links = array_filter($this->links, function (Link $linkObj) { /*@var $linkObj Link */ return $linkObj->shouldNotVisit() === false; }); } return $links; }
[ "public", "function", "getLinks", "(", ")", "{", "if", "(", "$", "this", "->", "filterCallback", "===", "null", ")", "{", "$", "links", "=", "$", "this", "->", "links", ";", "}", "else", "{", "$", "links", "=", "array_filter", "(", "$", "this", "->...
Get links (and related data) found by the crawler @return array
[ "Get", "links", "(", "and", "related", "data", ")", "found", "by", "the", "crawler" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Crawler.php#L143-L155
zrashwani/arachnid
src/Arachnid/Crawler.php
Crawler.getLinksArray
public function getLinksArray($includeOnlyVisited = false){ $links = $this->getLinks(); if($includeOnlyVisited === true){ $links = array_filter($links, function (Link $linkObj) { /*@var $linkObj Link */ return $linkObj->isVisited() === true; }); } return array_map(function(Link $link){ return [ 'fullUrl' => $link->getAbsoluteUrl(), 'uri' => $link->getPath(), 'metaInfo' => $link->getMetaInfoArray(), 'parentLink' => $link->getParentUrl(), 'statusCode' => $link->getStatusCode(), 'status' => $link->getStatus(), 'contentType' => $link->getContentType(), 'errorInfo' => $link->getErrorInfo(), 'crawlDepth' => $link->getCrawlDepth(), ]; },$links); }
php
public function getLinksArray($includeOnlyVisited = false){ $links = $this->getLinks(); if($includeOnlyVisited === true){ $links = array_filter($links, function (Link $linkObj) { /*@var $linkObj Link */ return $linkObj->isVisited() === true; }); } return array_map(function(Link $link){ return [ 'fullUrl' => $link->getAbsoluteUrl(), 'uri' => $link->getPath(), 'metaInfo' => $link->getMetaInfoArray(), 'parentLink' => $link->getParentUrl(), 'statusCode' => $link->getStatusCode(), 'status' => $link->getStatus(), 'contentType' => $link->getContentType(), 'errorInfo' => $link->getErrorInfo(), 'crawlDepth' => $link->getCrawlDepth(), ]; },$links); }
[ "public", "function", "getLinksArray", "(", "$", "includeOnlyVisited", "=", "false", ")", "{", "$", "links", "=", "$", "this", "->", "getLinks", "(", ")", ";", "if", "(", "$", "includeOnlyVisited", "===", "true", ")", "{", "$", "links", "=", "array_filte...
get links information as array @return array
[ "get", "links", "information", "as", "array" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Crawler.php#L161-L184
zrashwani/arachnid
src/Arachnid/Crawler.php
Crawler.traverseSingle
protected function traverseSingle(Link $linkObj, $depth) { $linkObj->setCrawlDepth($depth); $hash = $linkObj->getAbsoluteUrl(false); $this->links[$hash] = $linkObj; if ($linkObj->shouldNotVisit()===true) { return; } if($linkObj->isCrawlable()===false){ $linkObj->setAsShouldVisit(false); $this->log(LogLevel::INFO, 'skipping "'.$hash.'" not crawlable link', ['depth'=>$depth]); return; } $filterLinks = $this->filterCallback; if ($filterLinks !== null && $filterLinks($linkObj) === false) { $linkObj->setAsShouldVisit(false); $this->log(LogLevel::INFO, 'skipping "'.$hash.'" url not matching filter criteria', ['depth'=>$depth]); return; } try { $this->log(LogLevel::INFO, 'crawling '.$hash. ' in process', ['depth'=> $depth]); $headers = $linkObj->extractHeaders(); $statusCode = $headers['status-code']; $linkObj->setStatusCode($statusCode); $linkObj->setStatus($headers['status']); $linkObj->setAsTryingToVisit(); if ($linkObj->checkCrawlableStatusCode() === true) { $contentType = $headers['content-type']; $linkObj->setContentType($contentType); //traverse children in case the response in HTML document only if (strpos($contentType, 'text/html') !== false) { $childLinks = array(); if ($linkObj->isExternal() === false) { $client = $this->getScrapClient(); $crawler = $client->requestPage($linkObj->getAbsoluteUrl()); $this->extractMetaInfo($crawler, $hash); $childLinks = $this->extractLinksInfo($crawler, $linkObj); } $linkObj->setAsVisited(); $this->traverseChildren($linkObj, $childLinks, $depth+1); } }else{ $linkObj->setStatusCode($statusCode); } } catch (ClientException $e) { if ($filterLinks && $filterLinks($linkObj) === false) { $this->log(LogLevel::INFO, $hash.' skipping storing broken link not matching filter criteria'); } else { $linkObj->setStatusCode($e->getResponse()->getStatusCode()); $linkObj->setErrorInfo($e->getResponse()->getStatusCode()); $this->log(LogLevel::ERROR, $hash.' broken link detected code='.$e->getResponse()->getStatusCode()); } } catch (\Exception $e) { if ($filterLinks && $filterLinks($linkObj) === false) { $this->log(LogLevel::INFO, $linkObj.' skipping broken link not matching filter criteria'); } else { $linkObj->setStatusCode(500); $linkObj->setErrorInfo($e->getMessage()); $this->log(LogLevel::ERROR, $hash.' broken link detected code='.$e->getCode()); } } }
php
protected function traverseSingle(Link $linkObj, $depth) { $linkObj->setCrawlDepth($depth); $hash = $linkObj->getAbsoluteUrl(false); $this->links[$hash] = $linkObj; if ($linkObj->shouldNotVisit()===true) { return; } if($linkObj->isCrawlable()===false){ $linkObj->setAsShouldVisit(false); $this->log(LogLevel::INFO, 'skipping "'.$hash.'" not crawlable link', ['depth'=>$depth]); return; } $filterLinks = $this->filterCallback; if ($filterLinks !== null && $filterLinks($linkObj) === false) { $linkObj->setAsShouldVisit(false); $this->log(LogLevel::INFO, 'skipping "'.$hash.'" url not matching filter criteria', ['depth'=>$depth]); return; } try { $this->log(LogLevel::INFO, 'crawling '.$hash. ' in process', ['depth'=> $depth]); $headers = $linkObj->extractHeaders(); $statusCode = $headers['status-code']; $linkObj->setStatusCode($statusCode); $linkObj->setStatus($headers['status']); $linkObj->setAsTryingToVisit(); if ($linkObj->checkCrawlableStatusCode() === true) { $contentType = $headers['content-type']; $linkObj->setContentType($contentType); //traverse children in case the response in HTML document only if (strpos($contentType, 'text/html') !== false) { $childLinks = array(); if ($linkObj->isExternal() === false) { $client = $this->getScrapClient(); $crawler = $client->requestPage($linkObj->getAbsoluteUrl()); $this->extractMetaInfo($crawler, $hash); $childLinks = $this->extractLinksInfo($crawler, $linkObj); } $linkObj->setAsVisited(); $this->traverseChildren($linkObj, $childLinks, $depth+1); } }else{ $linkObj->setStatusCode($statusCode); } } catch (ClientException $e) { if ($filterLinks && $filterLinks($linkObj) === false) { $this->log(LogLevel::INFO, $hash.' skipping storing broken link not matching filter criteria'); } else { $linkObj->setStatusCode($e->getResponse()->getStatusCode()); $linkObj->setErrorInfo($e->getResponse()->getStatusCode()); $this->log(LogLevel::ERROR, $hash.' broken link detected code='.$e->getResponse()->getStatusCode()); } } catch (\Exception $e) { if ($filterLinks && $filterLinks($linkObj) === false) { $this->log(LogLevel::INFO, $linkObj.' skipping broken link not matching filter criteria'); } else { $linkObj->setStatusCode(500); $linkObj->setErrorInfo($e->getMessage()); $this->log(LogLevel::ERROR, $hash.' broken link detected code='.$e->getCode()); } } }
[ "protected", "function", "traverseSingle", "(", "Link", "$", "linkObj", ",", "$", "depth", ")", "{", "$", "linkObj", "->", "setCrawlDepth", "(", "$", "depth", ")", ";", "$", "hash", "=", "$", "linkObj", "->", "getAbsoluteUrl", "(", "false", ")", ";", "...
Crawl single URL @param Link $linkObj @param int $depth
[ "Crawl", "single", "URL" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Crawler.php#L191-L257
zrashwani/arachnid
src/Arachnid/Crawler.php
Crawler.getScrapClient
public function getScrapClient() { if ($this->scrapClient === null){ if($this->headlessBrowserEnabled === true){ $scrapClient = CrawlingFactory::create(CrawlingFactory::TYPE_HEADLESS_BROWSER, $this->config); }else{ $scrapClient = CrawlingFactory::create(CrawlingFactory::TYPE_GOUTTE, $this->config); } $this->setScrapClient($scrapClient); } return $this->scrapClient; }
php
public function getScrapClient() { if ($this->scrapClient === null){ if($this->headlessBrowserEnabled === true){ $scrapClient = CrawlingFactory::create(CrawlingFactory::TYPE_HEADLESS_BROWSER, $this->config); }else{ $scrapClient = CrawlingFactory::create(CrawlingFactory::TYPE_GOUTTE, $this->config); } $this->setScrapClient($scrapClient); } return $this->scrapClient; }
[ "public", "function", "getScrapClient", "(", ")", "{", "if", "(", "$", "this", "->", "scrapClient", "===", "null", ")", "{", "if", "(", "$", "this", "->", "headlessBrowserEnabled", "===", "true", ")", "{", "$", "scrapClient", "=", "CrawlingFactory", "::", ...
create and configure client used for scrapping it will configure goutte client by default @return CrawlingAdapterInterface
[ "create", "and", "configure", "client", "used", "for", "scrapping", "it", "will", "configure", "goutte", "client", "by", "default" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Crawler.php#L264-L275
zrashwani/arachnid
src/Arachnid/Crawler.php
Crawler.traverseChildren
public function traverseChildren(Link $sourceUrl, $childLinks, $depth) { foreach ($childLinks as $url => $info) { $filterCallback = $this->filterCallback; $childLink = new Link($url,$sourceUrl); $hash = $childLink->getAbsoluteUrl(false); $this->links[$hash] = $childLink; if ($filterCallback && $filterCallback($url)===false && isset($this->links[$hash]) === false) { $childLink->setAsShouldVisit(false); $this->log(LogLevel::INFO, 'skipping '.$url.' link not match filter criteria'); return; } if (isset($this->links[$hash]) === false) { $this->links[$hash] = $info; $childLink->setCrawlDepth($depth); } else { $originalLink = $this->links[$hash]; $originalLink->addMetaInfo('originalUrls',$childLink->getOriginalUrl()); $originalLink->addMetaInfo('linksText',$childLink->getMetaInfo('linksText')); } $this->childrenByDepth[$depth][$sourceUrl->getAbsoluteUrl(false)][] = $hash; } }
php
public function traverseChildren(Link $sourceUrl, $childLinks, $depth) { foreach ($childLinks as $url => $info) { $filterCallback = $this->filterCallback; $childLink = new Link($url,$sourceUrl); $hash = $childLink->getAbsoluteUrl(false); $this->links[$hash] = $childLink; if ($filterCallback && $filterCallback($url)===false && isset($this->links[$hash]) === false) { $childLink->setAsShouldVisit(false); $this->log(LogLevel::INFO, 'skipping '.$url.' link not match filter criteria'); return; } if (isset($this->links[$hash]) === false) { $this->links[$hash] = $info; $childLink->setCrawlDepth($depth); } else { $originalLink = $this->links[$hash]; $originalLink->addMetaInfo('originalUrls',$childLink->getOriginalUrl()); $originalLink->addMetaInfo('linksText',$childLink->getMetaInfo('linksText')); } $this->childrenByDepth[$depth][$sourceUrl->getAbsoluteUrl(false)][] = $hash; } }
[ "public", "function", "traverseChildren", "(", "Link", "$", "sourceUrl", ",", "$", "childLinks", ",", "$", "depth", ")", "{", "foreach", "(", "$", "childLinks", "as", "$", "url", "=>", "$", "info", ")", "{", "$", "filterCallback", "=", "$", "this", "->...
Crawl child links @param Link $sourceUrl @param array $childLinks @param int $depth
[ "Crawl", "child", "links" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Crawler.php#L312-L339
zrashwani/arachnid
src/Arachnid/Crawler.php
Crawler.extractLinksInfo
public function extractLinksInfo(DomCrawler $crawler, Link $pageLink) { $childLinks = array(); $crawler->filter('a')->each(function (DomCrawler $node, $i) use (&$childLinks, $pageLink) { $nodeText = trim($node->html()); $href = $node->extract('href')[0]; if(empty($href)===true){ return; } $nodeLink = new Link($href,$pageLink); $nodeLink->addMetaInfo('linksText', $nodeText); $hash = $nodeLink->getAbsoluteUrl(false,false); if(isset($this->links[$hash]) === false){ $childLinks[$hash] = $nodeLink; } $filterCallback = $this->filterCallback; if ($filterCallback && $filterCallback($hash) === false) { $nodeLink->setAsShouldVisit(false); $this->log(LogLevel::INFO, 'skipping '.$hash. ' not matching filter criteira'); return; } }); return $childLinks; }
php
public function extractLinksInfo(DomCrawler $crawler, Link $pageLink) { $childLinks = array(); $crawler->filter('a')->each(function (DomCrawler $node, $i) use (&$childLinks, $pageLink) { $nodeText = trim($node->html()); $href = $node->extract('href')[0]; if(empty($href)===true){ return; } $nodeLink = new Link($href,$pageLink); $nodeLink->addMetaInfo('linksText', $nodeText); $hash = $nodeLink->getAbsoluteUrl(false,false); if(isset($this->links[$hash]) === false){ $childLinks[$hash] = $nodeLink; } $filterCallback = $this->filterCallback; if ($filterCallback && $filterCallback($hash) === false) { $nodeLink->setAsShouldVisit(false); $this->log(LogLevel::INFO, 'skipping '.$hash. ' not matching filter criteira'); return; } }); return $childLinks; }
[ "public", "function", "extractLinksInfo", "(", "DomCrawler", "$", "crawler", ",", "Link", "$", "pageLink", ")", "{", "$", "childLinks", "=", "array", "(", ")", ";", "$", "crawler", "->", "filter", "(", "'a'", ")", "->", "each", "(", "function", "(", "D...
Extract links information from url @param \Symfony\Component\DomCrawler\Crawler $crawler @param Link $pageLink
[ "Extract", "links", "information", "from", "url" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Crawler.php#L346-L375
zrashwani/arachnid
src/Arachnid/Crawler.php
Crawler.extractMetaInfo
protected function extractMetaInfo(DomCrawler $crawler, $url) { /*@var $currentLink Link */ $currentLink = $this->links[$url]; $currentLink->setMetaInfo('title', ''); $currentLink->setMetaInfo('metaKeywords', ''); $currentLink->setMetaInfo('metaDescription', ''); $currentLink->setMetaInfo('title',trim(strip_tags($crawler->filter('title')->html()))); $crawler->filterXPath('//meta[@name="description"]')->each(function (DomCrawler $node) use (&$currentLink) { $currentLink->setMetaInfo('metaDescription', strip_tags($node->attr('content'))); }); $crawler->filterXPath('//meta[@name="keywords"]')->each(function (DomCrawler $node) use (&$currentLink) { $currentLink->setMetaInfo('metaKeywords',trim($node->attr('content'))); }); $crawler->filterXPath('//link[@rel="canonical"]')->each(function(DomCrawler $node) use (&$currentLink){ $currentLink->setMetaInfo('canonicalLink',trim($node->attr('href'))); }); $h1Count = $crawler->filter('h1')->count(); $currentLink->setMetaInfo('h1Count',$h1Count); $currentLink->setMetaInfo('h1Contents', array()); if ($h1Count > 0) { $crawler->filter('h1')->each(function (DomCrawler $node, $i) use ($currentLink) { $currentLink->addMetaInfo('h1Contents',trim($node->text())); }); } $h2Count = $crawler->filter('h2')->count(); $currentLink->setMetaInfo('h2Count',$h2Count); $currentLink->setMetaInfo('h2Contents', array()); if ($h2Count > 0) { $crawler->filter('h2')->each(function (DomCrawler $node, $i) use ($currentLink) { $currentLink->addMetaInfo('h2Contents',trim($node->text())); }); } }
php
protected function extractMetaInfo(DomCrawler $crawler, $url) { /*@var $currentLink Link */ $currentLink = $this->links[$url]; $currentLink->setMetaInfo('title', ''); $currentLink->setMetaInfo('metaKeywords', ''); $currentLink->setMetaInfo('metaDescription', ''); $currentLink->setMetaInfo('title',trim(strip_tags($crawler->filter('title')->html()))); $crawler->filterXPath('//meta[@name="description"]')->each(function (DomCrawler $node) use (&$currentLink) { $currentLink->setMetaInfo('metaDescription', strip_tags($node->attr('content'))); }); $crawler->filterXPath('//meta[@name="keywords"]')->each(function (DomCrawler $node) use (&$currentLink) { $currentLink->setMetaInfo('metaKeywords',trim($node->attr('content'))); }); $crawler->filterXPath('//link[@rel="canonical"]')->each(function(DomCrawler $node) use (&$currentLink){ $currentLink->setMetaInfo('canonicalLink',trim($node->attr('href'))); }); $h1Count = $crawler->filter('h1')->count(); $currentLink->setMetaInfo('h1Count',$h1Count); $currentLink->setMetaInfo('h1Contents', array()); if ($h1Count > 0) { $crawler->filter('h1')->each(function (DomCrawler $node, $i) use ($currentLink) { $currentLink->addMetaInfo('h1Contents',trim($node->text())); }); } $h2Count = $crawler->filter('h2')->count(); $currentLink->setMetaInfo('h2Count',$h2Count); $currentLink->setMetaInfo('h2Contents', array()); if ($h2Count > 0) { $crawler->filter('h2')->each(function (DomCrawler $node, $i) use ($currentLink) { $currentLink->addMetaInfo('h2Contents',trim($node->text())); }); } }
[ "protected", "function", "extractMetaInfo", "(", "DomCrawler", "$", "crawler", ",", "$", "url", ")", "{", "/*@var $currentLink Link */", "$", "currentLink", "=", "$", "this", "->", "links", "[", "$", "url", "]", ";", "$", "currentLink", "->", "setMetaInfo", ...
Extract meta title/description/keywords information from url @param \Symfony\Component\DomCrawler\Crawler $crawler @param string $url
[ "Extract", "meta", "title", "/", "description", "/", "keywords", "information", "from", "url" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/Crawler.php#L393-L430
zrashwani/arachnid
src/Arachnid/LinksCollection.php
LinksCollection.filterByDepth
public function filterByDepth($depth){ return $this->filter(function(Link $link) use($depth){ return $link->getCrawlDepth() == $depth; })->map(function(Link $link){ return [ 'source_page' => $link->getParentUrl(), 'link' => $link->getAbsoluteUrl(), ]; }); }
php
public function filterByDepth($depth){ return $this->filter(function(Link $link) use($depth){ return $link->getCrawlDepth() == $depth; })->map(function(Link $link){ return [ 'source_page' => $link->getParentUrl(), 'link' => $link->getAbsoluteUrl(), ]; }); }
[ "public", "function", "filterByDepth", "(", "$", "depth", ")", "{", "return", "$", "this", "->", "filter", "(", "function", "(", "Link", "$", "link", ")", "use", "(", "$", "depth", ")", "{", "return", "$", "link", "->", "getCrawlDepth", "(", ")", "==...
getting links in specific depth @param int $depth @return LinksCollection
[ "getting", "links", "in", "specific", "depth" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/LinksCollection.php#L23-L32
zrashwani/arachnid
src/Arachnid/LinksCollection.php
LinksCollection.getBrokenLinks
public function getBrokenLinks($showSummaryInfo = false){ $brokenLinks = $this->filter(function(Link $link){ return $link->isVisited() !== Link::STATUS_NOT_VISITED && //exclude links that are not visited $link->checkCrawlableStatusCode()===false; }); return $showSummaryInfo===false? //retrieve summary or details of links $brokenLinks: $brokenLinks->map(function(Link $link){ return [ 'source_page' => $link->getParentUrl(), 'link' => $link->getAbsoluteUrl(), 'status_code' => $link->getStatusCode(), ]; }); }
php
public function getBrokenLinks($showSummaryInfo = false){ $brokenLinks = $this->filter(function(Link $link){ return $link->isVisited() !== Link::STATUS_NOT_VISITED && //exclude links that are not visited $link->checkCrawlableStatusCode()===false; }); return $showSummaryInfo===false? //retrieve summary or details of links $brokenLinks: $brokenLinks->map(function(Link $link){ return [ 'source_page' => $link->getParentUrl(), 'link' => $link->getAbsoluteUrl(), 'status_code' => $link->getStatusCode(), ]; }); }
[ "public", "function", "getBrokenLinks", "(", "$", "showSummaryInfo", "=", "false", ")", "{", "$", "brokenLinks", "=", "$", "this", "->", "filter", "(", "function", "(", "Link", "$", "link", ")", "{", "return", "$", "link", "->", "isVisited", "(", ")", ...
getting broken links @param bool $showSummaryInfo if set to true, it will return only status_code and source page @return LinksCollection
[ "getting", "broken", "links" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/LinksCollection.php#L39-L55
zrashwani/arachnid
src/Arachnid/LinksCollection.php
LinksCollection.groupLinksByDepth
public function groupLinksByDepth(){ $final_items = []; $this->each(function(Link $linkObj, $uri) use(&$final_items){ $final_items[$linkObj->getCrawlDepth()][$uri] = [ 'link' => $linkObj->getAbsoluteUrl(), 'source_page' => $linkObj->getParentUrl(), ]; }); ksort($final_items); return $this->make($final_items); }
php
public function groupLinksByDepth(){ $final_items = []; $this->each(function(Link $linkObj, $uri) use(&$final_items){ $final_items[$linkObj->getCrawlDepth()][$uri] = [ 'link' => $linkObj->getAbsoluteUrl(), 'source_page' => $linkObj->getParentUrl(), ]; }); ksort($final_items); return $this->make($final_items); }
[ "public", "function", "groupLinksByDepth", "(", ")", "{", "$", "final_items", "=", "[", "]", ";", "$", "this", "->", "each", "(", "function", "(", "Link", "$", "linkObj", ",", "$", "uri", ")", "use", "(", "&", "$", "final_items", ")", "{", "$", "fi...
getting links grouped by depth of first traversing @return LinksCollection
[ "getting", "links", "grouped", "by", "depth", "of", "first", "traversing" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/LinksCollection.php#L61-L72
zrashwani/arachnid
src/Arachnid/LinksCollection.php
LinksCollection.groupLinksGroupedBySource
public function groupLinksGroupedBySource(){ return $this->map(function(Link $linkObj){ return ['link' => $linkObj->getAbsoluteUrl(), 'source_link' => $linkObj->getParentUrl()]; }) ->unique('link') ->groupBy('source_link'); }
php
public function groupLinksGroupedBySource(){ return $this->map(function(Link $linkObj){ return ['link' => $linkObj->getAbsoluteUrl(), 'source_link' => $linkObj->getParentUrl()]; }) ->unique('link') ->groupBy('source_link'); }
[ "public", "function", "groupLinksGroupedBySource", "(", ")", "{", "return", "$", "this", "->", "map", "(", "function", "(", "Link", "$", "linkObj", ")", "{", "return", "[", "'link'", "=>", "$", "linkObj", "->", "getAbsoluteUrl", "(", ")", ",", "'source_lin...
getting links organized by source page as following: [ "source_page1" => [children links], "source_page2" => [children_links], ...] @return LinksCollection
[ "getting", "links", "organized", "by", "source", "page", "as", "following", ":", "[", "source_page1", "=", ">", "[", "children", "links", "]", "source_page2", "=", ">", "[", "children_links", "]", "...", "]" ]
train
https://github.com/zrashwani/arachnid/blob/9ef28a0f9e259473a06de0c00f4dc808c5ef44e3/src/Arachnid/LinksCollection.php#L79-L87
Edujugon/laradoo
docs/cache/1.1.1/twig/c2/c254ea3ea1f5b903a2817f4c54faca82728c4d310e890b7b1ba6d96dd68f4554.php
__TwigTemplate_a1cfd821f509cd9858e2646730822057e9140d41f449ab134a2b650f210a350e.block_content
public function block_content($context, array $blocks = array()) { // line 4 echo " <div id=\"content\"> <div id=\"left-column\"> "; // line 6 $this->displayBlock("control_panel", $context, $blocks); echo " "; // line 7 $this->displayBlock("leftnav", $context, $blocks); echo " </div> <div id=\"right-column\"> "; // line 10 $this->displayBlock("menu", $context, $blocks); echo " "; // line 11 $this->displayBlock('below_menu', $context, $blocks); // line 12 echo " <div id=\"page-content\"> "; // line 13 $this->displayBlock('page_content', $context, $blocks); // line 14 echo " </div> "; // line 15 $this->displayBlock("footer", $context, $blocks); echo " </div> </div> "; }
php
public function block_content($context, array $blocks = array()) { // line 4 echo " <div id=\"content\"> <div id=\"left-column\"> "; // line 6 $this->displayBlock("control_panel", $context, $blocks); echo " "; // line 7 $this->displayBlock("leftnav", $context, $blocks); echo " </div> <div id=\"right-column\"> "; // line 10 $this->displayBlock("menu", $context, $blocks); echo " "; // line 11 $this->displayBlock('below_menu', $context, $blocks); // line 12 echo " <div id=\"page-content\"> "; // line 13 $this->displayBlock('page_content', $context, $blocks); // line 14 echo " </div> "; // line 15 $this->displayBlock("footer", $context, $blocks); echo " </div> </div> "; }
[ "public", "function", "block_content", "(", "$", "context", ",", "array", "$", "blocks", "=", "array", "(", ")", ")", "{", "// line 4", "echo", "\" <div id=\\\"content\\\">\n <div id=\\\"left-column\\\">\n \"", ";", "// line 6", "$", "this", "->", ...
line 3
[ "line", "3" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/c2/c254ea3ea1f5b903a2817f4c54faca82728c4d310e890b7b1ba6d96dd68f4554.php#L34-L70
Edujugon/laradoo
docs/cache/1.1.1/twig/c2/c254ea3ea1f5b903a2817f4c54faca82728c4d310e890b7b1ba6d96dd68f4554.php
__TwigTemplate_a1cfd821f509cd9858e2646730822057e9140d41f449ab134a2b650f210a350e.block_menu
public function block_menu($context, array $blocks = array()) { // line 21 echo " <nav id=\"site-nav\" class=\"navbar navbar-default\" role=\"navigation\"> <div class=\"container-fluid\"> <div class=\"navbar-header\"> <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#navbar-elements\"> <span class=\"sr-only\">Toggle navigation</span> <span class=\"icon-bar\"></span> <span class=\"icon-bar\"></span> <span class=\"icon-bar\"></span> </button> <a class=\"navbar-brand\" href=\""; // line 30 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "index.html"), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 30, $this->getSourceContext()); })()), "config", array(0 => "title"), "method"), "html", null, true); echo "</a> </div> <div class=\"collapse navbar-collapse\" id=\"navbar-elements\"> <ul class=\"nav navbar-nav\"> <li><a href=\""; // line 34 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "classes.html"), "html", null, true); echo "\">Classes</a></li> "; // line 35 if ((isset($context["has_namespaces"]) || array_key_exists("has_namespaces", $context) ? $context["has_namespaces"] : (function () { throw new Twig_Error_Runtime('Variable "has_namespaces" does not exist.', 35, $this->getSourceContext()); })())) { // line 36 echo " <li><a href=\""; echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "namespaces.html"), "html", null, true); echo "\">Namespaces</a></li> "; } // line 38 echo " <li><a href=\""; echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "interfaces.html"), "html", null, true); echo "\">Interfaces</a></li> <li><a href=\""; // line 39 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "traits.html"), "html", null, true); echo "\">Traits</a></li> <li><a href=\""; // line 40 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "doc-index.html"), "html", null, true); echo "\">Index</a></li> <li><a href=\""; // line 41 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "search.html"), "html", null, true); echo "\">Search</a></li> </ul> </div> </div> </nav> "; }
php
public function block_menu($context, array $blocks = array()) { // line 21 echo " <nav id=\"site-nav\" class=\"navbar navbar-default\" role=\"navigation\"> <div class=\"container-fluid\"> <div class=\"navbar-header\"> <button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"#navbar-elements\"> <span class=\"sr-only\">Toggle navigation</span> <span class=\"icon-bar\"></span> <span class=\"icon-bar\"></span> <span class=\"icon-bar\"></span> </button> <a class=\"navbar-brand\" href=\""; // line 30 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "index.html"), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 30, $this->getSourceContext()); })()), "config", array(0 => "title"), "method"), "html", null, true); echo "</a> </div> <div class=\"collapse navbar-collapse\" id=\"navbar-elements\"> <ul class=\"nav navbar-nav\"> <li><a href=\""; // line 34 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "classes.html"), "html", null, true); echo "\">Classes</a></li> "; // line 35 if ((isset($context["has_namespaces"]) || array_key_exists("has_namespaces", $context) ? $context["has_namespaces"] : (function () { throw new Twig_Error_Runtime('Variable "has_namespaces" does not exist.', 35, $this->getSourceContext()); })())) { // line 36 echo " <li><a href=\""; echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "namespaces.html"), "html", null, true); echo "\">Namespaces</a></li> "; } // line 38 echo " <li><a href=\""; echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "interfaces.html"), "html", null, true); echo "\">Interfaces</a></li> <li><a href=\""; // line 39 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "traits.html"), "html", null, true); echo "\">Traits</a></li> <li><a href=\""; // line 40 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "doc-index.html"), "html", null, true); echo "\">Index</a></li> <li><a href=\""; // line 41 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "search.html"), "html", null, true); echo "\">Search</a></li> </ul> </div> </div> </nav> "; }
[ "public", "function", "block_menu", "(", "$", "context", ",", "array", "$", "blocks", "=", "array", "(", ")", ")", "{", "// line 21", "echo", "\" <nav id=\\\"site-nav\\\" class=\\\"navbar navbar-default\\\" role=\\\"navigation\\\">\n <div class=\\\"container-fluid\\\">\...
line 20
[ "line", "20" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/c2/c254ea3ea1f5b903a2817f4c54faca82728c4d310e890b7b1ba6d96dd68f4554.php#L85-L140
Edujugon/laradoo
docs/cache/1.1.1/twig/c2/c254ea3ea1f5b903a2817f4c54faca82728c4d310e890b7b1ba6d96dd68f4554.php
__TwigTemplate_a1cfd821f509cd9858e2646730822057e9140d41f449ab134a2b650f210a350e.block_control_panel
public function block_control_panel($context, array $blocks = array()) { // line 53 echo " <div id=\"control-panel\"> "; // line 54 if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 54, $this->getSourceContext()); })()), "versions", array())) > 1)) { // line 55 echo " <form action=\"#\" method=\"GET\"> <select id=\"version-switcher\" name=\"version\"> "; // line 57 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 57, $this->getSourceContext()); })()), "versions", array())); foreach ($context['_seq'] as $context["_key"] => $context["version"]) { // line 58 echo " <option value=\""; echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, (("../" . $context["version"]) . "/index.html")), "html", null, true); echo "\" data-version=\""; echo twig_escape_filter($this->env, $context["version"], "html", null, true); echo "\">"; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), $context["version"], "longname", array()), "html", null, true); echo "</option> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['version'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 60 echo " </select> </form> "; } // line 63 echo " <script> \$('option[data-version=\"'+window.projectVersion+'\"]').prop('selected', true); </script> <form id=\"search-form\" action=\""; // line 66 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "search.html"), "html", null, true); echo "\" method=\"GET\"> <span class=\"glyphicon glyphicon-search\"></span> <input name=\"search\" class=\"typeahead form-control\" type=\"search\" placeholder=\"Search\"> </form> </div> "; }
php
public function block_control_panel($context, array $blocks = array()) { // line 53 echo " <div id=\"control-panel\"> "; // line 54 if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 54, $this->getSourceContext()); })()), "versions", array())) > 1)) { // line 55 echo " <form action=\"#\" method=\"GET\"> <select id=\"version-switcher\" name=\"version\"> "; // line 57 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 57, $this->getSourceContext()); })()), "versions", array())); foreach ($context['_seq'] as $context["_key"] => $context["version"]) { // line 58 echo " <option value=\""; echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, (("../" . $context["version"]) . "/index.html")), "html", null, true); echo "\" data-version=\""; echo twig_escape_filter($this->env, $context["version"], "html", null, true); echo "\">"; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), $context["version"], "longname", array()), "html", null, true); echo "</option> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['version'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 60 echo " </select> </form> "; } // line 63 echo " <script> \$('option[data-version=\"'+window.projectVersion+'\"]').prop('selected', true); </script> <form id=\"search-form\" action=\""; // line 66 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "search.html"), "html", null, true); echo "\" method=\"GET\"> <span class=\"glyphicon glyphicon-search\"></span> <input name=\"search\" class=\"typeahead form-control\" type=\"search\" placeholder=\"Search\"> </form> </div> "; }
[ "public", "function", "block_control_panel", "(", "$", "context", ",", "array", "$", "blocks", "=", "array", "(", ")", ")", "{", "// line 53", "echo", "\" <div id=\\\"control-panel\\\">\n \"", ";", "// line 54", "if", "(", "(", "twig_length_filter", "(", ...
line 52
[ "line", "52" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/c2/c254ea3ea1f5b903a2817f4c54faca82728c4d310e890b7b1ba6d96dd68f4554.php#L151-L200
Edujugon/laradoo
docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php
__TwigTemplate_e20a349d4a7bba4bf2b995715a52703a0de113fb07414524a73c2265185bcc5a.macro_namespace_link
public function macro_namespace_link($__namespace__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "namespace" => $__namespace__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 2 echo "<a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, (isset($context["namespace"]) || array_key_exists("namespace", $context) ? $context["namespace"] : (function () { throw new Twig_Error_Runtime('Variable "namespace" does not exist.', 2, $this->getSourceContext()); })())); echo "\">"; echo (isset($context["namespace"]) || array_key_exists("namespace", $context) ? $context["namespace"] : (function () { throw new Twig_Error_Runtime('Variable "namespace" does not exist.', 2, $this->getSourceContext()); })()); echo "</a>"; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_namespace_link($__namespace__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "namespace" => $__namespace__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 2 echo "<a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, (isset($context["namespace"]) || array_key_exists("namespace", $context) ? $context["namespace"] : (function () { throw new Twig_Error_Runtime('Variable "namespace" does not exist.', 2, $this->getSourceContext()); })())); echo "\">"; echo (isset($context["namespace"]) || array_key_exists("namespace", $context) ? $context["namespace"] : (function () { throw new Twig_Error_Runtime('Variable "namespace" does not exist.', 2, $this->getSourceContext()); })()); echo "</a>"; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_namespace_link", "(", "$", "__namespace__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "->", "mergeGlobals", "(", "array", "(", "\"namespace\"", "=>", "$", "__namespace__...
line 1
[ "line", "1" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php#L63-L85
Edujugon/laradoo
docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php
__TwigTemplate_e20a349d4a7bba4bf2b995715a52703a0de113fb07414524a73c2265185bcc5a.macro_class_link
public function macro_class_link($__class__ = null, $__absolute__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "class" => $__class__, "absolute" => $__absolute__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 6 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 6, $this->getSourceContext()); })()), "projectclass", array())) { // line 7 echo "<a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForClass($context, (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 7, $this->getSourceContext()); })())); echo "\">"; } elseif (twig_get_attribute($this->env, $this->getSourceContext(), // line 8 (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 8, $this->getSourceContext()); })()), "phpclass", array())) { // line 9 echo "<a target=\"_blank\" href=\"http://php.net/"; echo (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 9, $this->getSourceContext()); })()); echo "\">"; } // line 11 echo $this->env->getExtension('Sami\Renderer\TwigExtension')->abbrClass((isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 11, $this->getSourceContext()); })()), ((array_key_exists("absolute", $context)) ? (_twig_default_filter((isset($context["absolute"]) || array_key_exists("absolute", $context) ? $context["absolute"] : (function () { throw new Twig_Error_Runtime('Variable "absolute" does not exist.', 11, $this->getSourceContext()); })()), false)) : (false))); // line 12 if ((twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 12, $this->getSourceContext()); })()), "projectclass", array()) || twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 12, $this->getSourceContext()); })()), "phpclass", array()))) { echo "</a>"; } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_class_link($__class__ = null, $__absolute__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "class" => $__class__, "absolute" => $__absolute__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 6 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 6, $this->getSourceContext()); })()), "projectclass", array())) { // line 7 echo "<a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForClass($context, (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 7, $this->getSourceContext()); })())); echo "\">"; } elseif (twig_get_attribute($this->env, $this->getSourceContext(), // line 8 (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 8, $this->getSourceContext()); })()), "phpclass", array())) { // line 9 echo "<a target=\"_blank\" href=\"http://php.net/"; echo (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 9, $this->getSourceContext()); })()); echo "\">"; } // line 11 echo $this->env->getExtension('Sami\Renderer\TwigExtension')->abbrClass((isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 11, $this->getSourceContext()); })()), ((array_key_exists("absolute", $context)) ? (_twig_default_filter((isset($context["absolute"]) || array_key_exists("absolute", $context) ? $context["absolute"] : (function () { throw new Twig_Error_Runtime('Variable "absolute" does not exist.', 11, $this->getSourceContext()); })()), false)) : (false))); // line 12 if ((twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 12, $this->getSourceContext()); })()), "projectclass", array()) || twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 12, $this->getSourceContext()); })()), "phpclass", array()))) { echo "</a>"; } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_class_link", "(", "$", "__class__", "=", "null", ",", "$", "__absolute__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "->", "mergeGlobals", "(", "array", "(", "\"clas...
line 5
[ "line", "5" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php#L88-L124
Edujugon/laradoo
docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php
__TwigTemplate_e20a349d4a7bba4bf2b995715a52703a0de113fb07414524a73c2265185bcc5a.macro_method_link
public function macro_method_link($__method__ = null, $__absolute__ = null, $__classonly__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "method" => $__method__, "absolute" => $__absolute__, "classonly" => $__classonly__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 16 echo "<a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForMethod($context, (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 16, $this->getSourceContext()); })())); echo "\">"; // line 17 echo $this->env->getExtension('Sami\Renderer\TwigExtension')->abbrClass(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 17, $this->getSourceContext()); })()), "class", array())); if ( !((array_key_exists("classonly", $context)) ? (_twig_default_filter((isset($context["classonly"]) || array_key_exists("classonly", $context) ? $context["classonly"] : (function () { throw new Twig_Error_Runtime('Variable "classonly" does not exist.', 17, $this->getSourceContext()); })()), false)) : (false))) { echo "::"; echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 17, $this->getSourceContext()); })()), "name", array()); } // line 18 echo "</a>"; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_method_link($__method__ = null, $__absolute__ = null, $__classonly__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "method" => $__method__, "absolute" => $__absolute__, "classonly" => $__classonly__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 16 echo "<a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForMethod($context, (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 16, $this->getSourceContext()); })())); echo "\">"; // line 17 echo $this->env->getExtension('Sami\Renderer\TwigExtension')->abbrClass(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 17, $this->getSourceContext()); })()), "class", array())); if ( !((array_key_exists("classonly", $context)) ? (_twig_default_filter((isset($context["classonly"]) || array_key_exists("classonly", $context) ? $context["classonly"] : (function () { throw new Twig_Error_Runtime('Variable "classonly" does not exist.', 17, $this->getSourceContext()); })()), false)) : (false))) { echo "::"; echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 17, $this->getSourceContext()); })()), "name", array()); } // line 18 echo "</a>"; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_method_link", "(", "$", "__method__", "=", "null", ",", "$", "__absolute__", "=", "null", ",", "$", "__classonly__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "->", ...
line 15
[ "line", "15" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php#L127-L157
Edujugon/laradoo
docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php
__TwigTemplate_e20a349d4a7bba4bf2b995715a52703a0de113fb07414524a73c2265185bcc5a.macro_property_link
public function macro_property_link($__property__ = null, $__absolute__ = null, $__classonly__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "property" => $__property__, "absolute" => $__absolute__, "classonly" => $__classonly__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 22 echo "<a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForProperty($context, (isset($context["property"]) || array_key_exists("property", $context) ? $context["property"] : (function () { throw new Twig_Error_Runtime('Variable "property" does not exist.', 22, $this->getSourceContext()); })())); echo "\">"; // line 23 echo $this->env->getExtension('Sami\Renderer\TwigExtension')->abbrClass(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["property"]) || array_key_exists("property", $context) ? $context["property"] : (function () { throw new Twig_Error_Runtime('Variable "property" does not exist.', 23, $this->getSourceContext()); })()), "class", array())); if ( !((array_key_exists("classonly", $context)) ? (_twig_default_filter((isset($context["classonly"]) || array_key_exists("classonly", $context) ? $context["classonly"] : (function () { throw new Twig_Error_Runtime('Variable "classonly" does not exist.', 23, $this->getSourceContext()); })()), true)) : (true))) { echo "#"; echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["property"]) || array_key_exists("property", $context) ? $context["property"] : (function () { throw new Twig_Error_Runtime('Variable "property" does not exist.', 23, $this->getSourceContext()); })()), "name", array()); } // line 24 echo "</a>"; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_property_link($__property__ = null, $__absolute__ = null, $__classonly__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "property" => $__property__, "absolute" => $__absolute__, "classonly" => $__classonly__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 22 echo "<a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForProperty($context, (isset($context["property"]) || array_key_exists("property", $context) ? $context["property"] : (function () { throw new Twig_Error_Runtime('Variable "property" does not exist.', 22, $this->getSourceContext()); })())); echo "\">"; // line 23 echo $this->env->getExtension('Sami\Renderer\TwigExtension')->abbrClass(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["property"]) || array_key_exists("property", $context) ? $context["property"] : (function () { throw new Twig_Error_Runtime('Variable "property" does not exist.', 23, $this->getSourceContext()); })()), "class", array())); if ( !((array_key_exists("classonly", $context)) ? (_twig_default_filter((isset($context["classonly"]) || array_key_exists("classonly", $context) ? $context["classonly"] : (function () { throw new Twig_Error_Runtime('Variable "classonly" does not exist.', 23, $this->getSourceContext()); })()), true)) : (true))) { echo "#"; echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["property"]) || array_key_exists("property", $context) ? $context["property"] : (function () { throw new Twig_Error_Runtime('Variable "property" does not exist.', 23, $this->getSourceContext()); })()), "name", array()); } // line 24 echo "</a>"; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_property_link", "(", "$", "__property__", "=", "null", ",", "$", "__absolute__", "=", "null", ",", "$", "__classonly__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "-...
line 21
[ "line", "21" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php#L160-L190
Edujugon/laradoo
docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php
__TwigTemplate_e20a349d4a7bba4bf2b995715a52703a0de113fb07414524a73c2265185bcc5a.macro_source_link
public function macro_source_link($__project__ = null, $__class__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "project" => $__project__, "class" => $__class__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 44 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 44, $this->getSourceContext()); })()), "sourcepath", array())) { // line 45 echo " (<a href=\""; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 45, $this->getSourceContext()); })()), "sourcepath", array()), "html", null, true); echo "\">View source</a>)"; } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_source_link($__project__ = null, $__class__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "project" => $__project__, "class" => $__class__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 44 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 44, $this->getSourceContext()); })()), "sourcepath", array())) { // line 45 echo " (<a href=\""; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 45, $this->getSourceContext()); })()), "sourcepath", array()), "html", null, true); echo "\">View source</a>)"; } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_source_link", "(", "$", "__project__", "=", "null", ",", "$", "__class__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "->", "mergeGlobals", "(", "array", "(", "\"proj...
line 43
[ "line", "43" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php#L263-L287
Edujugon/laradoo
docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php
__TwigTemplate_e20a349d4a7bba4bf2b995715a52703a0de113fb07414524a73c2265185bcc5a.macro_method_source_link
public function macro_method_source_link($__method__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "method" => $__method__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 50 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 50, $this->getSourceContext()); })()), "sourcepath", array())) { // line 51 echo " <a href=\""; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 51, $this->getSourceContext()); })()), "sourcepath", array()), "html", null, true); echo "\">line "; echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 51, $this->getSourceContext()); })()), "line", array()); echo "</a>"; } else { // line 53 echo " line "; echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 53, $this->getSourceContext()); })()), "line", array()); } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_method_source_link($__method__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "method" => $__method__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 50 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 50, $this->getSourceContext()); })()), "sourcepath", array())) { // line 51 echo " <a href=\""; echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 51, $this->getSourceContext()); })()), "sourcepath", array()), "html", null, true); echo "\">line "; echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 51, $this->getSourceContext()); })()), "line", array()); echo "</a>"; } else { // line 53 echo " line "; echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 53, $this->getSourceContext()); })()), "line", array()); } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_method_source_link", "(", "$", "__method__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "->", "mergeGlobals", "(", "array", "(", "\"method\"", "=>", "$", "__method__", ...
line 49
[ "line", "49" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php#L290-L319
Edujugon/laradoo
docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php
__TwigTemplate_e20a349d4a7bba4bf2b995715a52703a0de113fb07414524a73c2265185bcc5a.macro_abbr_class
public function macro_abbr_class($__class__ = null, $__absolute__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "class" => $__class__, "absolute" => $__absolute__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 58 echo "<abbr title=\""; echo twig_escape_filter($this->env, (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 58, $this->getSourceContext()); })()), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, ((((array_key_exists("absolute", $context)) ? (_twig_default_filter((isset($context["absolute"]) || array_key_exists("absolute", $context) ? $context["absolute"] : (function () { throw new Twig_Error_Runtime('Variable "absolute" does not exist.', 58, $this->getSourceContext()); })()), false)) : (false))) ? ((isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 58, $this->getSourceContext()); })())) : (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 58, $this->getSourceContext()); })()), "shortname", array()))), "html", null, true); echo "</abbr>"; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_abbr_class($__class__ = null, $__absolute__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "class" => $__class__, "absolute" => $__absolute__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 58 echo "<abbr title=\""; echo twig_escape_filter($this->env, (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 58, $this->getSourceContext()); })()), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, ((((array_key_exists("absolute", $context)) ? (_twig_default_filter((isset($context["absolute"]) || array_key_exists("absolute", $context) ? $context["absolute"] : (function () { throw new Twig_Error_Runtime('Variable "absolute" does not exist.', 58, $this->getSourceContext()); })()), false)) : (false))) ? ((isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 58, $this->getSourceContext()); })())) : (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 58, $this->getSourceContext()); })()), "shortname", array()))), "html", null, true); echo "</abbr>"; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_abbr_class", "(", "$", "__class__", "=", "null", ",", "$", "__absolute__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "->", "mergeGlobals", "(", "array", "(", "\"clas...
line 57
[ "line", "57" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php#L322-L345
Edujugon/laradoo
docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php
__TwigTemplate_e20a349d4a7bba4bf2b995715a52703a0de113fb07414524a73c2265185bcc5a.macro_render_classes
public function macro_render_classes($__classes__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "classes" => $__classes__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 74 $context["__internal_459e61031b8eea89b40718a17788801593eaf42b76b0b112b18293a9894c6e74"] = $this; // line 75 echo " <div class=\"container-fluid underlined\"> "; // line 77 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new Twig_Error_Runtime('Variable "classes" does not exist.', 77, $this->getSourceContext()); })())); foreach ($context['_seq'] as $context["_key"] => $context["class"]) { // line 78 echo " <div class=\"row\"> <div class=\"col-md-6\"> "; // line 80 if (twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "isInterface", array())) { // line 81 echo " <em>"; echo $context["__internal_459e61031b8eea89b40718a17788801593eaf42b76b0b112b18293a9894c6e74"]->macro_class_link($context["class"], true); echo "</em> "; } else { // line 83 echo " "; echo $context["__internal_459e61031b8eea89b40718a17788801593eaf42b76b0b112b18293a9894c6e74"]->macro_class_link($context["class"], true); echo " "; } // line 85 echo " "; echo $context["__internal_459e61031b8eea89b40718a17788801593eaf42b76b0b112b18293a9894c6e74"]->macro_deprecated($context["class"]); echo " </div> <div class=\"col-md-6\"> "; // line 88 echo $this->env->getExtension('Sami\Renderer\TwigExtension')->parseDesc($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "shortdesc", array()), $context["class"]); echo " </div> </div> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['class'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 92 echo " </div>"; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_render_classes($__classes__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "classes" => $__classes__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 74 $context["__internal_459e61031b8eea89b40718a17788801593eaf42b76b0b112b18293a9894c6e74"] = $this; // line 75 echo " <div class=\"container-fluid underlined\"> "; // line 77 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new Twig_Error_Runtime('Variable "classes" does not exist.', 77, $this->getSourceContext()); })())); foreach ($context['_seq'] as $context["_key"] => $context["class"]) { // line 78 echo " <div class=\"row\"> <div class=\"col-md-6\"> "; // line 80 if (twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "isInterface", array())) { // line 81 echo " <em>"; echo $context["__internal_459e61031b8eea89b40718a17788801593eaf42b76b0b112b18293a9894c6e74"]->macro_class_link($context["class"], true); echo "</em> "; } else { // line 83 echo " "; echo $context["__internal_459e61031b8eea89b40718a17788801593eaf42b76b0b112b18293a9894c6e74"]->macro_class_link($context["class"], true); echo " "; } // line 85 echo " "; echo $context["__internal_459e61031b8eea89b40718a17788801593eaf42b76b0b112b18293a9894c6e74"]->macro_deprecated($context["class"]); echo " </div> <div class=\"col-md-6\"> "; // line 88 echo $this->env->getExtension('Sami\Renderer\TwigExtension')->parseDesc($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "shortdesc", array()), $context["class"]); echo " </div> </div> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['class'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 92 echo " </div>"; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_render_classes", "(", "$", "__classes__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "->", "mergeGlobals", "(", "array", "(", "\"classes\"", "=>", "$", "__classes__", "...
line 73
[ "line", "73" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php#L419-L482
Edujugon/laradoo
docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php
__TwigTemplate_e20a349d4a7bba4bf2b995715a52703a0de113fb07414524a73c2265185bcc5a.macro_breadcrumbs
public function macro_breadcrumbs($__namespace__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "namespace" => $__namespace__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 96 echo " "; $context["current_ns"] = ""; // line 97 echo " "; $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_split_filter($this->env, (isset($context["namespace"]) || array_key_exists("namespace", $context) ? $context["namespace"] : (function () { throw new Twig_Error_Runtime('Variable "namespace" does not exist.', 97, $this->getSourceContext()); })()), "\\")); foreach ($context['_seq'] as $context["_key"] => $context["ns"]) { // line 98 echo " "; if ((isset($context["current_ns"]) || array_key_exists("current_ns", $context) ? $context["current_ns"] : (function () { throw new Twig_Error_Runtime('Variable "current_ns" does not exist.', 98, $this->getSourceContext()); })())) { // line 99 echo " "; $context["current_ns"] = (((isset($context["current_ns"]) || array_key_exists("current_ns", $context) ? $context["current_ns"] : (function () { throw new Twig_Error_Runtime('Variable "current_ns" does not exist.', 99, $this->getSourceContext()); })()) . "\\") . $context["ns"]); // line 100 echo " "; } else { // line 101 echo " "; $context["current_ns"] = $context["ns"]; // line 102 echo " "; } // line 103 echo " <li><a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, (isset($context["current_ns"]) || array_key_exists("current_ns", $context) ? $context["current_ns"] : (function () { throw new Twig_Error_Runtime('Variable "current_ns" does not exist.', 103, $this->getSourceContext()); })())); echo "\">"; echo $context["ns"]; echo "</a></li> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ns'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_breadcrumbs($__namespace__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "namespace" => $__namespace__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 96 echo " "; $context["current_ns"] = ""; // line 97 echo " "; $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_split_filter($this->env, (isset($context["namespace"]) || array_key_exists("namespace", $context) ? $context["namespace"] : (function () { throw new Twig_Error_Runtime('Variable "namespace" does not exist.', 97, $this->getSourceContext()); })()), "\\")); foreach ($context['_seq'] as $context["_key"] => $context["ns"]) { // line 98 echo " "; if ((isset($context["current_ns"]) || array_key_exists("current_ns", $context) ? $context["current_ns"] : (function () { throw new Twig_Error_Runtime('Variable "current_ns" does not exist.', 98, $this->getSourceContext()); })())) { // line 99 echo " "; $context["current_ns"] = (((isset($context["current_ns"]) || array_key_exists("current_ns", $context) ? $context["current_ns"] : (function () { throw new Twig_Error_Runtime('Variable "current_ns" does not exist.', 99, $this->getSourceContext()); })()) . "\\") . $context["ns"]); // line 100 echo " "; } else { // line 101 echo " "; $context["current_ns"] = $context["ns"]; // line 102 echo " "; } // line 103 echo " <li><a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, (isset($context["current_ns"]) || array_key_exists("current_ns", $context) ? $context["current_ns"] : (function () { throw new Twig_Error_Runtime('Variable "current_ns" does not exist.', 103, $this->getSourceContext()); })())); echo "\">"; echo $context["ns"]; echo "</a></li> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ns'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_breadcrumbs", "(", "$", "__namespace__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "->", "mergeGlobals", "(", "array", "(", "\"namespace\"", "=>", "$", "__namespace__", ...
line 95
[ "line", "95" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php#L485-L535
Edujugon/laradoo
docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php
__TwigTemplate_e20a349d4a7bba4bf2b995715a52703a0de113fb07414524a73c2265185bcc5a.macro_todo
public function macro_todo($__reflection__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "reflection" => $__reflection__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 128 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["reflection"]) || array_key_exists("reflection", $context) ? $context["reflection"] : (function () { throw new Twig_Error_Runtime('Variable "reflection" does not exist.', 128, $this->getSourceContext()); })()), "todo", array())) { echo "<small><sup><span class=\"label label-info\">todo</span></sup></small>"; } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_todo($__reflection__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "reflection" => $__reflection__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 128 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["reflection"]) || array_key_exists("reflection", $context) ? $context["reflection"] : (function () { throw new Twig_Error_Runtime('Variable "reflection" does not exist.', 128, $this->getSourceContext()); })()), "todo", array())) { echo "<small><sup><span class=\"label label-info\">todo</span></sup></small>"; } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_todo", "(", "$", "__reflection__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "->", "mergeGlobals", "(", "array", "(", "\"reflection\"", "=>", "$", "__reflection__", ",...
line 127
[ "line", "127" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php#L620-L641
Edujugon/laradoo
docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php
__TwigTemplate_e20a349d4a7bba4bf2b995715a52703a0de113fb07414524a73c2265185bcc5a.macro_todos
public function macro_todos($__reflection__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "reflection" => $__reflection__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 132 echo " "; $context["__internal_d38e02c8a60fbfb3f5ec97bbdb3f58fb48c0cc75d3c186c91bfdf12d2a59cffb"] = $this; // line 133 echo " "; // line 134 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["reflection"]) || array_key_exists("reflection", $context) ? $context["reflection"] : (function () { throw new Twig_Error_Runtime('Variable "reflection" does not exist.', 134, $this->getSourceContext()); })()), "todo", array())) { // line 135 echo " <p> "; // line 136 echo $context["__internal_d38e02c8a60fbfb3f5ec97bbdb3f58fb48c0cc75d3c186c91bfdf12d2a59cffb"]->macro_todo((isset($context["reflection"]) || array_key_exists("reflection", $context) ? $context["reflection"] : (function () { throw new Twig_Error_Runtime('Variable "reflection" does not exist.', 136, $this->getSourceContext()); })())); echo " "; // line 137 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["reflection"]) || array_key_exists("reflection", $context) ? $context["reflection"] : (function () { throw new Twig_Error_Runtime('Variable "reflection" does not exist.', 137, $this->getSourceContext()); })()), "todo", array())); foreach ($context['_seq'] as $context["_key"] => $context["tag"]) { // line 138 echo " <tr> <td>"; // line 139 echo twig_get_attribute($this->env, $this->getSourceContext(), $context["tag"], 0, array(), "array"); echo "</td> <td>"; // line 140 echo twig_join_filter(twig_slice($this->env, $context["tag"], 1, null), " "); echo "</td> </tr> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['tag'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 143 echo " </p> "; } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_todos($__reflection__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "reflection" => $__reflection__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 132 echo " "; $context["__internal_d38e02c8a60fbfb3f5ec97bbdb3f58fb48c0cc75d3c186c91bfdf12d2a59cffb"] = $this; // line 133 echo " "; // line 134 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["reflection"]) || array_key_exists("reflection", $context) ? $context["reflection"] : (function () { throw new Twig_Error_Runtime('Variable "reflection" does not exist.', 134, $this->getSourceContext()); })()), "todo", array())) { // line 135 echo " <p> "; // line 136 echo $context["__internal_d38e02c8a60fbfb3f5ec97bbdb3f58fb48c0cc75d3c186c91bfdf12d2a59cffb"]->macro_todo((isset($context["reflection"]) || array_key_exists("reflection", $context) ? $context["reflection"] : (function () { throw new Twig_Error_Runtime('Variable "reflection" does not exist.', 136, $this->getSourceContext()); })())); echo " "; // line 137 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["reflection"]) || array_key_exists("reflection", $context) ? $context["reflection"] : (function () { throw new Twig_Error_Runtime('Variable "reflection" does not exist.', 137, $this->getSourceContext()); })()), "todo", array())); foreach ($context['_seq'] as $context["_key"] => $context["tag"]) { // line 138 echo " <tr> <td>"; // line 139 echo twig_get_attribute($this->env, $this->getSourceContext(), $context["tag"], 0, array(), "array"); echo "</td> <td>"; // line 140 echo twig_join_filter(twig_slice($this->env, $context["tag"], 1, null), " "); echo "</td> </tr> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['tag'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 143 echo " </p> "; } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_todos", "(", "$", "__reflection__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "->", "mergeGlobals", "(", "array", "(", "\"reflection\"", "=>", "$", "__reflection__", "...
line 131
[ "line", "131" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1c/1c8f0ab3a540f5025a138bd8db60627056cb7dc8b6b6e2438728d677c152ab28.php#L644-L699
Edujugon/laradoo
src/ripcord/ripcord_documentor.php
Ripcord_Documentor.handle
public function handle( $rpcServer ) { $methods = $rpcServer->call('system.listMethods'); echo '<!DOCTYPE html>'; echo '<html><head><title>' . $this->name . '</title>'; if ( isset($this->css) ) { if (strpos($this->css, "\n")!==false) { echo '<style type="text/css">'.$this->css.'</style>'; } else { echo '<link rel="stylesheet" type="text/css" href="' . $this->css . '">'; } } echo '</head><body>'; echo '<div class="content">'; echo '<h1>' . $this->name . '</h1>'; echo $this->header; echo '<p>'; $showWSDL = false; switch ( $this->version ) { case 'xmlrpc': echo 'This server implements the <a href="http://www.xmlrpc.com/spec">XML-RPC specification</a>'; break; case 'simple': echo 'This server implements the <a href="http://sites.google.com/a/simplerpc.org/simplerpc/Home/simplerpc-specification-v09">SimpleRPC 1.0 specification</a>'; break; case 'auto'; echo 'This server implements the <a href="http://www.w3.org/TR/2000/NOTE-SOAP-20000508/">SOAP 1.1</a>, <a href="http://www.xmlrpc.com/spec">XML-RPC</a> and <a href="http://sites.google.com/a/simplerpc.org/simplerpc/Home/simplerpc-specification-v09">SimpleRPC 1.0</a> specification.'; $showWSDL = true; break; case 'soap 1.1': echo 'This server implements the <a href="http://www.w3.org/TR/2000/NOTE-SOAP-20000508/">SOAP 1.1 specification</a>.'; $showWSDL = true; break; } echo '</p>'; if ( $showWSDL && ( $this->wsdl || $this->wsdl2 ) ) { echo '<ul>'; if ($this->wsdl) { echo '<li><a href="' . $this->root . '?wsdl">WSDL 1.1 Description</a></li>'; } if ($this->wsdl2) { echo '<li><a href="' . $this->root . '?wsdl2">WSDL 2.0 Description</a></li>'; } echo '</ul>'; } $methods = $rpcServer->call( 'system.describeMethods' ); $allMethods = array(); $allFunctions = array(); foreach( $methods['methodList'] as $index => $method ) { if ( strpos( $method['name'], '.' ) !== false ) { $allMethods[ $method['name'] ] = $index; } else { $allFunctions[ $method['name'] ] = $index; } } ksort( $allMethods ); ksort( $allFunctions ); $allMethods = $allFunctions + $allMethods; echo '<div class="index"><h2>Methods</h2><ul>'; foreach ( $allMethods as $methodName => $methodIndex ) { echo '<li><a href="#method_' . (int)$methodIndex . '">' . $methodName . '</a></li>'; } echo '</ul></div>'; $currentClass = ''; $class = ''; echo '<div class="functions">'; foreach ( $allMethods as $methodName => $methodIndex ) { $method = $methods['methodList'][$methodIndex]; $pos = strpos( $methodName, '.'); if ( $pos !== false ) { $class = substr( $methodName, 0, $pos ); } if ( $currentClass != $class ) { echo '</div>'; echo '<div class="class_'.$class.'">'; $currentClass = $class; } echo '<h2 id="method_'.$methodIndex.'">' . $method['name'] . '</h2>'; if ( isset( $method['signatures'] ) ) { foreach ( $method['signatures'] as $signature ) { echo '<div class="signature">'; if ( is_array( $signature['returns'] ) ) { $return = $signature['returns'][0]; echo '(' . $return['type'] . ') '; } echo $method['name'] . '('; $paramInfo = false; if ( is_array( $signature['params'] ) ) { $paramInfo = $signature['params']; $params = ''; foreach ( $signature['params'] as $param ) { $params .= ', (' . $param['type'] . ') ' . $param['name'] . ' '; } echo substr($params, 1); } echo ')</div>'; if ( is_array( $paramInfo ) ) { echo '<div class="params"><h3>Parameters</h3><ul>'; foreach ( $paramInfo as $param ) { echo '<li class="param">'; echo '<label>(' . $param['type'] . ') ' . $param['name'] . '</label> '; echo '<span>' . $param['description'] . '</span>'; echo '</li>'; } echo '</ul></div>'; } } } if ( $method['purpose'] ) { echo '<div class="purpose">' . $method['purpose'] . '</div>'; } if ( isset( $method['notes'] ) && is_array( $method['notes'] ) ) { echo '<div class="notes"><h3>Notes</h3><ol>'; foreach ( $method['notes'] as $note ) { echo '<li><span>' . $note. '</span></li>'; } echo '</ol></div>'; } if ( isset( $method['see'] ) && is_array( $method['see'] ) ) { echo '<div class="see">'; echo '<h3>See</h3>'; echo '<ul>'; foreach ( $method['see'] as $link => $description) { echo '<li>'; if ( isset( $allMethods[$link] ) ) { echo '<a href="#method_' . (int)$allMethods[$link] .'">' . $link . '</a> <span>' . $description . '</span>'; } else { echo '<span>' . $link . ' ' . $description . '</span>'; } echo '</li>'; } echo '</ul></div>'; } } echo '</div>'; echo $this->footer; echo '<div class="footer">'; echo 'Powered by <a href="http://ripcord.googlecode.com/">Ripcord : Simple RPC Server</a>.'; echo '</div>'; echo '</div></body></html>'; }
php
public function handle( $rpcServer ) { $methods = $rpcServer->call('system.listMethods'); echo '<!DOCTYPE html>'; echo '<html><head><title>' . $this->name . '</title>'; if ( isset($this->css) ) { if (strpos($this->css, "\n")!==false) { echo '<style type="text/css">'.$this->css.'</style>'; } else { echo '<link rel="stylesheet" type="text/css" href="' . $this->css . '">'; } } echo '</head><body>'; echo '<div class="content">'; echo '<h1>' . $this->name . '</h1>'; echo $this->header; echo '<p>'; $showWSDL = false; switch ( $this->version ) { case 'xmlrpc': echo 'This server implements the <a href="http://www.xmlrpc.com/spec">XML-RPC specification</a>'; break; case 'simple': echo 'This server implements the <a href="http://sites.google.com/a/simplerpc.org/simplerpc/Home/simplerpc-specification-v09">SimpleRPC 1.0 specification</a>'; break; case 'auto'; echo 'This server implements the <a href="http://www.w3.org/TR/2000/NOTE-SOAP-20000508/">SOAP 1.1</a>, <a href="http://www.xmlrpc.com/spec">XML-RPC</a> and <a href="http://sites.google.com/a/simplerpc.org/simplerpc/Home/simplerpc-specification-v09">SimpleRPC 1.0</a> specification.'; $showWSDL = true; break; case 'soap 1.1': echo 'This server implements the <a href="http://www.w3.org/TR/2000/NOTE-SOAP-20000508/">SOAP 1.1 specification</a>.'; $showWSDL = true; break; } echo '</p>'; if ( $showWSDL && ( $this->wsdl || $this->wsdl2 ) ) { echo '<ul>'; if ($this->wsdl) { echo '<li><a href="' . $this->root . '?wsdl">WSDL 1.1 Description</a></li>'; } if ($this->wsdl2) { echo '<li><a href="' . $this->root . '?wsdl2">WSDL 2.0 Description</a></li>'; } echo '</ul>'; } $methods = $rpcServer->call( 'system.describeMethods' ); $allMethods = array(); $allFunctions = array(); foreach( $methods['methodList'] as $index => $method ) { if ( strpos( $method['name'], '.' ) !== false ) { $allMethods[ $method['name'] ] = $index; } else { $allFunctions[ $method['name'] ] = $index; } } ksort( $allMethods ); ksort( $allFunctions ); $allMethods = $allFunctions + $allMethods; echo '<div class="index"><h2>Methods</h2><ul>'; foreach ( $allMethods as $methodName => $methodIndex ) { echo '<li><a href="#method_' . (int)$methodIndex . '">' . $methodName . '</a></li>'; } echo '</ul></div>'; $currentClass = ''; $class = ''; echo '<div class="functions">'; foreach ( $allMethods as $methodName => $methodIndex ) { $method = $methods['methodList'][$methodIndex]; $pos = strpos( $methodName, '.'); if ( $pos !== false ) { $class = substr( $methodName, 0, $pos ); } if ( $currentClass != $class ) { echo '</div>'; echo '<div class="class_'.$class.'">'; $currentClass = $class; } echo '<h2 id="method_'.$methodIndex.'">' . $method['name'] . '</h2>'; if ( isset( $method['signatures'] ) ) { foreach ( $method['signatures'] as $signature ) { echo '<div class="signature">'; if ( is_array( $signature['returns'] ) ) { $return = $signature['returns'][0]; echo '(' . $return['type'] . ') '; } echo $method['name'] . '('; $paramInfo = false; if ( is_array( $signature['params'] ) ) { $paramInfo = $signature['params']; $params = ''; foreach ( $signature['params'] as $param ) { $params .= ', (' . $param['type'] . ') ' . $param['name'] . ' '; } echo substr($params, 1); } echo ')</div>'; if ( is_array( $paramInfo ) ) { echo '<div class="params"><h3>Parameters</h3><ul>'; foreach ( $paramInfo as $param ) { echo '<li class="param">'; echo '<label>(' . $param['type'] . ') ' . $param['name'] . '</label> '; echo '<span>' . $param['description'] . '</span>'; echo '</li>'; } echo '</ul></div>'; } } } if ( $method['purpose'] ) { echo '<div class="purpose">' . $method['purpose'] . '</div>'; } if ( isset( $method['notes'] ) && is_array( $method['notes'] ) ) { echo '<div class="notes"><h3>Notes</h3><ol>'; foreach ( $method['notes'] as $note ) { echo '<li><span>' . $note. '</span></li>'; } echo '</ol></div>'; } if ( isset( $method['see'] ) && is_array( $method['see'] ) ) { echo '<div class="see">'; echo '<h3>See</h3>'; echo '<ul>'; foreach ( $method['see'] as $link => $description) { echo '<li>'; if ( isset( $allMethods[$link] ) ) { echo '<a href="#method_' . (int)$allMethods[$link] .'">' . $link . '</a> <span>' . $description . '</span>'; } else { echo '<span>' . $link . ' ' . $description . '</span>'; } echo '</li>'; } echo '</ul></div>'; } } echo '</div>'; echo $this->footer; echo '<div class="footer">'; echo 'Powered by <a href="http://ripcord.googlecode.com/">Ripcord : Simple RPC Server</a>.'; echo '</div>'; echo '</div></body></html>'; }
[ "public", "function", "handle", "(", "$", "rpcServer", ")", "{", "$", "methods", "=", "$", "rpcServer", "->", "call", "(", "'system.listMethods'", ")", ";", "echo", "'<!DOCTYPE html>'", ";", "echo", "'<html><head><title>'", ".", "$", "this", "->", "name", "....
This method handles any request which isn't a valid rpc request. @param object $rpcServer A reference to the active rpc server.
[ "This", "method", "handles", "any", "request", "which", "isn", "t", "a", "valid", "rpc", "request", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_documentor.php#L218-L390
Edujugon/laradoo
src/ripcord/ripcord_documentor.php
Ripcord_Documentor.getIntrospectionXML
function getIntrospectionXML() { $xml = "<?xml version='1.0' ?><introspection version='1.0'><methodList>"; if ( isset($this->methods) && is_array( $this->methods ) ) { foreach ($this->methods as $method => $methodData ) { if ( is_array( $methodData['call'] ) ) { $reflection = new ReflectionMethod( $methodData['call'][0], $methodData['call'][1] ); } else { $reflection = new ReflectionFunction( $methodData['call'] ); } $description = $reflection->getDocComment(); if ( $description && $this->docCommentParser ) { $data = $this->docCommentParser->parse( $description ); if ($data['description']) { $description = $data['description']; } } if ($description) { $description = '<p>' . str_replace( array( "\r\n\r\n", "\n\n") , '</p><p>', $description) . '</p>'; } if ( is_array( $data ) ) { foreach( $data as $key => $value ) { switch( $key ) { case 'category' : case 'deprecated' : case 'package' : $description .= '<div class="' . $key . '"><span class="tag">' . $key . '</span>' . $value .'</div>'; break; default : break; } } } $xml .= '<methodDescription name="' . $method . '"><purpose><![CDATA[' . $description . ']]></purpose>'; if ( is_array( $data ) && ( isset( $data['arguments'] ) || isset( $data['return'] ) ) ) { $xml .= '<signatures><signature>'; if ( isset( $data['arguments'] ) && is_array($data['arguments']) ) { $xml .= '<params>'; foreach ( $data['arguments'] as $name => $argument ) { if ( $name[0] == '$' ) { $name = substr( $name, 1 ); } $xml .= '<value type="' . htmlspecialchars( $argument['type'] ) . '" name="' . htmlspecialchars( $name ) . '"><![CDATA[' . $argument['description'] . ']]></value>'; } $xml .= '</params>'; } if ( isset( $data['return'] ) && is_array( $data['return'] ) ) { $xml .= '<returns><value type="' . htmlspecialchars($data['return']['type']) . '"><![CDATA[' . $data['return']['description'] . ']]></value></returns>'; } $xml .= '</signature></signatures>'; } $xml .= '</methodDescription>'; } } $xml .= "</methodList></introspection>"; return $xml; }
php
function getIntrospectionXML() { $xml = "<?xml version='1.0' ?><introspection version='1.0'><methodList>"; if ( isset($this->methods) && is_array( $this->methods ) ) { foreach ($this->methods as $method => $methodData ) { if ( is_array( $methodData['call'] ) ) { $reflection = new ReflectionMethod( $methodData['call'][0], $methodData['call'][1] ); } else { $reflection = new ReflectionFunction( $methodData['call'] ); } $description = $reflection->getDocComment(); if ( $description && $this->docCommentParser ) { $data = $this->docCommentParser->parse( $description ); if ($data['description']) { $description = $data['description']; } } if ($description) { $description = '<p>' . str_replace( array( "\r\n\r\n", "\n\n") , '</p><p>', $description) . '</p>'; } if ( is_array( $data ) ) { foreach( $data as $key => $value ) { switch( $key ) { case 'category' : case 'deprecated' : case 'package' : $description .= '<div class="' . $key . '"><span class="tag">' . $key . '</span>' . $value .'</div>'; break; default : break; } } } $xml .= '<methodDescription name="' . $method . '"><purpose><![CDATA[' . $description . ']]></purpose>'; if ( is_array( $data ) && ( isset( $data['arguments'] ) || isset( $data['return'] ) ) ) { $xml .= '<signatures><signature>'; if ( isset( $data['arguments'] ) && is_array($data['arguments']) ) { $xml .= '<params>'; foreach ( $data['arguments'] as $name => $argument ) { if ( $name[0] == '$' ) { $name = substr( $name, 1 ); } $xml .= '<value type="' . htmlspecialchars( $argument['type'] ) . '" name="' . htmlspecialchars( $name ) . '"><![CDATA[' . $argument['description'] . ']]></value>'; } $xml .= '</params>'; } if ( isset( $data['return'] ) && is_array( $data['return'] ) ) { $xml .= '<returns><value type="' . htmlspecialchars($data['return']['type']) . '"><![CDATA[' . $data['return']['description'] . ']]></value></returns>'; } $xml .= '</signature></signatures>'; } $xml .= '</methodDescription>'; } } $xml .= "</methodList></introspection>"; return $xml; }
[ "function", "getIntrospectionXML", "(", ")", "{", "$", "xml", "=", "\"<?xml version='1.0' ?><introspection version='1.0'><methodList>\"", ";", "if", "(", "isset", "(", "$", "this", "->", "methods", ")", "&&", "is_array", "(", "$", "this", "->", "methods", ")", "...
This method returns an XML document in the introspection format expected by xmlrpc_server_register_introspection_callback. It uses the php Reflection classes to gather information from the registered methods. Descriptions are added from phpdoc docblocks if found. @return string XML string with the introspection data.
[ "This", "method", "returns", "an", "XML", "document", "in", "the", "introspection", "format", "expected", "by", "xmlrpc_server_register_introspection_callback", ".", "It", "uses", "the", "php", "Reflection", "classes", "to", "gather", "information", "from", "the", "...
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_documentor.php#L399-L481
Edujugon/laradoo
src/ripcord/ripcord_documentor.php
Ripcord_Documentor_Parser_phpdoc.parse
public function parse( $commentBlock) { $this->currentTag = 'description'; $description = preg_replace('/^(\s*(\/\*\*|\*\/|\*))/m', '', $commentBlock); $info = array(); $lines = explode( "\n", $description ); foreach ( $lines as $line ) { $info = $this->parseLine( $line, $info ); } return $info; //array( 'description' => $description ); }
php
public function parse( $commentBlock) { $this->currentTag = 'description'; $description = preg_replace('/^(\s*(\/\*\*|\*\/|\*))/m', '', $commentBlock); $info = array(); $lines = explode( "\n", $description ); foreach ( $lines as $line ) { $info = $this->parseLine( $line, $info ); } return $info; //array( 'description' => $description ); }
[ "public", "function", "parse", "(", "$", "commentBlock", ")", "{", "$", "this", "->", "currentTag", "=", "'description'", ";", "$", "description", "=", "preg_replace", "(", "'/^(\\s*(\\/\\*\\*|\\*\\/|\\*))/m'", ",", "''", ",", "$", "commentBlock", ")", ";", "$...
This method parses a given docComment block and returns an array with information. @param string $commentBlock The docComment block. @return array The parsed information.
[ "This", "method", "parses", "a", "given", "docComment", "block", "and", "returns", "an", "array", "with", "information", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_documentor.php#L512-L522
Edujugon/laradoo
src/ripcord/ripcord_documentor.php
Ripcord_Documentor_Parser_phpdoc.parseLine
private function parseLine( $line, $info ) { $handled = false; if (preg_match('/^\s*(@[a-z]+)\s(.*)$/i', $line, $matches)) { $this->currentTag = substr($matches[1], 1); $line = trim( substr($line, strlen($this->currentTag)+2 ) ); switch( $this->currentTag ) { case 'param' : if ( preg_match('/^\s*([[:alpha:]|]+)\s([[:alnum:]$_]+)(.*)$/i', $line, $matches) ) { if ( !isset($info['arguments']) ) { $info['arguments'] = array(); } if ( !isset($info['arguments'][$matches[2]]) ) { $info['arguments'][$matches[2]] = array('description' => ''); } $info['arguments'][$matches[2]]['type'] = $matches[1]; $info['arguments'][$matches[2]]['description'] .= $this->parseDescription($matches[3]); } $handled = true; break; case 'return' : if ( preg_match('/^\s*([[:alpha:]|]+)\s(.*)$/i', $line, $matches) ) { if ( !isset($info['return']) ) { $info['return'] = array( 'description' => '' ); } $info['return']['type'] = $matches[1]; $info['return']['description'] .= $this->parseDescription($matches[2]); } $handled = true; break; } } if (!$handled) { switch( $this->currentTag) { case 'param' : case 'return' : if ( !isset( $info[$this->currentTag] ) ) { $info[$this->currentTag] = array(); } $info[$this->currentTag]['description'] .= $this->parseDescription($line); break; default: if ( !isset( $info[$this->currentTag] ) ) { $info[$this->currentTag] = ''; } $info[$this->currentTag] .= $this->parseDescription($line); break; } } return $info; }
php
private function parseLine( $line, $info ) { $handled = false; if (preg_match('/^\s*(@[a-z]+)\s(.*)$/i', $line, $matches)) { $this->currentTag = substr($matches[1], 1); $line = trim( substr($line, strlen($this->currentTag)+2 ) ); switch( $this->currentTag ) { case 'param' : if ( preg_match('/^\s*([[:alpha:]|]+)\s([[:alnum:]$_]+)(.*)$/i', $line, $matches) ) { if ( !isset($info['arguments']) ) { $info['arguments'] = array(); } if ( !isset($info['arguments'][$matches[2]]) ) { $info['arguments'][$matches[2]] = array('description' => ''); } $info['arguments'][$matches[2]]['type'] = $matches[1]; $info['arguments'][$matches[2]]['description'] .= $this->parseDescription($matches[3]); } $handled = true; break; case 'return' : if ( preg_match('/^\s*([[:alpha:]|]+)\s(.*)$/i', $line, $matches) ) { if ( !isset($info['return']) ) { $info['return'] = array( 'description' => '' ); } $info['return']['type'] = $matches[1]; $info['return']['description'] .= $this->parseDescription($matches[2]); } $handled = true; break; } } if (!$handled) { switch( $this->currentTag) { case 'param' : case 'return' : if ( !isset( $info[$this->currentTag] ) ) { $info[$this->currentTag] = array(); } $info[$this->currentTag]['description'] .= $this->parseDescription($line); break; default: if ( !isset( $info[$this->currentTag] ) ) { $info[$this->currentTag] = ''; } $info[$this->currentTag] .= $this->parseDescription($line); break; } } return $info; }
[ "private", "function", "parseLine", "(", "$", "line", ",", "$", "info", ")", "{", "$", "handled", "=", "false", ";", "if", "(", "preg_match", "(", "'/^\\s*(@[a-z]+)\\s(.*)$/i'", ",", "$", "line", ",", "$", "matches", ")", ")", "{", "$", "this", "->", ...
This method parses a single line from the comment block.
[ "This", "method", "parses", "a", "single", "line", "from", "the", "comment", "block", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_documentor.php#L527-L581
Edujugon/laradoo
src/ripcord/ripcord_documentor.php
Ripcord_Documentor_Parser_phpdoc.parseDescription
private function parseDescription( $line ) { while ( preg_match('/{@([^}]*)}/', $line, $matches) ) { switch( $matches[1] ) { case 'internal' : $line = str_replace( $matches[0], '', $line ); break; default : $line = str_replace( $matches[0], $matches[1], $line ); break; } } $line = str_replace( array( '\@', '{@*}' ), array( '@', '*/' ), $line ); return $line; }
php
private function parseDescription( $line ) { while ( preg_match('/{@([^}]*)}/', $line, $matches) ) { switch( $matches[1] ) { case 'internal' : $line = str_replace( $matches[0], '', $line ); break; default : $line = str_replace( $matches[0], $matches[1], $line ); break; } } $line = str_replace( array( '\@', '{@*}' ), array( '@', '*/' ), $line ); return $line; }
[ "private", "function", "parseDescription", "(", "$", "line", ")", "{", "while", "(", "preg_match", "(", "'/{@([^}]*)}/'", ",", "$", "line", ",", "$", "matches", ")", ")", "{", "switch", "(", "$", "matches", "[", "1", "]", ")", "{", "case", "'internal'"...
This method parses only the text description part of a line of the comment block.
[ "This", "method", "parses", "only", "the", "text", "description", "part", "of", "a", "line", "of", "the", "comment", "block", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_documentor.php#L586-L599
Edujugon/laradoo
src/ripcord/ripcord_server.php
Ripcord_Server.addService
public function addService($service, $serviceName = 0) { if ( is_object( $service ) ) { $reflection = new ReflectionObject( $service ); } else if ( is_string( $service ) && class_exists( $service ) ) { $reflection = new ReflectionClass( $service ); } else if ( is_callable( $service ) ) // method passed directly { $this->addMethod( $serviceName, $service ); return; } else { throw new Ripcord_InvalidArgumentException( 'Unknown service type ' . $serviceName, ripcord::unknownServiceType ); } if ( $serviceName && !is_numeric( $serviceName ) ) { $serviceName .= '.'; } else { $serviceName = ''; } $methods = $reflection->getMethods(); if ( is_array( $methods ) ) { foreach( $methods as $method ) { if ( substr( $method->name, 0, 1 ) != '_' && !$method->isPrivate() && !$method->isProtected()) { $rpcMethodName = $serviceName . $method->name; $this->addMethod( $rpcMethodName, array( $service, $method->name ) ); } } } }
php
public function addService($service, $serviceName = 0) { if ( is_object( $service ) ) { $reflection = new ReflectionObject( $service ); } else if ( is_string( $service ) && class_exists( $service ) ) { $reflection = new ReflectionClass( $service ); } else if ( is_callable( $service ) ) // method passed directly { $this->addMethod( $serviceName, $service ); return; } else { throw new Ripcord_InvalidArgumentException( 'Unknown service type ' . $serviceName, ripcord::unknownServiceType ); } if ( $serviceName && !is_numeric( $serviceName ) ) { $serviceName .= '.'; } else { $serviceName = ''; } $methods = $reflection->getMethods(); if ( is_array( $methods ) ) { foreach( $methods as $method ) { if ( substr( $method->name, 0, 1 ) != '_' && !$method->isPrivate() && !$method->isProtected()) { $rpcMethodName = $serviceName . $method->name; $this->addMethod( $rpcMethodName, array( $service, $method->name ) ); } } } }
[ "public", "function", "addService", "(", "$", "service", ",", "$", "serviceName", "=", "0", ")", "{", "if", "(", "is_object", "(", "$", "service", ")", ")", "{", "$", "reflection", "=", "new", "ReflectionObject", "(", "$", "service", ")", ";", "}", "...
Allows you to add a service to the server after construction. @param object $service The object or class whose public methods must be added to the rpc server. May also be a function or method. @param string $serviceName Optional. The namespace for the methods. @throws Ripcord_InvalidArgumentException (ripcord::unknownServiceType) when passed an incorrect service
[ "Allows", "you", "to", "add", "a", "service", "to", "the", "server", "after", "construction", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_server.php#L144-L188
Edujugon/laradoo
src/ripcord/ripcord_server.php
Ripcord_Server.addMethod
public function addMethod($name, $method) { $this->methods[$name] = array( 'name' => $name, 'call' => $method ); xmlrpc_server_register_method( $this->xmlrpc, $name, array( $this, 'call' ) ); }
php
public function addMethod($name, $method) { $this->methods[$name] = array( 'name' => $name, 'call' => $method ); xmlrpc_server_register_method( $this->xmlrpc, $name, array( $this, 'call' ) ); }
[ "public", "function", "addMethod", "(", "$", "name", ",", "$", "method", ")", "{", "$", "this", "->", "methods", "[", "$", "name", "]", "=", "array", "(", "'name'", "=>", "$", "name", ",", "'call'", "=>", "$", "method", ")", ";", "xmlrpc_server_regis...
Allows you to add a single method to the server after construction. @param string $name The name of the method as exposed through the rpc server @param callback $method The name of the method to call, or an array with classname or object and method name.
[ "Allows", "you", "to", "add", "a", "single", "method", "to", "the", "server", "after", "construction", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_server.php#L195-L202
Edujugon/laradoo
src/ripcord/ripcord_server.php
Ripcord_Server.parseRequest
private function parseRequest( $request_xml ) { $xml = @simplexml_load_string($request_xml); if (!$xml && !$xml->getNamespaces()) { // FIXME: check for protocol json-rpc //simplexml in combination with namespaces (soap) lets $xml evaluate to false return xmlrpc_encode_request( null, ripcord::fault( -3, 'Invalid Method Call - Ripcord Server accepts only XML-RPC, SimpleRPC or SOAP 1.1 calls'), $this->outputOptions ); } else { // prevent segmentation fault on incorrect xmlrpc request (without methodName) $methodCall = $xml->xpath('//methodCall'); if ($methodCall) { //xml-rpc $methodName = $xml->xpath('//methodName'); if (!$methodName) { return xmlrpc_encode_request( null, ripcord::fault( -3, 'Invalid Method Call - No methodName given'), $this->outputOptions ); } } } $method = null; ob_start(); // xmlrpc_decode echo expat errors if the xml is not valid, can't stop it. $params = xmlrpc_decode_request($request_xml, $method); ob_end_clean(); // clean up any xml errors return array( 'methodName' => $method, 'params' => $params ); }
php
private function parseRequest( $request_xml ) { $xml = @simplexml_load_string($request_xml); if (!$xml && !$xml->getNamespaces()) { // FIXME: check for protocol json-rpc //simplexml in combination with namespaces (soap) lets $xml evaluate to false return xmlrpc_encode_request( null, ripcord::fault( -3, 'Invalid Method Call - Ripcord Server accepts only XML-RPC, SimpleRPC or SOAP 1.1 calls'), $this->outputOptions ); } else { // prevent segmentation fault on incorrect xmlrpc request (without methodName) $methodCall = $xml->xpath('//methodCall'); if ($methodCall) { //xml-rpc $methodName = $xml->xpath('//methodName'); if (!$methodName) { return xmlrpc_encode_request( null, ripcord::fault( -3, 'Invalid Method Call - No methodName given'), $this->outputOptions ); } } } $method = null; ob_start(); // xmlrpc_decode echo expat errors if the xml is not valid, can't stop it. $params = xmlrpc_decode_request($request_xml, $method); ob_end_clean(); // clean up any xml errors return array( 'methodName' => $method, 'params' => $params ); }
[ "private", "function", "parseRequest", "(", "$", "request_xml", ")", "{", "$", "xml", "=", "@", "simplexml_load_string", "(", "$", "request_xml", ")", ";", "if", "(", "!", "$", "xml", "&&", "!", "$", "xml", "->", "getNamespaces", "(", ")", ")", "{", ...
This method wraps around xmlrpc_decode_request, since it is borken in many ways. This wraps around all the ugliness needed to make it not dump core and not print expat warnings.
[ "This", "method", "wraps", "around", "xmlrpc_decode_request", "since", "it", "is", "borken", "in", "many", "ways", ".", "This", "wraps", "around", "all", "the", "ugliness", "needed", "to", "make", "it", "not", "dump", "core", "and", "not", "print", "expat", ...
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_server.php#L258-L287
Edujugon/laradoo
src/ripcord/ripcord_server.php
Ripcord_Server.multiCall
private function multiCall( $params = null ) { if ( $params && is_array( $params ) ) { $result = array(); $params = $params[0]; foreach ( $params as $param ) { $method = $param['methodName']; $args = $param['params']; try { // XML-RPC specification says that non-fault results must be in a single item array $result[] = array( $this->call($method, $args) ); } catch( Exception $e) { $result[] = ripcord::fault( $e->getCode(), $e->getMessage() ); } } $result = xmlrpc_encode_request( null, $result, $this->outputOptions ); } else { $result = xmlrpc_encode_request( null, ripcord::fault( -2, 'Illegal or no params set for system.multiCall'), $this->outputOptions ); } return $result; }
php
private function multiCall( $params = null ) { if ( $params && is_array( $params ) ) { $result = array(); $params = $params[0]; foreach ( $params as $param ) { $method = $param['methodName']; $args = $param['params']; try { // XML-RPC specification says that non-fault results must be in a single item array $result[] = array( $this->call($method, $args) ); } catch( Exception $e) { $result[] = ripcord::fault( $e->getCode(), $e->getMessage() ); } } $result = xmlrpc_encode_request( null, $result, $this->outputOptions ); } else { $result = xmlrpc_encode_request( null, ripcord::fault( -2, 'Illegal or no params set for system.multiCall'), $this->outputOptions ); } return $result; }
[ "private", "function", "multiCall", "(", "$", "params", "=", "null", ")", "{", "if", "(", "$", "params", "&&", "is_array", "(", "$", "params", ")", ")", "{", "$", "result", "=", "array", "(", ")", ";", "$", "params", "=", "$", "params", "[", "0",...
This method implements the system.multiCall method without dumping core. The built-in method from the xmlrpc library dumps core when you have registered any php methods, fixed in php 5.3.2
[ "This", "method", "implements", "the", "system", ".", "multiCall", "method", "without", "dumping", "core", ".", "The", "built", "-", "in", "method", "from", "the", "xmlrpc", "library", "dumps", "core", "when", "you", "have", "registered", "any", "php", "meth...
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_server.php#L293-L317
Edujugon/laradoo
src/ripcord/ripcord_server.php
Ripcord_Server.handle
public function handle($request_xml) { $result = $this->parseRequest( $request_xml ); if (!$result || ripcord::isFault( $result ) ) { return $result; } else { $method = $result['methodName']; $params = $result['params']; } if ( $method == 'system.multiCall' || $method == 'system.multicall' ) { // php's xml-rpc server (xmlrpc-epi) crashes on multicall, so handle it ourselves... fixed in php 5.3.2 $result = $this->multiCall( $params ); } else { try { $result = xmlrpc_server_call_method( $this->xmlrpc, $request_xml, null, $this->outputOptions ); } catch( Exception $e) { $result = xmlrpc_encode_request( null, ripcord::fault( $e->getCode(), $e->getMessage() ), $this->outputOptions ); } } return $result; }
php
public function handle($request_xml) { $result = $this->parseRequest( $request_xml ); if (!$result || ripcord::isFault( $result ) ) { return $result; } else { $method = $result['methodName']; $params = $result['params']; } if ( $method == 'system.multiCall' || $method == 'system.multicall' ) { // php's xml-rpc server (xmlrpc-epi) crashes on multicall, so handle it ourselves... fixed in php 5.3.2 $result = $this->multiCall( $params ); } else { try { $result = xmlrpc_server_call_method( $this->xmlrpc, $request_xml, null, $this->outputOptions ); } catch( Exception $e) { $result = xmlrpc_encode_request( null, ripcord::fault( $e->getCode(), $e->getMessage() ), $this->outputOptions ); } } return $result; }
[ "public", "function", "handle", "(", "$", "request_xml", ")", "{", "$", "result", "=", "$", "this", "->", "parseRequest", "(", "$", "request_xml", ")", ";", "if", "(", "!", "$", "result", "||", "ripcord", "::", "isFault", "(", "$", "result", ")", ")"...
Handles the given request xml @param string $request_xml The incoming request. @return string
[ "Handles", "the", "given", "request", "xml" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_server.php#L324-L353
Edujugon/laradoo
src/ripcord/ripcord_server.php
Ripcord_Server.setOutputOption
public function setOutputOption($option, $value) { if ( isset($this->outputOptions[$option]) ) { $this->outputOptions[$option] = $value; return true; } else { return false; } }
php
public function setOutputOption($option, $value) { if ( isset($this->outputOptions[$option]) ) { $this->outputOptions[$option] = $value; return true; } else { return false; } }
[ "public", "function", "setOutputOption", "(", "$", "option", ",", "$", "value", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "outputOptions", "[", "$", "option", "]", ")", ")", "{", "$", "this", "->", "outputOptions", "[", "$", "option", "]"...
Allows you to set specific output options of the server after construction. @param string $option The name of the option @param mixed $value The value of the option The options are: - output_type: Return data as either php native data or xml encoded. Can be either 'php' or 'xml'. 'xml' is the default. - verbosity: Determines the compactness of generated xml. Can be either 'no_white_space', 'newlines_only' or 'pretty'. 'pretty' is the default. - escaping: Determines how/whether to escape certain characters. 1 or more values are allowed. If multiple, they need to be specified as a sub-array. Options are: 'cdata', 'non-ascii', 'non-print' and 'markup'. Default is 'non-ascii', 'non-print' and 'markup'. - version: Version of the xml vocabulary to use. Currently, three are supported: 'xmlrpc', 'soap 1.1' and 'simple'. The keyword 'auto' is also recognized and tells the server to respond in whichever version the request cam in. 'auto' is the default. - encoding: The character encoding that the data is in. Can be any supported character encoding. Default is 'utf-8'.
[ "Allows", "you", "to", "set", "specific", "output", "options", "of", "the", "server", "after", "construction", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_server.php#L405-L414
Edujugon/laradoo
docs/cache/1.1.1/twig/51/51463270f1f29cc26adad2eec664f2480b0489163541bec48d92f633e513d879.php
__TwigTemplate_2c2c4cb631625435ce5c1136fa901dc06440a2cd968a5939a51106637eb46d11.block_search_index
public function block_search_index($context, array $blocks = array()) { // line 22 echo " "; $context["__internal_1f1b5de7466779d8709a2c479e8097c869d242bdde42da28f2769cc3af41d7c9"] = $this; // line 23 echo " "; // line 24 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["namespaces"]) || array_key_exists("namespaces", $context) ? $context["namespaces"] : (function () { throw new Twig_Error_Runtime('Variable "namespaces" does not exist.', 24, $this->getSourceContext()); })())); foreach ($context['_seq'] as $context["_key"] => $context["ns"]) { // line 25 echo "{\"type\": \"Namespace\", \"link\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, $context["ns"]); echo "\", \"name\": \""; echo twig_replace_filter($context["ns"], array("\\" => "\\\\")); echo "\", \"doc\": \"Namespace "; echo twig_replace_filter($context["ns"], array("\\" => "\\\\")); echo "\"},"; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ns'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 27 echo " "; // line 28 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["interfaces"]) || array_key_exists("interfaces", $context) ? $context["interfaces"] : (function () { throw new Twig_Error_Runtime('Variable "interfaces" does not exist.', 28, $this->getSourceContext()); })())); foreach ($context['_seq'] as $context["_key"] => $context["class"]) { // line 29 echo "{\"type\": \"Interface\", "; if (twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array())) { echo "\"fromName\": \""; echo twig_replace_filter(twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array()), array("\\" => "\\\\")); echo "\", \"fromLink\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array())); echo "\","; } echo " \"link\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForClass($context, $context["class"]); echo "\", \"name\": \""; echo twig_replace_filter(twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "name", array()), array("\\" => "\\\\")); echo "\", \"doc\": \""; echo twig_escape_filter($this->env, json_encode($this->env->getExtension('Sami\Renderer\TwigExtension')->parseDesc($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "shortdesc", array()), $context["class"])), "html", null, true); echo "\"}, "; // line 30 echo $context["__internal_1f1b5de7466779d8709a2c479e8097c869d242bdde42da28f2769cc3af41d7c9"]->macro_add_class_methods_index($context["class"]); echo " "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['class'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 32 echo " "; // line 33 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new Twig_Error_Runtime('Variable "classes" does not exist.', 33, $this->getSourceContext()); })())); foreach ($context['_seq'] as $context["_key"] => $context["class"]) { // line 34 echo "{\"type\": "; if (twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "isTrait", array())) { echo "\"Trait\""; } else { echo "\"Class\""; } echo ", "; if (twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array())) { echo "\"fromName\": \""; echo twig_replace_filter(twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array()), array("\\" => "\\\\")); echo "\", \"fromLink\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array())); echo "\","; } echo " \"link\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForClass($context, $context["class"]); echo "\", \"name\": \""; echo twig_replace_filter(twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "name", array()), array("\\" => "\\\\")); echo "\", \"doc\": \""; echo twig_escape_filter($this->env, json_encode($this->env->getExtension('Sami\Renderer\TwigExtension')->parseDesc($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "shortdesc", array()), $context["class"])), "html", null, true); echo "\"}, "; // line 35 echo $context["__internal_1f1b5de7466779d8709a2c479e8097c869d242bdde42da28f2769cc3af41d7c9"]->macro_add_class_methods_index($context["class"]); echo " "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['class'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 37 echo " "; // line 39 echo " "; $this->displayBlock('search_index_extra', $context, $blocks); // line 40 echo " "; }
php
public function block_search_index($context, array $blocks = array()) { // line 22 echo " "; $context["__internal_1f1b5de7466779d8709a2c479e8097c869d242bdde42da28f2769cc3af41d7c9"] = $this; // line 23 echo " "; // line 24 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["namespaces"]) || array_key_exists("namespaces", $context) ? $context["namespaces"] : (function () { throw new Twig_Error_Runtime('Variable "namespaces" does not exist.', 24, $this->getSourceContext()); })())); foreach ($context['_seq'] as $context["_key"] => $context["ns"]) { // line 25 echo "{\"type\": \"Namespace\", \"link\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, $context["ns"]); echo "\", \"name\": \""; echo twig_replace_filter($context["ns"], array("\\" => "\\\\")); echo "\", \"doc\": \"Namespace "; echo twig_replace_filter($context["ns"], array("\\" => "\\\\")); echo "\"},"; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ns'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 27 echo " "; // line 28 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["interfaces"]) || array_key_exists("interfaces", $context) ? $context["interfaces"] : (function () { throw new Twig_Error_Runtime('Variable "interfaces" does not exist.', 28, $this->getSourceContext()); })())); foreach ($context['_seq'] as $context["_key"] => $context["class"]) { // line 29 echo "{\"type\": \"Interface\", "; if (twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array())) { echo "\"fromName\": \""; echo twig_replace_filter(twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array()), array("\\" => "\\\\")); echo "\", \"fromLink\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array())); echo "\","; } echo " \"link\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForClass($context, $context["class"]); echo "\", \"name\": \""; echo twig_replace_filter(twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "name", array()), array("\\" => "\\\\")); echo "\", \"doc\": \""; echo twig_escape_filter($this->env, json_encode($this->env->getExtension('Sami\Renderer\TwigExtension')->parseDesc($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "shortdesc", array()), $context["class"])), "html", null, true); echo "\"}, "; // line 30 echo $context["__internal_1f1b5de7466779d8709a2c479e8097c869d242bdde42da28f2769cc3af41d7c9"]->macro_add_class_methods_index($context["class"]); echo " "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['class'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 32 echo " "; // line 33 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new Twig_Error_Runtime('Variable "classes" does not exist.', 33, $this->getSourceContext()); })())); foreach ($context['_seq'] as $context["_key"] => $context["class"]) { // line 34 echo "{\"type\": "; if (twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "isTrait", array())) { echo "\"Trait\""; } else { echo "\"Class\""; } echo ", "; if (twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array())) { echo "\"fromName\": \""; echo twig_replace_filter(twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array()), array("\\" => "\\\\")); echo "\", \"fromLink\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "namespace", array())); echo "\","; } echo " \"link\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForClass($context, $context["class"]); echo "\", \"name\": \""; echo twig_replace_filter(twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "name", array()), array("\\" => "\\\\")); echo "\", \"doc\": \""; echo twig_escape_filter($this->env, json_encode($this->env->getExtension('Sami\Renderer\TwigExtension')->parseDesc($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["class"], "shortdesc", array()), $context["class"])), "html", null, true); echo "\"}, "; // line 35 echo $context["__internal_1f1b5de7466779d8709a2c479e8097c869d242bdde42da28f2769cc3af41d7c9"]->macro_add_class_methods_index($context["class"]); echo " "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['class'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 37 echo " "; // line 39 echo " "; $this->displayBlock('search_index_extra', $context, $blocks); // line 40 echo " "; }
[ "public", "function", "block_search_index", "(", "$", "context", ",", "array", "$", "blocks", "=", "array", "(", ")", ")", "{", "// line 22", "echo", "\" \"", ";", "$", "context", "[", "\"__internal_1f1b5de7466779d8709a2c479e8097c869d242bdde42da28f2769cc3af41...
line 21
[ "line", "21" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/51/51463270f1f29cc26adad2eec664f2480b0489163541bec48d92f633e513d879.php#L216-L318
Edujugon/laradoo
docs/cache/1.1.1/twig/51/51463270f1f29cc26adad2eec664f2480b0489163541bec48d92f633e513d879.php
__TwigTemplate_2c2c4cb631625435ce5c1136fa901dc06440a2cd968a5939a51106637eb46d11.macro_add_class_methods_index
public function macro_add_class_methods_index($__class__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "class" => $__class__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 216 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 216, $this->getSourceContext()); })()), "methods", array())) { // line 217 echo " "; $context["from_name"] = twig_replace_filter(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 217, $this->getSourceContext()); })()), "name", array()), array("\\" => "\\\\")); // line 218 echo " "; $context["from_link"] = $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForClass($context, (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 218, $this->getSourceContext()); })())); // line 219 echo " "; $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 219, $this->getSourceContext()); })()), "methods", array())); foreach ($context['_seq'] as $context["_key"] => $context["meth"]) { // line 220 echo " {\"type\": \"Method\", \"fromName\": \""; echo (isset($context["from_name"]) || array_key_exists("from_name", $context) ? $context["from_name"] : (function () { throw new Twig_Error_Runtime('Variable "from_name" does not exist.', 220, $this->getSourceContext()); })()); echo "\", \"fromLink\": \""; echo (isset($context["from_link"]) || array_key_exists("from_link", $context) ? $context["from_link"] : (function () { throw new Twig_Error_Runtime('Variable "from_link" does not exist.', 220, $this->getSourceContext()); })()); echo "\", \"link\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForMethod($context, $context["meth"]); echo "\", \"name\": \""; echo twig_replace_filter($context["meth"], array("\\" => "\\\\")); echo "\", \"doc\": \""; echo twig_escape_filter($this->env, json_encode($this->env->getExtension('Sami\Renderer\TwigExtension')->parseDesc($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["meth"], "shortdesc", array()), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 220, $this->getSourceContext()); })()))), "html", null, true); echo "\"}, "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['meth'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 222 echo " "; } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
php
public function macro_add_class_methods_index($__class__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array( "class" => $__class__, "varargs" => $__varargs__, )); $blocks = array(); ob_start(); try { // line 216 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 216, $this->getSourceContext()); })()), "methods", array())) { // line 217 echo " "; $context["from_name"] = twig_replace_filter(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 217, $this->getSourceContext()); })()), "name", array()), array("\\" => "\\\\")); // line 218 echo " "; $context["from_link"] = $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForClass($context, (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 218, $this->getSourceContext()); })())); // line 219 echo " "; $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 219, $this->getSourceContext()); })()), "methods", array())); foreach ($context['_seq'] as $context["_key"] => $context["meth"]) { // line 220 echo " {\"type\": \"Method\", \"fromName\": \""; echo (isset($context["from_name"]) || array_key_exists("from_name", $context) ? $context["from_name"] : (function () { throw new Twig_Error_Runtime('Variable "from_name" does not exist.', 220, $this->getSourceContext()); })()); echo "\", \"fromLink\": \""; echo (isset($context["from_link"]) || array_key_exists("from_link", $context) ? $context["from_link"] : (function () { throw new Twig_Error_Runtime('Variable "from_link" does not exist.', 220, $this->getSourceContext()); })()); echo "\", \"link\": \""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForMethod($context, $context["meth"]); echo "\", \"name\": \""; echo twig_replace_filter($context["meth"], array("\\" => "\\\\")); echo "\", \"doc\": \""; echo twig_escape_filter($this->env, json_encode($this->env->getExtension('Sami\Renderer\TwigExtension')->parseDesc($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["meth"], "shortdesc", array()), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 220, $this->getSourceContext()); })()))), "html", null, true); echo "\"}, "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['meth'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 222 echo " "; } return ('' === $tmp = ob_get_contents()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); } finally { ob_end_clean(); } }
[ "public", "function", "macro_add_class_methods_index", "(", "$", "__class__", "=", "null", ",", "...", "$", "__varargs__", ")", "{", "$", "context", "=", "$", "this", "->", "env", "->", "mergeGlobals", "(", "array", "(", "\"class\"", "=>", "$", "__class__", ...
line 215
[ "line", "215" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/51/51463270f1f29cc26adad2eec664f2480b0489163541bec48d92f633e513d879.php#L358-L408
Edujugon/laradoo
docs/cache/1.1.1/twig/78/7806c01482c2fd683b4f18e893713a02502e12dcdc06d8e94b84233187bb92c2.php
__TwigTemplate_896c8c4e949e23927cfc6dd0b699896d59d9ebda9f8bb2afd0ea8b6ea1bcba14.block_html
public function block_html($context, array $blocks = array()) { // line 36 echo " <body id=\""; $this->displayBlock('body_class', $context, $blocks); echo "\" data-name=\""; $this->displayBlock('page_id', $context, $blocks); echo "\" data-root-path=\""; echo twig_escape_filter($this->env, (isset($context["root_path"]) || array_key_exists("root_path", $context) ? $context["root_path"] : (function () { throw new Twig_Error_Runtime('Variable "root_path" does not exist.', 36, $this->getSourceContext()); })()), "html", null, true); echo "\"> "; // line 37 $this->displayBlock('content', $context, $blocks); // line 38 echo " </body> "; }
php
public function block_html($context, array $blocks = array()) { // line 36 echo " <body id=\""; $this->displayBlock('body_class', $context, $blocks); echo "\" data-name=\""; $this->displayBlock('page_id', $context, $blocks); echo "\" data-root-path=\""; echo twig_escape_filter($this->env, (isset($context["root_path"]) || array_key_exists("root_path", $context) ? $context["root_path"] : (function () { throw new Twig_Error_Runtime('Variable "root_path" does not exist.', 36, $this->getSourceContext()); })()), "html", null, true); echo "\"> "; // line 37 $this->displayBlock('content', $context, $blocks); // line 38 echo " </body> "; }
[ "public", "function", "block_html", "(", "$", "context", ",", "array", "$", "blocks", "=", "array", "(", ")", ")", "{", "// line 36", "echo", "\" <body id=\\\"\"", ";", "$", "this", "->", "displayBlock", "(", "'body_class'", ",", "$", "context", ",", "$...
line 35
[ "line", "35" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/78/7806c01482c2fd683b4f18e893713a02502e12dcdc06d8e94b84233187bb92c2.php#L133-L149
Edujugon/laradoo
src/ripcord/ripcord_client.php
Ripcord_Client_MultiCall.execute
public function execute() { if ($this->methodName=='system.multiCall') { return $this->client->system->multiCall( $this->client->_multiCallArgs ); } else { // system.multicall return $this->client->system->multicall( $this->client->_multiCallArgs ); } }
php
public function execute() { if ($this->methodName=='system.multiCall') { return $this->client->system->multiCall( $this->client->_multiCallArgs ); } else { // system.multicall return $this->client->system->multicall( $this->client->_multiCallArgs ); } }
[ "public", "function", "execute", "(", ")", "{", "if", "(", "$", "this", "->", "methodName", "==", "'system.multiCall'", ")", "{", "return", "$", "this", "->", "client", "->", "system", "->", "multiCall", "(", "$", "this", "->", "client", "->", "_multiCal...
/* This method finally calls the clients multiCall method with all deferred method calls since multiCall mode was enabled.
[ "/", "*", "This", "method", "finally", "calls", "the", "clients", "multiCall", "method", "with", "all", "deferred", "method", "calls", "since", "multiCall", "mode", "was", "enabled", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_client.php#L343-L350
Edujugon/laradoo
src/ripcord/ripcord_client.php
Ripcord_Transport_Stream.post
public function post( $url, $request ) { $options = array_merge( $this->options, array( 'http' => array( 'method' => "POST", 'header' => "Content-Type: text/xml", 'content' => $request ) ) ); $context = stream_context_create( $options ); $result = @file_get_contents( $url, false, $context ); $this->responseHeaders = $http_response_header; if ( !$result ) { throw new Ripcord_TransportException( 'Could not access ' . $url, ripcord::cannotAccessURL ); } return $result; }
php
public function post( $url, $request ) { $options = array_merge( $this->options, array( 'http' => array( 'method' => "POST", 'header' => "Content-Type: text/xml", 'content' => $request ) ) ); $context = stream_context_create( $options ); $result = @file_get_contents( $url, false, $context ); $this->responseHeaders = $http_response_header; if ( !$result ) { throw new Ripcord_TransportException( 'Could not access ' . $url, ripcord::cannotAccessURL ); } return $result; }
[ "public", "function", "post", "(", "$", "url", ",", "$", "request", ")", "{", "$", "options", "=", "array_merge", "(", "$", "this", "->", "options", ",", "array", "(", "'http'", "=>", "array", "(", "'method'", "=>", "\"POST\"", ",", "'header'", "=>", ...
This method posts the request to the given url. @param string $url The url to post to. @param string $request The request to post. @return string The server response @throws Ripcord_TransportException (ripcord::cannotAccessURL) when the given URL cannot be accessed for any reason.
[ "This", "method", "posts", "the", "request", "to", "the", "given", "url", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_client.php#L471-L492
Edujugon/laradoo
src/ripcord/ripcord_client.php
Ripcord_Transport_CURL.post
public function post( $url, $request) { $curl = curl_init(); $options = (array) $this->options + array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => $url, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $request, CURLOPT_HEADER => true ); curl_setopt_array( $curl, $options ); $contents = curl_exec( $curl ); $headerSize = curl_getinfo( $curl, CURLINFO_HEADER_SIZE ); $this->responseHeaders = substr( $contents, 0, $headerSize ); $contents = substr( $contents, $headerSize ); if ( curl_errno( $curl ) ) { $errorNumber = curl_errno( $curl ); $errorMessage = curl_error( $curl ); curl_close( $curl ); $version = explode('.', phpversion() ); if (!$this->_skipPreviousException) { // previousException supported in php >= 5.3 $exception = new Ripcord_TransportException( 'Could not access ' . $url , ripcord::cannotAccessURL , new Exception( $errorMessage, $errorNumber ) ); } else { $exception = new Ripcord_TransportException( 'Could not access ' . $url . ' ( original CURL error: ' . $errorMessage . ' ) ', ripcord::cannotAccessURL ); } throw $exception; } curl_close($curl); return $contents; }
php
public function post( $url, $request) { $curl = curl_init(); $options = (array) $this->options + array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => $url, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $request, CURLOPT_HEADER => true ); curl_setopt_array( $curl, $options ); $contents = curl_exec( $curl ); $headerSize = curl_getinfo( $curl, CURLINFO_HEADER_SIZE ); $this->responseHeaders = substr( $contents, 0, $headerSize ); $contents = substr( $contents, $headerSize ); if ( curl_errno( $curl ) ) { $errorNumber = curl_errno( $curl ); $errorMessage = curl_error( $curl ); curl_close( $curl ); $version = explode('.', phpversion() ); if (!$this->_skipPreviousException) { // previousException supported in php >= 5.3 $exception = new Ripcord_TransportException( 'Could not access ' . $url , ripcord::cannotAccessURL , new Exception( $errorMessage, $errorNumber ) ); } else { $exception = new Ripcord_TransportException( 'Could not access ' . $url . ' ( original CURL error: ' . $errorMessage . ' ) ', ripcord::cannotAccessURL ); } throw $exception; } curl_close($curl); return $contents; }
[ "public", "function", "post", "(", "$", "url", ",", "$", "request", ")", "{", "$", "curl", "=", "curl_init", "(", ")", ";", "$", "options", "=", "(", "array", ")", "$", "this", "->", "options", "+", "array", "(", "CURLOPT_RETURNTRANSFER", "=>", "1", ...
This method posts the request to the given url @param string $url The url to post to. @param string $request The request to post. @throws Ripcord_TransportException (ripcord::cannotAccessURL) when the given URL cannot be accessed for any reason. @return string The server response
[ "This", "method", "posts", "the", "request", "to", "the", "given", "url" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/ripcord/ripcord_client.php#L539-L576
Edujugon/laradoo
docs/cache/1.1.1/twig/6d/6d9eec98bf462b7fc80453ee1b1afafe52820a9b70b696fa11d70ad9bfd91059.php
__TwigTemplate_76dd9685d6b9d0d51cfc09278cf8a31638d8d0df6cb7321b39741a38be3d964c.block_page_content
public function block_page_content($context, array $blocks = array()) { // line 7 echo " <div class=\"page-header\"> <h1>Search</h1> </div> <p>This page allows you to search through the API documentation for specific terms. Enter your search words into the box below and click \"submit\". The search will be performed on namespaces, classes, interfaces, traits, functions, and methods.</p> <form class=\"form-inline\" role=\"form\" action=\""; // line 17 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "search.html"), "html", null, true); echo "\" method=\"GET\"> <div class=\"form-group\"> <label class=\"sr-only\" for=\"search\">Search</label> <input type=\"search\" class=\"form-control\" name=\"search\" id=\"search\" placeholder=\"Search\"> </div> <button type=\"submit\" class=\"btn btn-default\">submit</button> </form> <h2>Search Results</h2> <div class=\"container-fluid\"> <ul class=\"search-results\"></ul> </div> "; // line 31 $this->displayBlock("js_search", $context, $blocks); echo " "; }
php
public function block_page_content($context, array $blocks = array()) { // line 7 echo " <div class=\"page-header\"> <h1>Search</h1> </div> <p>This page allows you to search through the API documentation for specific terms. Enter your search words into the box below and click \"submit\". The search will be performed on namespaces, classes, interfaces, traits, functions, and methods.</p> <form class=\"form-inline\" role=\"form\" action=\""; // line 17 echo twig_escape_filter($this->env, $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForStaticFile($context, "search.html"), "html", null, true); echo "\" method=\"GET\"> <div class=\"form-group\"> <label class=\"sr-only\" for=\"search\">Search</label> <input type=\"search\" class=\"form-control\" name=\"search\" id=\"search\" placeholder=\"Search\"> </div> <button type=\"submit\" class=\"btn btn-default\">submit</button> </form> <h2>Search Results</h2> <div class=\"container-fluid\"> <ul class=\"search-results\"></ul> </div> "; // line 31 $this->displayBlock("js_search", $context, $blocks); echo " "; }
[ "public", "function", "block_page_content", "(", "$", "context", ",", "array", "$", "blocks", "=", "array", "(", ")", ")", "{", "// line 7", "echo", "\"\n <div class=\\\"page-header\\\">\n <h1>Search</h1>\n </div>\n\n <p>This page allows you to search through the ...
line 6
[ "line", "6" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/6d/6d9eec98bf462b7fc80453ee1b1afafe52820a9b70b696fa11d70ad9bfd91059.php#L47-L83
Edujugon/laradoo
docs/cache/1.1.1/twig/35/35fb9e43f5b7622609c497f0335585a7844acd2845ee9556e2d6a3984f5c69de.php
__TwigTemplate_3ce6f73803a2ff9e121a066e993528e7fa4d0e57d57fd3c80096b8013eaededd.block_page_content
public function block_page_content($context, array $blocks = array()) { // line 6 echo " <div class=\"page-header\"> <h1>Namespaces</h1> </div> "; // line 10 if ((isset($context["namespaces"]) || array_key_exists("namespaces", $context) ? $context["namespaces"] : (function () { throw new Twig_Error_Runtime('Variable "namespaces" does not exist.', 10, $this->getSourceContext()); })())) { // line 11 echo " <div class=\"namespaces clearfix\"> "; // line 12 $context["last_name"] = ""; // line 13 echo " "; $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["namespaces"]) || array_key_exists("namespaces", $context) ? $context["namespaces"] : (function () { throw new Twig_Error_Runtime('Variable "namespaces" does not exist.', 13, $this->getSourceContext()); })())); foreach ($context['_seq'] as $context["_key"] => $context["namespace"]) { // line 14 echo " "; $context["top_level"] = twig_first($this->env, twig_split_filter($this->env, $context["namespace"], "\\")); // line 15 echo " "; if (((isset($context["top_level"]) || array_key_exists("top_level", $context) ? $context["top_level"] : (function () { throw new Twig_Error_Runtime('Variable "top_level" does not exist.', 15, $this->getSourceContext()); })()) != (isset($context["last_name"]) || array_key_exists("last_name", $context) ? $context["last_name"] : (function () { throw new Twig_Error_Runtime('Variable "last_name" does not exist.', 15, $this->getSourceContext()); })()))) { // line 16 echo " "; if ((isset($context["last_name"]) || array_key_exists("last_name", $context) ? $context["last_name"] : (function () { throw new Twig_Error_Runtime('Variable "last_name" does not exist.', 16, $this->getSourceContext()); })())) { echo "</ul></div>"; } // line 17 echo " <div class=\"namespace-container\"> <h2>"; // line 18 echo (isset($context["top_level"]) || array_key_exists("top_level", $context) ? $context["top_level"] : (function () { throw new Twig_Error_Runtime('Variable "top_level" does not exist.', 18, $this->getSourceContext()); })()); echo "</h2> <ul> "; // line 20 $context["last_name"] = (isset($context["top_level"]) || array_key_exists("top_level", $context) ? $context["top_level"] : (function () { throw new Twig_Error_Runtime('Variable "top_level" does not exist.', 20, $this->getSourceContext()); })()); // line 21 echo " "; } // line 22 echo " <li><a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, $context["namespace"]); echo "\">"; echo $context["namespace"]; echo "</a></li> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['namespace'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 24 echo " </ul> </div> </div> "; } // line 28 echo " "; }
php
public function block_page_content($context, array $blocks = array()) { // line 6 echo " <div class=\"page-header\"> <h1>Namespaces</h1> </div> "; // line 10 if ((isset($context["namespaces"]) || array_key_exists("namespaces", $context) ? $context["namespaces"] : (function () { throw new Twig_Error_Runtime('Variable "namespaces" does not exist.', 10, $this->getSourceContext()); })())) { // line 11 echo " <div class=\"namespaces clearfix\"> "; // line 12 $context["last_name"] = ""; // line 13 echo " "; $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable((isset($context["namespaces"]) || array_key_exists("namespaces", $context) ? $context["namespaces"] : (function () { throw new Twig_Error_Runtime('Variable "namespaces" does not exist.', 13, $this->getSourceContext()); })())); foreach ($context['_seq'] as $context["_key"] => $context["namespace"]) { // line 14 echo " "; $context["top_level"] = twig_first($this->env, twig_split_filter($this->env, $context["namespace"], "\\")); // line 15 echo " "; if (((isset($context["top_level"]) || array_key_exists("top_level", $context) ? $context["top_level"] : (function () { throw new Twig_Error_Runtime('Variable "top_level" does not exist.', 15, $this->getSourceContext()); })()) != (isset($context["last_name"]) || array_key_exists("last_name", $context) ? $context["last_name"] : (function () { throw new Twig_Error_Runtime('Variable "last_name" does not exist.', 15, $this->getSourceContext()); })()))) { // line 16 echo " "; if ((isset($context["last_name"]) || array_key_exists("last_name", $context) ? $context["last_name"] : (function () { throw new Twig_Error_Runtime('Variable "last_name" does not exist.', 16, $this->getSourceContext()); })())) { echo "</ul></div>"; } // line 17 echo " <div class=\"namespace-container\"> <h2>"; // line 18 echo (isset($context["top_level"]) || array_key_exists("top_level", $context) ? $context["top_level"] : (function () { throw new Twig_Error_Runtime('Variable "top_level" does not exist.', 18, $this->getSourceContext()); })()); echo "</h2> <ul> "; // line 20 $context["last_name"] = (isset($context["top_level"]) || array_key_exists("top_level", $context) ? $context["top_level"] : (function () { throw new Twig_Error_Runtime('Variable "top_level" does not exist.', 20, $this->getSourceContext()); })()); // line 21 echo " "; } // line 22 echo " <li><a href=\""; echo $this->env->getExtension('Sami\Renderer\TwigExtension')->pathForNamespace($context, $context["namespace"]); echo "\">"; echo $context["namespace"]; echo "</a></li> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['namespace'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 24 echo " </ul> </div> </div> "; } // line 28 echo " "; }
[ "public", "function", "block_page_content", "(", "$", "context", ",", "array", "$", "blocks", "=", "array", "(", ")", ")", "{", "// line 6", "echo", "\" <div class=\\\"page-header\\\">\n <h1>Namespaces</h1>\n </div>\n\n \"", ";", "// line 10", "if", "(", ...
line 5
[ "line", "5" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/35/35fb9e43f5b7622609c497f0335585a7844acd2845ee9556e2d6a3984f5c69de.php#L43-L107
Edujugon/laradoo
src/Odoo.php
Odoo.connect
public function connect($db = null, $username = null, $password = null, array $array = []) { $this->db = $db ?: $this->db; $this->username = $username ?: $this->username; $this->password = $password ?: $this->password; $this->auth($this->db, $this->username, $this->password, $array); return $this; }
php
public function connect($db = null, $username = null, $password = null, array $array = []) { $this->db = $db ?: $this->db; $this->username = $username ?: $this->username; $this->password = $password ?: $this->password; $this->auth($this->db, $this->username, $this->password, $array); return $this; }
[ "public", "function", "connect", "(", "$", "db", "=", "null", ",", "$", "username", "=", "null", ",", "$", "password", "=", "null", ",", "array", "$", "array", "=", "[", "]", ")", "{", "$", "this", "->", "db", "=", "$", "db", "?", ":", "$", "...
Login to Odoo ERP. @param string $db @param string $username @param string $password @param array $array @return $this @throws OdooException
[ "Login", "to", "Odoo", "ERP", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L149-L159
Edujugon/laradoo
src/Odoo.php
Odoo.can
public function can($permission, $model, $withExceptions = false) { if (!is_array($permission)) $permission = [$permission]; $can = collect($this->object->execute_kw($this->db, $this->uid, $this->password, $model, 'check_access_rights', $permission, array('raise_exception' => $withExceptions))); return $this->makeResponse($can, 0, 'boolean'); }
php
public function can($permission, $model, $withExceptions = false) { if (!is_array($permission)) $permission = [$permission]; $can = collect($this->object->execute_kw($this->db, $this->uid, $this->password, $model, 'check_access_rights', $permission, array('raise_exception' => $withExceptions))); return $this->makeResponse($can, 0, 'boolean'); }
[ "public", "function", "can", "(", "$", "permission", ",", "$", "model", ",", "$", "withExceptions", "=", "false", ")", "{", "if", "(", "!", "is_array", "(", "$", "permission", ")", ")", "$", "permission", "=", "[", "$", "permission", "]", ";", "$", ...
Check access rights on a model. return true or a string with the error. @param string $permission @param string $model @param bool $withExceptions @return string|true
[ "Check", "access", "rights", "on", "a", "model", ".", "return", "true", "or", "a", "string", "with", "the", "error", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L171-L180
Edujugon/laradoo
src/Odoo.php
Odoo.where
public function where($field, $operator, $value = null) { if (func_num_args() === 2) $new = [$field, '=', $operator]; else $new = func_get_args(); $this->condition[0][] = $new; return $this; }
php
public function where($field, $operator, $value = null) { if (func_num_args() === 2) $new = [$field, '=', $operator]; else $new = func_get_args(); $this->condition[0][] = $new; return $this; }
[ "public", "function", "where", "(", "$", "field", ",", "$", "operator", ",", "$", "value", "=", "null", ")", "{", "if", "(", "func_num_args", "(", ")", "===", "2", ")", "$", "new", "=", "[", "$", "field", ",", "'='", ",", "$", "operator", "]", ...
Set condition for search query @param string $field @param string $operator @param string $value @return $this
[ "Set", "condition", "for", "search", "query" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L191-L201
Edujugon/laradoo
src/Odoo.php
Odoo.limit
public function limit($limit, $offset = 0) { $this->limit = $limit; $this->offset = $offset; return $this; }
php
public function limit($limit, $offset = 0) { $this->limit = $limit; $this->offset = $offset; return $this; }
[ "public", "function", "limit", "(", "$", "limit", ",", "$", "offset", "=", "0", ")", "{", "$", "this", "->", "limit", "=", "$", "limit", ";", "$", "this", "->", "offset", "=", "$", "offset", ";", "return", "$", "this", ";", "}" ]
Limit helps to only retrieve a subset of all matched records second parameter, offset to start from that value. @param int $limit @param int $offset @return $this
[ "Limit", "helps", "to", "only", "retrieve", "a", "subset", "of", "all", "matched", "records", "second", "parameter", "offset", "to", "start", "from", "that", "value", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L212-L218
Edujugon/laradoo
src/Odoo.php
Odoo.search
public function search($model) { $method = 'search'; $condition = $this->condition ?: [[]]; $params = $this->buildParams('limit', 'offset'); $result = $this->call($model, $method, $condition, $params); //Reset params for future queries. $this->resetParams('limit', 'offset', 'condition'); return $this->makeResponse($result); }
php
public function search($model) { $method = 'search'; $condition = $this->condition ?: [[]]; $params = $this->buildParams('limit', 'offset'); $result = $this->call($model, $method, $condition, $params); //Reset params for future queries. $this->resetParams('limit', 'offset', 'condition'); return $this->makeResponse($result); }
[ "public", "function", "search", "(", "$", "model", ")", "{", "$", "method", "=", "'search'", ";", "$", "condition", "=", "$", "this", "->", "condition", "?", ":", "[", "[", "]", "]", ";", "$", "params", "=", "$", "this", "->", "buildParams", "(", ...
Get the ids of the models. @param string $model @return Collection @throws OdooException
[ "Get", "the", "ids", "of", "the", "models", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L240-L254
Edujugon/laradoo
src/Odoo.php
Odoo.count
public function count($model) { $method = 'search_count'; $condition = $this->condition ?: [[]]; $result = $this->call($model, $method, $condition); //Reset params for future queries. $this->resetParams('condition'); return $this->makeResponse($result, 0); }
php
public function count($model) { $method = 'search_count'; $condition = $this->condition ?: [[]]; $result = $this->call($model, $method, $condition); //Reset params for future queries. $this->resetParams('condition'); return $this->makeResponse($result, 0); }
[ "public", "function", "count", "(", "$", "model", ")", "{", "$", "method", "=", "'search_count'", ";", "$", "condition", "=", "$", "this", "->", "condition", "?", ":", "[", "[", "]", "]", ";", "$", "result", "=", "$", "this", "->", "call", "(", "...
Count the items in a model's table. @param string $model @return integer @throws OdooException
[ "Count", "the", "items", "in", "a", "model", "s", "table", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L264-L277
Edujugon/laradoo
src/Odoo.php
Odoo.get
public function get($model) { $method = 'read'; $ids = $this->search($model); //If string it can't continue for retrieving models //Throw exception with the error. if (is_string($ids)) throw new OdooException($ids); $params = $this->buildParams('fields'); $result = $this->call($model, $method, [$ids->toArray()], $params); //Reset params for future queries. $this->resetParams('fields'); return $this->makeResponse($result); }
php
public function get($model) { $method = 'read'; $ids = $this->search($model); //If string it can't continue for retrieving models //Throw exception with the error. if (is_string($ids)) throw new OdooException($ids); $params = $this->buildParams('fields'); $result = $this->call($model, $method, [$ids->toArray()], $params); //Reset params for future queries. $this->resetParams('fields'); return $this->makeResponse($result); }
[ "public", "function", "get", "(", "$", "model", ")", "{", "$", "method", "=", "'read'", ";", "$", "ids", "=", "$", "this", "->", "search", "(", "$", "model", ")", ";", "//If string it can't continue for retrieving models", "//Throw exception with the error.", "i...
Get a list of records. @param string $model @return Collection @throws OdooException
[ "Get", "a", "list", "of", "records", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L286-L305
Edujugon/laradoo
src/Odoo.php
Odoo.version
public function version($key = null) { $urlCommon = $this->setApiEndPoint($this->commonEndPoint); $version = collect($this->getClient($urlCommon)->version()); return $this->makeResponse($version, $key); }
php
public function version($key = null) { $urlCommon = $this->setApiEndPoint($this->commonEndPoint); $version = collect($this->getClient($urlCommon)->version()); return $this->makeResponse($version, $key); }
[ "public", "function", "version", "(", "$", "key", "=", "null", ")", "{", "$", "urlCommon", "=", "$", "this", "->", "setApiEndPoint", "(", "$", "this", "->", "commonEndPoint", ")", ";", "$", "version", "=", "collect", "(", "$", "this", "->", "getClient"...
Retrieve Odoo version. If key passed it returns the key value of the collection No need authentication @param string $key @return Collection|string
[ "Retrieve", "Odoo", "version", ".", "If", "key", "passed", "it", "returns", "the", "key", "value", "of", "the", "collection", "No", "need", "authentication" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L316-L323
Edujugon/laradoo
src/Odoo.php
Odoo.fieldsOf
public function fieldsOf($model) { $method = 'fields_get'; $result = $this->call($model, $method, []); return $this->makeResponse($result); }
php
public function fieldsOf($model) { $method = 'fields_get'; $result = $this->call($model, $method, []); return $this->makeResponse($result); }
[ "public", "function", "fieldsOf", "(", "$", "model", ")", "{", "$", "method", "=", "'fields_get'", ";", "$", "result", "=", "$", "this", "->", "call", "(", "$", "model", ",", "$", "method", ",", "[", "]", ")", ";", "return", "$", "this", "->", "m...
Get a collection of fields of a model table. @param string $model @return Collection
[ "Get", "a", "collection", "of", "fields", "of", "a", "model", "table", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L331-L339
Edujugon/laradoo
src/Odoo.php
Odoo.create
public function create($model, array $data) { $method = 'create'; $result = $this->call($model, $method, [$data]); return $this->makeResponse($result, 0); }
php
public function create($model, array $data) { $method = 'create'; $result = $this->call($model, $method, [$data]); return $this->makeResponse($result, 0); }
[ "public", "function", "create", "(", "$", "model", ",", "array", "$", "data", ")", "{", "$", "method", "=", "'create'", ";", "$", "result", "=", "$", "this", "->", "call", "(", "$", "model", ",", "$", "method", ",", "[", "$", "data", "]", ")", ...
Create a single record and return its database identifier. @param string $model @param array $data @return integer
[ "Create", "a", "single", "record", "and", "return", "its", "database", "identifier", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L348-L356
Edujugon/laradoo
src/Odoo.php
Odoo.update
public function update($model, array $data) { if ($this->hasNotProvided($this->condition)) return "To prevent updating all records you must provide at least one condition. Using where method would solve this."; $method = 'write'; $ids = $this->search($model); //If string it can't continue for retrieving models //Throw exception with the error. if (is_string($ids)) throw new OdooException($ids); $result = $this->call($model, $method, [$ids->toArray(), $data]); return $this->makeResponse($result, 0); }
php
public function update($model, array $data) { if ($this->hasNotProvided($this->condition)) return "To prevent updating all records you must provide at least one condition. Using where method would solve this."; $method = 'write'; $ids = $this->search($model); //If string it can't continue for retrieving models //Throw exception with the error. if (is_string($ids)) throw new OdooException($ids); $result = $this->call($model, $method, [$ids->toArray(), $data]); return $this->makeResponse($result, 0); }
[ "public", "function", "update", "(", "$", "model", ",", "array", "$", "data", ")", "{", "if", "(", "$", "this", "->", "hasNotProvided", "(", "$", "this", "->", "condition", ")", ")", "return", "\"To prevent updating all records you must provide at least one condit...
Update one or more records. returns true except when an error happened. @param string $model @param array $data @return true|string @throws OdooException
[ "Update", "one", "or", "more", "records", ".", "returns", "true", "except", "when", "an", "error", "happened", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L367-L384
Edujugon/laradoo
src/Odoo.php
Odoo.deleteById
public function deleteById($model, $id) { if ($id instanceof Collection) $id = $id->toArray(); $method = 'unlink'; $result = $this->call($model, $method, [$id]); return $this->makeResponse($result, 0); }
php
public function deleteById($model, $id) { if ($id instanceof Collection) $id = $id->toArray(); $method = 'unlink'; $result = $this->call($model, $method, [$id]); return $this->makeResponse($result, 0); }
[ "public", "function", "deleteById", "(", "$", "model", ",", "$", "id", ")", "{", "if", "(", "$", "id", "instanceof", "Collection", ")", "$", "id", "=", "$", "id", "->", "toArray", "(", ")", ";", "$", "method", "=", "'unlink'", ";", "$", "result", ...
Remove a record by Id or Ids. returns true except when an error happened. @param string $model @param array|Collection|int $id @return true|string
[ "Remove", "a", "record", "by", "Id", "or", "Ids", ".", "returns", "true", "except", "when", "an", "error", "happened", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L394-L404
Edujugon/laradoo
src/Odoo.php
Odoo.delete
public function delete($model) { if ($this->hasNotProvided($this->condition)) return "To prevent deleting all records you must provide at least one condition. Using where method would solve this."; $ids = $this->search($model); //If string it can't continue for retrieving models //Throw exception with the error. if (is_string($ids)) throw new OdooException($ids); return $this->deleteById($model, $ids); }
php
public function delete($model) { if ($this->hasNotProvided($this->condition)) return "To prevent deleting all records you must provide at least one condition. Using where method would solve this."; $ids = $this->search($model); //If string it can't continue for retrieving models //Throw exception with the error. if (is_string($ids)) throw new OdooException($ids); return $this->deleteById($model, $ids); }
[ "public", "function", "delete", "(", "$", "model", ")", "{", "if", "(", "$", "this", "->", "hasNotProvided", "(", "$", "this", "->", "condition", ")", ")", "return", "\"To prevent deleting all records you must provide at least one condition. Using where method would solve...
Remove one or a group of records. returns true except when an error happened. @param string $model @return true|string @throws OdooException
[ "Remove", "one", "or", "a", "group", "of", "records", ".", "returns", "true", "except", "when", "an", "error", "happened", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L414-L427
Edujugon/laradoo
src/Odoo.php
Odoo.call
public function call($params) { //Prevent user forgetting connect with the ERP. $this->autoConnect(); $args = array_merge( [$this->db, $this->uid, $this->password], func_get_args() ); return collect(call_user_func_array([$this->object,'execute_kw'], $args)); }
php
public function call($params) { //Prevent user forgetting connect with the ERP. $this->autoConnect(); $args = array_merge( [$this->db, $this->uid, $this->password], func_get_args() ); return collect(call_user_func_array([$this->object,'execute_kw'], $args)); }
[ "public", "function", "call", "(", "$", "params", ")", "{", "//Prevent user forgetting connect with the ERP.", "$", "this", "->", "autoConnect", "(", ")", ";", "$", "args", "=", "array_merge", "(", "[", "$", "this", "->", "db", ",", "$", "this", "->", "uid...
Run execute_kw call with provided params. @param $params @return Collection
[ "Run", "execute_kw", "call", "with", "provided", "params", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L435-L446
Edujugon/laradoo
src/Odoo.php
Odoo.auth
private function auth($db, $username, $password, array $array = []) { //Prepare urls for different clients $urlCommon = $this->setApiEndPoint($this->commonEndPoint); $urlActions = $this->setApiEndPoint($this->objectEndPoint); //Assign clients by type $this->common = $this->getClient($urlCommon); $this->object = $this->getClient($urlActions); $this->uid = $this->common->authenticate($db, $username, $password, $array); if (!is_int($this->uid)) { if (is_array($this->uid) && array_key_exists('faultCode', $this->uid)) throw new OdooException($this->uid['faultCode']); else throw new OdooException('Unsuccessful Authorization'); } }
php
private function auth($db, $username, $password, array $array = []) { //Prepare urls for different clients $urlCommon = $this->setApiEndPoint($this->commonEndPoint); $urlActions = $this->setApiEndPoint($this->objectEndPoint); //Assign clients by type $this->common = $this->getClient($urlCommon); $this->object = $this->getClient($urlActions); $this->uid = $this->common->authenticate($db, $username, $password, $array); if (!is_int($this->uid)) { if (is_array($this->uid) && array_key_exists('faultCode', $this->uid)) throw new OdooException($this->uid['faultCode']); else throw new OdooException('Unsuccessful Authorization'); } }
[ "private", "function", "auth", "(", "$", "db", ",", "$", "username", ",", "$", "password", ",", "array", "$", "array", "=", "[", "]", ")", "{", "//Prepare urls for different clients", "$", "urlCommon", "=", "$", "this", "->", "setApiEndPoint", "(", "$", ...
Authenticate into Odoo ERP. @param $db @param $username @param $password @param array $array @throws OdooException
[ "Authenticate", "into", "Odoo", "ERP", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L621-L640
Edujugon/laradoo
src/Odoo.php
Odoo.setApiEndPoint
private function setApiEndPoint($endPoint) { if (empty($this->host)) throw new OdooException('You must provide the odoo host by host setter method'); return $this->host . $this->suffix . $endPoint; }
php
private function setApiEndPoint($endPoint) { if (empty($this->host)) throw new OdooException('You must provide the odoo host by host setter method'); return $this->host . $this->suffix . $endPoint; }
[ "private", "function", "setApiEndPoint", "(", "$", "endPoint", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "host", ")", ")", "throw", "new", "OdooException", "(", "'You must provide the odoo host by host setter method'", ")", ";", "return", "$", "this"...
Set the Full API endpoint @param string $endPoint @return string @throws OdooException OdooException
[ "Set", "the", "Full", "API", "endpoint" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L650-L657
Edujugon/laradoo
src/Odoo.php
Odoo.resetParams
private function resetParams($params) { $keys = is_array($params) ? $params : func_get_args(); foreach ($keys as $key) { if (property_exists($this, $key)) $this->$key = null; } }
php
private function resetParams($params) { $keys = is_array($params) ? $params : func_get_args(); foreach ($keys as $key) { if (property_exists($this, $key)) $this->$key = null; } }
[ "private", "function", "resetParams", "(", "$", "params", ")", "{", "$", "keys", "=", "is_array", "(", "$", "params", ")", "?", "$", "params", ":", "func_get_args", "(", ")", ";", "foreach", "(", "$", "keys", "as", "$", "key", ")", "{", "if", "(", ...
Reset extra data to base values @param $params
[ "Reset", "extra", "data", "to", "base", "values" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L664-L672
Edujugon/laradoo
src/Odoo.php
Odoo.buildParams
private function buildParams($params) { $keys = is_array($params) ? $params : func_get_args(); $array = []; foreach ($keys as $key) { if (property_exists($this, $key)) $array = array_merge($array, [$key => $this->$key]); } return $array; }
php
private function buildParams($params) { $keys = is_array($params) ? $params : func_get_args(); $array = []; foreach ($keys as $key) { if (property_exists($this, $key)) $array = array_merge($array, [$key => $this->$key]); } return $array; }
[ "private", "function", "buildParams", "(", "$", "params", ")", "{", "$", "keys", "=", "is_array", "(", "$", "params", ")", "?", "$", "params", ":", "func_get_args", "(", ")", ";", "$", "array", "=", "[", "]", ";", "foreach", "(", "$", "keys", "as",...
Create an array based on the passed keys. Those keys are properties of this class. @param $params @return array @internal param $keys
[ "Create", "an", "array", "based", "on", "the", "passed", "keys", ".", "Those", "keys", "are", "properties", "of", "this", "class", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L682-L694
Edujugon/laradoo
src/Odoo.php
Odoo.makeResponse
private function makeResponse($result, $key = null, $cast = null) { if (array_key_exists('faultCode', $result->toArray())) return $result['faultCode']; if (!is_null($key) && array_key_exists($key, $result->toArray())) $result = $result->get($key); if ($cast) settype($result, $cast); return $result; }
php
private function makeResponse($result, $key = null, $cast = null) { if (array_key_exists('faultCode', $result->toArray())) return $result['faultCode']; if (!is_null($key) && array_key_exists($key, $result->toArray())) $result = $result->get($key); if ($cast) settype($result, $cast); return $result; }
[ "private", "function", "makeResponse", "(", "$", "result", ",", "$", "key", "=", "null", ",", "$", "cast", "=", "null", ")", "{", "if", "(", "array_key_exists", "(", "'faultCode'", ",", "$", "result", "->", "toArray", "(", ")", ")", ")", "return", "$...
Prepare the api response. If there is a faultCode then return its value. If key passed, returns the value of that key. Otherwise return the provided data. @param Collection $result @param string $key @param null $cast Cast returned data based on this param. @return mixed
[ "Prepare", "the", "api", "response", ".", "If", "there", "is", "a", "faultCode", "then", "return", "its", "value", ".", "If", "key", "passed", "returns", "the", "value", "of", "that", "key", ".", "Otherwise", "return", "the", "provided", "data", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L707-L718
Edujugon/laradoo
src/Odoo.php
Odoo.loadConfigData
private function loadConfigData() { //Load config data $config = laradooConfig(); $this->suffix = array_key_exists('api-suffix', $config) ? $config['api-suffix'] : $this->suffix; $this->suffix = laradooAddCharacter($this->suffix, '/'); $this->host = array_key_exists('host', $config) ? $config['host'] : $this->host; $this->host = laradooRemoveCharacter($this->host, '/'); $this->db = array_key_exists('db', $config) ? $config['db'] : $this->db; $this->username = array_key_exists('username', $config) ? $config['username'] : $this->username; $this->password = array_key_exists('password', $config) ? $config['password'] : $this->password; }
php
private function loadConfigData() { //Load config data $config = laradooConfig(); $this->suffix = array_key_exists('api-suffix', $config) ? $config['api-suffix'] : $this->suffix; $this->suffix = laradooAddCharacter($this->suffix, '/'); $this->host = array_key_exists('host', $config) ? $config['host'] : $this->host; $this->host = laradooRemoveCharacter($this->host, '/'); $this->db = array_key_exists('db', $config) ? $config['db'] : $this->db; $this->username = array_key_exists('username', $config) ? $config['username'] : $this->username; $this->password = array_key_exists('password', $config) ? $config['password'] : $this->password; }
[ "private", "function", "loadConfigData", "(", ")", "{", "//Load config data", "$", "config", "=", "laradooConfig", "(", ")", ";", "$", "this", "->", "suffix", "=", "array_key_exists", "(", "'api-suffix'", ",", "$", "config", ")", "?", "$", "config", "[", "...
Load data from config file.
[ "Load", "data", "from", "config", "file", "." ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/src/Odoo.php#L723-L738
Edujugon/laradoo
docs/cache/1.1.1/twig/1e/1e2f0a1618dd9fe62176bfe39961717f07184ba591d447729d1dff81d11ffb0c.php
__TwigTemplate_ea3e599f9a1fa64a525c9c39db3fa418c46acca48a9be27f93437ff01bba6e57.block_class_signature
public function block_class_signature($context, array $blocks = array()) { // line 77 if (( !twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 77, $this->getSourceContext()); })()), "interface", array()) && twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 77, $this->getSourceContext()); })()), "abstract", array()))) { echo "abstract "; } // line 78 echo " "; echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 78, $this->getSourceContext()); })()), "categoryName", array()); echo " <strong>"; // line 79 echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 79, $this->getSourceContext()); })()), "shortname", array()); echo "</strong>"; // line 80 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 80, $this->getSourceContext()); })()), "parent", array())) { // line 81 echo " extends "; echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_class_link(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 81, $this->getSourceContext()); })()), "parent", array())); } // line 83 if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 83, $this->getSourceContext()); })()), "interfaces", array())) > 0)) { // line 84 echo " implements "; // line 85 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 85, $this->getSourceContext()); })()), "interfaces", array())); $context['loop'] = array( 'parent' => $context['_parent'], 'index0' => 0, 'index' => 1, 'first' => true, ); if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) { $length = count($context['_seq']); $context['loop']['revindex0'] = $length - 1; $context['loop']['revindex'] = $length; $context['loop']['length'] = $length; $context['loop']['last'] = 1 === $length; } foreach ($context['_seq'] as $context["_key"] => $context["interface"]) { // line 86 echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_class_link($context["interface"]); // line 87 if ( !twig_get_attribute($this->env, $this->getSourceContext(), $context["loop"], "last", array())) { echo ", "; } ++$context['loop']['index0']; ++$context['loop']['index']; $context['loop']['first'] = false; if (isset($context['loop']['length'])) { --$context['loop']['revindex0']; --$context['loop']['revindex']; $context['loop']['last'] = 0 === $context['loop']['revindex0']; } } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['interface'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; } // line 90 echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_source_link((isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 90, $this->getSourceContext()); })()), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 90, $this->getSourceContext()); })())); echo " "; }
php
public function block_class_signature($context, array $blocks = array()) { // line 77 if (( !twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 77, $this->getSourceContext()); })()), "interface", array()) && twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 77, $this->getSourceContext()); })()), "abstract", array()))) { echo "abstract "; } // line 78 echo " "; echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 78, $this->getSourceContext()); })()), "categoryName", array()); echo " <strong>"; // line 79 echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 79, $this->getSourceContext()); })()), "shortname", array()); echo "</strong>"; // line 80 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 80, $this->getSourceContext()); })()), "parent", array())) { // line 81 echo " extends "; echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_class_link(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 81, $this->getSourceContext()); })()), "parent", array())); } // line 83 if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 83, $this->getSourceContext()); })()), "interfaces", array())) > 0)) { // line 84 echo " implements "; // line 85 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 85, $this->getSourceContext()); })()), "interfaces", array())); $context['loop'] = array( 'parent' => $context['_parent'], 'index0' => 0, 'index' => 1, 'first' => true, ); if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) { $length = count($context['_seq']); $context['loop']['revindex0'] = $length - 1; $context['loop']['revindex'] = $length; $context['loop']['length'] = $length; $context['loop']['last'] = 1 === $length; } foreach ($context['_seq'] as $context["_key"] => $context["interface"]) { // line 86 echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_class_link($context["interface"]); // line 87 if ( !twig_get_attribute($this->env, $this->getSourceContext(), $context["loop"], "last", array())) { echo ", "; } ++$context['loop']['index0']; ++$context['loop']['index']; $context['loop']['first'] = false; if (isset($context['loop']['length'])) { --$context['loop']['revindex0']; --$context['loop']['revindex']; $context['loop']['last'] = 0 === $context['loop']['revindex0']; } } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['interface'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; } // line 90 echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_source_link((isset($context["project"]) || array_key_exists("project", $context) ? $context["project"] : (function () { throw new Twig_Error_Runtime('Variable "project" does not exist.', 90, $this->getSourceContext()); })()), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 90, $this->getSourceContext()); })())); echo " "; }
[ "public", "function", "block_class_signature", "(", "$", "context", ",", "array", "$", "blocks", "=", "array", "(", ")", ")", "{", "// line 77", "if", "(", "(", "!", "twig_get_attribute", "(", "$", "this", "->", "env", ",", "$", "this", "->", "getSourceC...
line 76
[ "line", "76" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1e/1e2f0a1618dd9fe62176bfe39961717f07184ba591d447729d1dff81d11ffb0c.php#L224-L289
Edujugon/laradoo
docs/cache/1.1.1/twig/1e/1e2f0a1618dd9fe62176bfe39961717f07184ba591d447729d1dff81d11ffb0c.php
__TwigTemplate_ea3e599f9a1fa64a525c9c39db3fa418c46acca48a9be27f93437ff01bba6e57.block_method_signature
public function block_method_signature($context, array $blocks = array()) { // line 94 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 94, $this->getSourceContext()); })()), "final", array())) { echo "final"; } // line 95 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 95, $this->getSourceContext()); })()), "abstract", array())) { echo "abstract"; } // line 96 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 96, $this->getSourceContext()); })()), "static", array())) { echo "static"; } // line 97 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 97, $this->getSourceContext()); })()), "protected", array())) { echo "protected"; } // line 98 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 98, $this->getSourceContext()); })()), "private", array())) { echo "private"; } // line 99 echo " "; echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_hint_link(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 99, $this->getSourceContext()); })()), "hint", array())); echo " <strong>"; // line 100 echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 100, $this->getSourceContext()); })()), "name", array()); echo "</strong>"; $this->displayBlock("method_parameters_signature", $context, $blocks); }
php
public function block_method_signature($context, array $blocks = array()) { // line 94 if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 94, $this->getSourceContext()); })()), "final", array())) { echo "final"; } // line 95 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 95, $this->getSourceContext()); })()), "abstract", array())) { echo "abstract"; } // line 96 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 96, $this->getSourceContext()); })()), "static", array())) { echo "static"; } // line 97 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 97, $this->getSourceContext()); })()), "protected", array())) { echo "protected"; } // line 98 echo " "; if (twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 98, $this->getSourceContext()); })()), "private", array())) { echo "private"; } // line 99 echo " "; echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_hint_link(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 99, $this->getSourceContext()); })()), "hint", array())); echo " <strong>"; // line 100 echo twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 100, $this->getSourceContext()); })()), "name", array()); echo "</strong>"; $this->displayBlock("method_parameters_signature", $context, $blocks); }
[ "public", "function", "block_method_signature", "(", "$", "context", ",", "array", "$", "blocks", "=", "array", "(", ")", ")", "{", "// line 94", "if", "(", "twig_get_attribute", "(", "$", "this", "->", "env", ",", "$", "this", "->", "getSourceContext", "(...
line 93
[ "line", "93" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1e/1e2f0a1618dd9fe62176bfe39961717f07184ba591d447729d1dff81d11ffb0c.php#L292-L327
Edujugon/laradoo
docs/cache/1.1.1/twig/1e/1e2f0a1618dd9fe62176bfe39961717f07184ba591d447729d1dff81d11ffb0c.php
__TwigTemplate_ea3e599f9a1fa64a525c9c39db3fa418c46acca48a9be27f93437ff01bba6e57.block_method_parameters_signature
public function block_method_parameters_signature($context, array $blocks = array()) { // line 104 $context["__internal_5601675ec17688ab2e0d97adc44983d98054ccb21b48d9f39c4ed374190fd0c2"] = $this->loadTemplate("macros.twig", "class.twig", 104); // line 105 echo $context["__internal_5601675ec17688ab2e0d97adc44983d98054ccb21b48d9f39c4ed374190fd0c2"]->macro_method_parameters_signature((isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 105, $this->getSourceContext()); })())); echo " "; // line 106 echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_deprecated((isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 106, $this->getSourceContext()); })())); }
php
public function block_method_parameters_signature($context, array $blocks = array()) { // line 104 $context["__internal_5601675ec17688ab2e0d97adc44983d98054ccb21b48d9f39c4ed374190fd0c2"] = $this->loadTemplate("macros.twig", "class.twig", 104); // line 105 echo $context["__internal_5601675ec17688ab2e0d97adc44983d98054ccb21b48d9f39c4ed374190fd0c2"]->macro_method_parameters_signature((isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 105, $this->getSourceContext()); })())); echo " "; // line 106 echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_deprecated((isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 106, $this->getSourceContext()); })())); }
[ "public", "function", "block_method_parameters_signature", "(", "$", "context", ",", "array", "$", "blocks", "=", "array", "(", ")", ")", "{", "// line 104", "$", "context", "[", "\"__internal_5601675ec17688ab2e0d97adc44983d98054ccb21b48d9f39c4ed374190fd0c2\"", "]", "=", ...
line 103
[ "line", "103" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1e/1e2f0a1618dd9fe62176bfe39961717f07184ba591d447729d1dff81d11ffb0c.php#L330-L340
Edujugon/laradoo
docs/cache/1.1.1/twig/1e/1e2f0a1618dd9fe62176bfe39961717f07184ba591d447729d1dff81d11ffb0c.php
__TwigTemplate_ea3e599f9a1fa64a525c9c39db3fa418c46acca48a9be27f93437ff01bba6e57.block_parameters
public function block_parameters($context, array $blocks = array()) { // line 110 echo " <table class=\"table table-condensed\"> "; // line 111 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 111, $this->getSourceContext()); })()), "parameters", array())); foreach ($context['_seq'] as $context["_key"] => $context["parameter"]) { // line 112 echo " <tr> <td>"; // line 113 if (twig_get_attribute($this->env, $this->getSourceContext(), $context["parameter"], "hint", array())) { echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_hint_link(twig_get_attribute($this->env, $this->getSourceContext(), $context["parameter"], "hint", array())); } echo "</td> <td>\$"; // line 114 echo twig_get_attribute($this->env, $this->getSourceContext(), $context["parameter"], "name", array()); echo "</td> <td>"; // line 115 echo $this->env->getExtension('Sami\Renderer\TwigExtension')->parseDesc($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["parameter"], "shortdesc", array()), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 115, $this->getSourceContext()); })())); echo "</td> </tr> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['parameter'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 118 echo " </table> "; }
php
public function block_parameters($context, array $blocks = array()) { // line 110 echo " <table class=\"table table-condensed\"> "; // line 111 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->getSourceContext(), (isset($context["method"]) || array_key_exists("method", $context) ? $context["method"] : (function () { throw new Twig_Error_Runtime('Variable "method" does not exist.', 111, $this->getSourceContext()); })()), "parameters", array())); foreach ($context['_seq'] as $context["_key"] => $context["parameter"]) { // line 112 echo " <tr> <td>"; // line 113 if (twig_get_attribute($this->env, $this->getSourceContext(), $context["parameter"], "hint", array())) { echo $context["__internal_bcc9cc3629ca6471acc508322f3ab0a7c21ca6dda07f27cbbbdd260817d542d5"]->macro_hint_link(twig_get_attribute($this->env, $this->getSourceContext(), $context["parameter"], "hint", array())); } echo "</td> <td>\$"; // line 114 echo twig_get_attribute($this->env, $this->getSourceContext(), $context["parameter"], "name", array()); echo "</td> <td>"; // line 115 echo $this->env->getExtension('Sami\Renderer\TwigExtension')->parseDesc($context, twig_get_attribute($this->env, $this->getSourceContext(), $context["parameter"], "shortdesc", array()), (isset($context["class"]) || array_key_exists("class", $context) ? $context["class"] : (function () { throw new Twig_Error_Runtime('Variable "class" does not exist.', 115, $this->getSourceContext()); })())); echo "</td> </tr> "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['parameter'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 118 echo " </table> "; }
[ "public", "function", "block_parameters", "(", "$", "context", ",", "array", "$", "blocks", "=", "array", "(", ")", ")", "{", "// line 110", "echo", "\" <table class=\\\"table table-condensed\\\">\n \"", ";", "// line 111", "$", "context", "[", "'_parent'", ...
line 109
[ "line", "109" ]
train
https://github.com/Edujugon/laradoo/blob/e198e1303cc1339507f65db418f0b602f76c64e2/docs/cache/1.1.1/twig/1e/1e2f0a1618dd9fe62176bfe39961717f07184ba591d447729d1dff81d11ffb0c.php#L343-L377