コード例 #1
0
ファイル: File.php プロジェクト: ecomdev/compiler
 /**
  * Return exported PHP code
  *
  * @param ExportableInterface|StatementInterface|mixed $value
  *
  * @return string
  */
 private function export($value)
 {
     if ($value instanceof ExportableInterface) {
         $value = $this->objectBuilder->build($value);
     }
     return $this->exporter->export($value);
 }
コード例 #2
0
ファイル: ExporterSpec.php プロジェクト: ecomdev/compiler
 function it_should_be_possible_use_exportable_interface_for_exporting_if_object_builder_is_provided(ExportableInterface $exportable, ObjectBuilderInterface $objectBuilder)
 {
     $objectBuilder->build($exportable)->shouldBeCalled()->willReturn(new Instance('stdClass'));
     $this->beConstructedWith($objectBuilder);
     $this->export($exportable)->shouldReturn('new stdClass()');
 }