Skip to content

Instantly share code, notes, and snippets.

View manuelpichler's full-sized avatar

Manuel Pichler manuelpichler

View GitHub Profile
<?php
// set up include path
set_include_path(realpath(__DIR__ . '/../pflow/lib/') . PATH_SEPARATOR . get_include_path() . PATH_SEPARATOR);
require_once 'staticReflection/Autoloader.php';
spl_autoload_register(array(new org\pdepend\reflection\Autoloader, 'autoload'));
require_once 'ReflectionFileSetQuery.php';
<?php
/**
* This file is part of the static reflection component.
*
* PHP Version 5
*
* Copyright (c) 2008-2009, Manuel Pichler <mapi@pdepend.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
<?php
/**
* This file is part of the static reflection component.
*
* PHP Version 5
*
* Copyright (c) 2008-2009, Manuel Pichler <mapi@pdepend.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@manuelpichler
manuelpichler / gist:1393734
Created November 25, 2011 15:08
Detecting super globals
...
private $_superGlobals = array(
'$GLOBALS',
'$_SERVER',
'$_GET',
...
);
public function apply(PHP_PMD_AbstractNode $node)
{
@manuelpichler
manuelpichler / ugly_nowdoc.php
Created November 29, 2011 16:03
PHP is such an ugly language
<?php
class MyClass
{
static function myMethod(
$x = <<<'FOO'
Hello
FOO
, $y = <<<'BAR'
PHP_Depend
BAR
<response>
<document.id>42</document.id>
<document.name>Foo</document.name>
<document.desc>Foo Foo Foo Foo</document.desc>
<document.mail>foo@bar.de</document.mail>
<response>
<?php
trait A {
function f( ) {
return __METHOD__;
}
}
class C {
use A {
@manuelpichler
manuelpichler / gist:1830473
Created February 14, 2012 21:10
PHP_Depend 1.0.1 vs 1.0.x
Just type:
~ $ pear upgrade pdepend/PHP_Depend-snapshot
to test the latest, memory&performance optimized version of PHP_Depend.
Symfony2 Standard (All vendor code) - NCLOC(286749)
===================================================
PHP 5.3.10
@manuelpichler
manuelpichler / gist:1852825
Created February 17, 2012 11:29
PHP_Depend max nesting configuration
<?xml version="1.0"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://pdepend.org/schema/configuration"
xsi:schemaLocation="http://pdepend.org/schema/configuration http://pdepend.org/schema/1.0/configuration.xsd">
<parser>
<nesting>423</nesting>
</parser>
</configuration>