コード例 #1
0
 /**
  * Test that the Stapler class can build a single instance of
  * the Resizer class.
  *
  * @test
  * @return void
  */
 public function it_should_be_able_to_create_a_singleton_resizer_instance()
 {
     $resizer1 = Stapler::getResizerInstance('Imagine\\Gd\\Imagine');
     $resizer2 = Stapler::getResizerInstance('Imagine\\Gd\\Imagine');
     $this->assertInstanceOf('Codesleeve\\Stapler\\File\\Image\\Resizer', $resizer1);
     $this->assertSame($resizer1, $resizer2);
 }
コード例 #2
0
ファイル: Attachment.php プロジェクト: laravelian/stapler
 /**
  * Build out the dependencies required to create
  * a new attachment object.
  *
  * @param string $name
  * @param array  $options
  *
  * @return array
  */
 protected static function buildDependencies($name, array $options)
 {
     return [new AttachmentConfig($name, $options), Stapler::getInterpolatorInstance(), Stapler::getResizerInstance($options['image_processing_library'])];
 }