- Query what source code files exist in the codebase
- Query what classes/traits/interfaces exist. eg. $index->getClasses() returns fully qualified list of class names
- Query what functions exist. eg. $index->getFunctions() returns fully qualified list of function names
- On a class/trait/interface can find what methods/properties/constants exist
- On a class/interface can inspect the parent class/interface
- On a class/trait inspect what interfaces are implemented
- For a class find subclasses
- For a trait find trait usages
- For an interface find class/traits that implement the interface
- For an interface find interfaces which extend it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function($) { | |
function Tooltip(elem, conf) { | |
// Create tooltip | |
var tooltip = $('<div></div>') | |
.addClass(conf.className) | |
.html(elem.attr('title')) | |
.insertAfter(elem); | |
tooltip.hide(); | |
// Remove the browser tooltip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function object_to_array($data, $visited = array()) { | |
if (!is_array($data) and !is_object($data)) { | |
return $data; | |
} | |
if (is_object($data)) { | |
// Detect object cycles, overwise recursion occurs. | |
$hash = spl_object_hash($data); | |
if (isset($visited[$hash])) { | |
return '** RECURSION **'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Root directory of Drupal installation. | |
*/ | |
define('DRUPAL_ROOT', getcwd()); | |
$_SERVER['REMOTE_ADDR'] = '127.0.0.1'; | |
require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Dep { | |
protected $name; | |
protected $dependencies = []; | |
public function __construct($name) { | |
$this->name = $name; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Behat\Mink\Mink; | |
use Behat\Mink\Selector\CssSelector; | |
use Behat\Mink\Session; | |
use Behat\Mink\Element\Element; | |
use Behat\Mink\Element\NodeElement; | |
abstract class BrowserTestCase extends PHPUnit_Framework_TestCase { | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
/** | |
* High performance Vector library. | |
* | |
* Constructing vectors is expensive and therefore these functions take | |
* the required operands and a parameter to output the result into. | |
*/ | |
var Vector = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function argToString($arg, $maxLength = false) { | |
if (is_null($arg)) { | |
return 'null'; | |
} elseif (is_array($arg)) { | |
return 'Array'; | |
} elseif (is_object($arg)) { | |
return 'Object(' . get_class($arg) . ')'; | |
} elseif (is_bool($arg)) { | |
return $arg ? 'true' : 'false'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Alters a multi search query to add node access checks. | |
* | |
* @param SearchApiMultiQueryInterface $query | |
* The executed search query. | |
*/ | |
function hook_search_api_multi_query_alter(SearchApiMultiQueryInterface $query) { | |
global $user; | |
$indexes = $query->getIndexes(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
// Import the Pharborist classes | |
use Pharborist\Filter; | |
use Pharborist\Node; | |
use Pharborist\Parser; | |
use Pharborist\TokenNode; | |
use Pharborist\TopNode; |