Skip to content

Instantly share code, notes, and snippets.

View RufusTJohnson's full-sized avatar

RufusTJohnson

View GitHub Profile
@RufusTJohnson
RufusTJohnson / php-cs-fixer.php
Created August 7, 2018 03:03
File to run friendsofphp/php-cs-fixer From Code
<?php
/*
* Thanks to Fabien Potencier and Dariusz Rumiński for the original version of this file which I have modified
* to run friendsofphp/php-cs-fixer from code.
*
* (c) Fabien Potencier <fabien@symfony.com>
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
*
* This source file is subject to the MIT license that is bundled
@RufusTJohnson
RufusTJohnson / whoops Handler.php
Created July 30, 2018 02:49
whoops Handler.php -- Part of a demonstration how namespaces allow multiple declarations of the same class name
<?php
// Credit to https://github.com/filp/whoops
/**
* Whoops - php errors for cool kids
* @author Filipe Dobreira
*/
namespace Whoops\Handler;
use Whoops\Exception\Inspector;
use Whoops\RunInterface;
/**
@RufusTJohnson
RufusTJohnson / bugsnag Handler.php
Created July 30, 2018 02:46
bugsnag Handler.php -- Part of a demonstration how namespaces allow multiple declarations of the same class name
<?php
// Credit to https://github.com/bugsnag/bugsnag-php
namespace Bugsnag;
class Handler
{
@RufusTJohnson
RufusTJohnson / NameSpaceTest.php
Last active August 1, 2018 03:37
Demonstrate How Namespaces Affect Fully Qualified Classnames
<?php
namespace This\Is\A\Long\Name_Space;
echo '<span style="text-decoration: underline;">Demo the effect of namespaces on fully qualified class names</span>';
class handler{}
// Post the fully qualified name of the handler class defined in this namespace
echo "<br><br><HR>".handler::class."<br>";
namespace Short\Name_Space;
class handler{}
// Post the fully qualified name of the handler class defined in this namespace