This file contains 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 | |
/** | |
* Kohana_Sniffs_Classes_OpeningBraceBsdAllmanSniff. | |
* | |
* PHP version 5 | |
* | |
* @category PHP | |
* @package PHP_CodeSniffer | |
* @author Greg Sherwood <gsherwood@squiz.net> | |
* @author Marc McIntyre <mmcintyre@squiz.net> |
This file contains 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 | |
error_reporting(E_ALL | E_STRICT); | |
$array = array(); | |
$var = 5; | |
$array[0] =& $var; | |
// visible reference |
This file contains 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 | |
/** | |
* Wrapper around PHP's procedural API | |
*/ | |
class Kohana_cURL | |
{ | |
public static function factory(string $url = NULL) | |
{ | |
// Raises E_WARNING upon error |
This file contains 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
#!/bin/sh | |
# | |
patch=$( mktemp .tmp.git.XXXXXX ) | |
git diff --ignore-space-at-eol $@ > $patch | |
if [ $? -eq 0 ]; then | |
# detect EOF change |
This file contains 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 Cbandy_Test extends PHPUnit_Framework_TestCase | |
{ | |
public function test_case() | |
{ | |
// PHPUnit 3.4.13, 1 error | |
UNDEF_CONST; | |
} | |
} |
This file contains 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 | |
xdebug_start_code_coverage(XDEBUG_CC_UNUSED); | |
class MyClass | |
{ | |
} | |
print_r(xdebug_get_code_coverage()); |
This file contains 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 | |
xdebug_start_code_coverage(XDEBUG_CC_UNUSED); | |
! (0 === 1) | |
; | |
print_r(xdebug_get_code_coverage()); |
This file contains 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
-- CREATE TABLE kohana_test_table (id integer PRIMARY KEY, value integer) | |
-- MS SQL Server, PostgreSQL, SQLite: conditional insert | |
INSERT INTO kohana_test_table (id, value) | |
SELECT 10, 100 | |
WHERE NOT EXISTS | |
(SELECT 1 FROM kohana_test_table WHERE id = 10) | |
-- MySQL: conditional insert | |
INSERT INTO kohana_test_table (id, value) |
This file contains 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 defined('SYSPATH') or die('No direct script access.'); | |
/** | |
* Non-persistent, in-memory implementation of [Kohana Cache](api/Kohana_Cache). | |
* | |
* @package Kohana/Cache | |
* @category Base | |
* @author Kohana Team | |
* @copyright (c) 2011 Kohana Team | |
* @license http://kohanaphp.com/license |
This file contains 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 | |
xdebug_start_code_coverage(XDEBUG_CC_UNUSED); | |
class c { function f() {} function __construct() { | |
$this->f( | |
empty($var) | |
? 1 | |
: 2 | |
); |
OlderNewer