Skip to content

Instantly share code, notes, and snippets.

View mirdic's full-sized avatar

Mirko Hüttner mirdic

View GitHub Profile
<?php declare(strict_types=1);
namespace Test\Functional\ApiModule\V1Module;
class BaseApiTest extends BaseFunctionalTest
{
protected function _before()
{
/** @var EntityManager $em */
$em = $this->tester->grabService(EntityManager::class);
<?php declare(strict_types=1);
namespace App\Ublaboo\DataGrid\DataSource;
use Doctrine\ORM\Tools\Pagination\Paginator;
use Nette\Utils\Strings;
/**
* @method void onDataLoaded(array $result)
*/
<?php
$im = imagecreatefrompng('alphatest.png');
$size = min(imagesx($im), imagesy($im));
$im2 = imagecrop($im, ['x' => 0, 'y' => 0, 'width' => $size, 'height' => $size]);
if ($im2 !== FALSE) {
imagepng($im2, 'example-cropped.png');
imagedestroy($im2);
}
imagedestroy($im);