Esempio n. 1
0
 private function isCorrectValueType($value)
 {
     if ($this->valueType === "?") {
         return true;
     }
     return $this->valueType === TypeUtil::getType($value);
 }
Esempio n. 2
0
 public function add($element)
 {
     if (!$this->isCorrectType($element)) {
         throw new IllegalArgumentException("Tried to add element of type " . TypeUtil::getType($element) . " to list of type " . $this->type);
     }
     $this->elements[$element] = $element;
 }
Esempio n. 3
0
<?php

/*
  This file is part of the Pastebin package.
  Copyright (c) 2003-2008, Stephen Olesen
  All rights reserved.
  More information is available at http://pastebin.ca/
*/
require_once "include/global.inc.php";
$tpl = new Template();
$tpl->assign('typeOptions', TypeUtil::getOptionList());
if (isset($_GET["id"])) {
    $p = new Paste();
    if ($p->load($_GET["id"])) {
        $tpl->assign('paste', $p);
        $tpl->headers();
        if ($p->id_mask != null) {
            $tpl->assign('urlid', $p->id_mask);
        } else {
            $tpl->assign('urlid', $p->id);
        }
        $tpl->assign('title', _("General Pastebin") . " - " . htmlentities($p->poster, ENT_COMPAT, "UTF-8") . " - " . _("Paste number") . " " . $p->id);
        $tpl->display('paste-main.tpl', $p->id);
        exit;
    }
}
$tpl->headers();
$tpl->display('main.tpl');
Esempio n. 4
0
 protected function isCorrectType($element)
 {
     if ($this->type === "?") {
         return true;
     }
     return $this->type === TypeUtil::getType($element);
 }
Esempio n. 5
0
 function testPrimitiveIsNotObjectType()
 {
     $this->assertFalse(TypeUtil::isObjectType("string"));
 }
Esempio n. 6
0
 function testSampleNotComparable()
 {
     $this->assertFalse(TypeUtil::isClassComparable("SampleNotComparable"));
 }
Esempio n. 7
0
 function testObjectIsNotPrimitive()
 {
     $this->assertFalse(TypeUtil::isPrimitive("IsPrimitiveTypeTest"));
 }