Example #1
0
 public function testOptionHelpers()
 {
     $this->assertInstanceOf(Option\Some::class, some($this->initialValue));
     $this->assertInstanceOf(Option\None::class, none());
     $this->assertInstanceOf(Option\Some::class, wrap($this->initialValue, $this->alternativeValue));
     $this->assertInstanceOf(Option\None::class, wrap($this->initialValue, $this->initialValue));
 }
Example #2
0
/**
 * @param          $value
 * @param callable $callback
 *
 * @return Optional
 */
function maybe($value, callable $callback = null) : Optional
{
    $callback = $callback ?? 'Dgame\\Optional\\verify';
    if ($callback($value)) {
        return some($value);
    }
    return none();
}
Example #3
0
        break;
    case "mdj":
        //print epuration(mediahora($do,$calendarium));
        print epuration(mediahora($do, $date_l, $date_fr, $ferial, $sanctoral, $temporal));
        break;
    case "tierce":
        //print epuration(tierce($do,$calendarium));
        print epuration(tierce($do, $date_l, $date_fr, $ferial, $sanctoral, $temporal));
        break;
    case "sexte":
        //print epuration(sexte($do,$calendarium));
        print epuration(sexte($do, $date_l, $date_fr, $ferial, $sanctoral, $temporal));
        break;
    case "none":
        //print epuration(none($do,$calendarium));
        print epuration(none($do, $date_l, $date_fr, $ferial, $sanctoral, $temporal));
        break;
    case "vepres":
        //print epuration(vepres($do,$calendarium));
        print epuration(vepres($do, $date_l, $date_fr, $ferial, $sanctoral, $temporal));
        break;
    case "complies":
        print epuration(complies($do, $calendarium));
        break;
    case "messe":
        print epuration(messe($do, $calendarium));
        break;
}
?>
	</section>
	<footer>
Example #4
0
    $end = micro_time();
    $total = $end - $start;
    $ops = PER_TRIAL / $total;
    echo "total time: {$total}\n";
    echo "ops/sec: {$ops}\n";
    echo "------\n";
}
$small = array("x" => 0);
$medium = array("x" => 0, "integer" => 5, "number" => 5.05, "boolean" => false, "array" => array("test", "benchmark"));
$large = array("x" => 0, "base_url" => "http://www.example.com/test-me", "total_word_count" => 6743, "access_time" => new MongoDate(), "meta_tags" => array("description" => "i am a long description string", "author" => "Holly Man", "dynamically_created_meta_tag" => "who know\n what"), "page_structure" => array("counted_tags" => 3450, "no_of_js_attached" => 10, "no_of_images" => 6), "harvested_words" => array("10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo", "10gen", "web", "open", "source", "application", "paas", "platform-as-a-service", "technology", "helps", "developers", "focus", "building", "mongodb", "mongo"));
batch($db->selectCollection("small_none"), $small);
batch($db->selectCollection("medium_none"), $medium);
batch($db->selectCollection("large_none"), $large);
none($db->selectCollection("small_none"), $small);
none($db->selectCollection("medium_none"), $medium);
none($db->selectCollection("large_none"), $large);
index($db->selectCollection("small_index"), $small);
index($db->selectCollection("medium_index"), $medium);
index($db->selectCollection("large_index"), $large);
find_one($db->selectCollection("small_none"));
find_one($db->selectCollection("medium_none"));
find_one($db->selectCollection("large_none"));
find_one($db->selectCollection("small_index"));
find_one($db->selectCollection("medium_index"));
find_one($db->selectCollection("large_index"));
find($db->selectCollection("small_none"));
find($db->selectCollection("medium_none"));
find($db->selectCollection("large_none"));
find($db->selectCollection("small_index"));
find($db->selectCollection("medium_index"));
find($db->selectCollection("large_index"));