예제 #1
0
 /**
  * @param \ReflectionClass|\ReflectionMethod $reflection
  * @param DocInfo $docInfo
  * @param CodeEntity $code
  */
 public function applyInfoToEntity($reflection, DocInfo $docInfo, CodeEntity $code)
 {
     $code->setName($reflection->getName());
     $code->setDescription($docInfo->getDescription());
     $code->setExample($docInfo->getExample());
     if ($docInfo->getDeprecationMessage()) {
         $code->isDeprecated(true);
         $code->setDeprecationMessage($docInfo->getDeprecationMessage());
     }
 }
예제 #2
0
 /**
  * Convert property
  */
 public function testConvertProperty()
 {
     $this->assertEquals('', DocInfo::convertProperty('a', 'empty'));
     $this->assertNull(DocInfo::convertProperty('a', 'null'));
     $this->assertEquals(8, DocInfo::convertProperty('8', 'int'));
     $this->assertEquals(8, DocInfo::convertProperty('8.3', 'uint'));
     $this->assertEquals(8.300000000000001, DocInfo::convertProperty('8.3', 'decimal'));
     $this->assertEquals('8.3', DocInfo::convertProperty('8.3', 'lpstr'));
     $this->assertEquals(strtotime('10/11/2013'), DocInfo::convertProperty('10/11/2013', 'date'));
     $this->assertTrue(DocInfo::convertProperty('true', 'bool'));
     // todo: change to assertNotTrue when got upgraded to PHPUnit 4.x
     $this->assertEquals(false, DocInfo::convertProperty('1', 'bool'));
     $this->assertEquals('1', DocInfo::convertProperty('1', 'array'));
     $this->assertEquals('1', DocInfo::convertProperty('1', ''));
     $this->assertEquals(DocInfo::PROPERTY_TYPE_INTEGER, DocInfo::convertPropertyType('int'));
     $this->assertEquals(DocInfo::PROPERTY_TYPE_INTEGER, DocInfo::convertPropertyType('uint'));
     $this->assertEquals(DocInfo::PROPERTY_TYPE_FLOAT, DocInfo::convertPropertyType('decimal'));
     $this->assertEquals(DocInfo::PROPERTY_TYPE_STRING, DocInfo::convertPropertyType('lpstr'));
     $this->assertEquals(DocInfo::PROPERTY_TYPE_DATE, DocInfo::convertPropertyType('date'));
     $this->assertEquals(DocInfo::PROPERTY_TYPE_BOOLEAN, DocInfo::convertPropertyType('bool'));
     $this->assertEquals(DocInfo::PROPERTY_TYPE_UNKNOWN, DocInfo::convertPropertyType('array'));
     $this->assertEquals(DocInfo::PROPERTY_TYPE_UNKNOWN, DocInfo::convertPropertyType(''));
 }
예제 #3
0
파일: _form.php 프로젝트: ratiw/petro-test
}
?>

<?php 
echo Form::open(array('id' => 'form1', 'class' => 'form-horizontal'));
?>

	<div class="panel">
		<div class="panel-header">
			<h3>Panel Header</h3>
		</div>
		<div class="panel-content">
			<div class="row-fluid">
				<div class="span6">
					<?php 
$docinfo = DocInfo::get_next('MK');
$attr = array('id' => 'form1_mk_no', 'autofocus' => 'autofocus');
if ($this_method != 'create') {
    $attr['disabled'] = 'disabled';
}
echo Form::hidden('last_docno', $docinfo['last'], array('id' => 'form1_last_docno'));
?>
					<div class="control-group<?php 
echo isset($errors['mk_no']) ? ' error' : '';
?>
">
						<label class="control-label" for="mk_no"><?php 
echo __('mk_no');
?>
 <span class="badge badge-error" title="this is requried">:</span><?php 
echo Petro::render_errors($errors, 'mk_no');
예제 #4
0
파일: docmk2.php 프로젝트: ratiw/petro-test
 public function action_next_docno()
 {
     $docno = DocInfo::get_next('MK');
     return \Response::forge($docno['next']);
 }