Skip to content

Instantly share code, notes, and snippets.

Jeff Welch whatthejeff

Block or report user

Report or block whatthejeff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View phpunit-3.7-vs-4.0.php
<?php
// PHPUnit 3.7
$mock->expects($this->any())->method('doSomething')->will($this->returnValue('something'))
// PHPUnit 4.0
$mock->method('doSomething')->willReturn('something');
@whatthejeff
whatthejeff / .travis.yml
Created Aug 18, 2013
.travis.yaml for PHP extensions
View .travis.yml
language: php
php:
- 5.3
- 5.4
- 5.5
before_script:
- phpize
- ./configure --enable-EXTENSION_NAME
@whatthejeff
whatthejeff / missing-modifiers.diff
Last active Dec 18, 2015
Added modifiers for a number of PHP methods.
View missing-modifiers.diff
Index: en/reference/spl/splheap/current.xml
===================================================================
--- en/reference/spl/splheap/current.xml (revision 330515)
+++ en/reference/spl/splheap/current.xml (working copy)
@@ -9,7 +9,7 @@
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
- <type>mixed</type><methodname>SplHeap::current</methodname>
+ <modifier>public</modifier> <type>mixed</type><methodname>SplHeap::current</methodname>
@whatthejeff
whatthejeff / errors.php
Created May 15, 2013
PHP's error constants
View errors.php
<?php
$errors = [
'E_ERROR',
'E_WARNING',
'E_PARSE',
'E_NOTICE',
'E_CORE_ERROR',
'E_CORE_WARNING',
'E_COMPILE_ERROR',
@whatthejeff
whatthejeff / composer.json
Created Mar 8, 2013
Autoloading PEAR packages with composer.
View composer.json
{
"require": {
"pear-pear/pear": "1.9.4",
"pear-pear/Mail_Mime": "1.8.7"
},
"repositories": [
{
"type": "pear",
"url": "http://pear.php.net"
}
You can’t perform that action at this time.