Skip to content

Instantly share code, notes, and snippets.

View manuelpichler's full-sized avatar

Manuel Pichler manuelpichler

View GitHub Profile
@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
<?php
trait A {
function f( ) {
return __METHOD__;
}
}
class C {
use A {
<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>
@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
@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)
{
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?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
<?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';