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 | |
namespace Typhoon\Type; | |
class StringTest extends \Typhoon\Test\TypeTestCase | |
{ | |
protected function typeFixture() | |
{ | |
return new String; | |
} |
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 | |
namespace Typhoon\Exception; | |
use Typhoon\Primitive\String; | |
use Typhoon\Test\ExceptionTestCase; | |
class ExceptionTest extends ExceptionTestCase | |
{ | |
/** |
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 | |
namespace Foo; | |
use Bar\Baz\Qux; | |
use Bar\Baz\Splat; | |
class Donk | |
{ | |
public function foo(Qux $qux) {} |
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
#!/usr/bin/env php | |
<?php | |
$paths = array(); | |
if (isset($_SERVER['argv'])) | |
{ | |
$paths = $_SERVER['argv']; | |
array_shift($paths); | |
if (!$paths) |
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 | |
// Example of how the Primitive class is extended | |
class Boolean extends Primitive | |
{ | |
public function assert($value) | |
{ | |
if (!is_bool($value)) throw new InvalidArgumentException; | |
} |
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 LCSTest extends PHPUnit_Framework_TestCase | |
{ | |
/** | |
* Returns the longest common subsequence of two arrays. | |
* | |
* @link http://en.wikipedia.org/wiki/Longest_common_subsequence_problem | |
* | |
* @param array $left The first array. |
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 | |
/** | |
* Copyright © 2011 Erin Millard | |
*/ | |
/** | |
* Returns the number of available CPU cores | |
* | |
* Should work for Linux, Windows, Mac & BSD |
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 | |
/** | |
* My awesome function that does amazing things | |
*/ | |
function doSomeAwesomeStuff($foo) | |
{ | |
// creating a custom type for the foo attribute | |
// passing some special matcher object which does the validation work | |
$fooType = new CustomType(array( |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Sudoku layout</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<style type="text/css"> | |
/* change font size to change scale */ | |
.sudoku-grid { | |
font-size: 24px; |
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 | |
// VALIDATORS | |
/** | |
* Stores validation error messages. | |
*/ | |
class ErrorData | |
{ | |
/** |
OlderNewer