Skip to content

Commit

Permalink
remove dummy() from ImageGuide contract
Browse files Browse the repository at this point in the history
  • Loading branch information
reliq committed Jul 6, 2024
1 parent 80b89c2 commit 290afa3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 37 deletions.
14 changes: 4 additions & 10 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
// get controllers for routes and create the routes for each
foreach ($configProvider->getControllersForRoutes() as $controllerName) {
// if controller name's empty skip
if (!$controllerName) {
if (! $controllerName) {
continue;
}

// if controller name doesn't contain namespace, add it
if (false === strpos($controllerName, '\\')) {
if (! str_contains($controllerName, '\\')) {
$controllerName = sprintf('App\\Http\\Controllers\\%s', $controllerName);
}

// the public route group
Route::group(
$configProvider->getRouteGroupBindings(),
function () use ($configProvider, $controllerName, $modelName) {
static function () use ($configProvider, $controllerName, $modelName) {
// $guidedModel thumbnail
Route::get(
sprintf('.tmb/{%s}//m.{method}/{width}-{height}', $modelName),
Expand All @@ -45,16 +45,10 @@ function () use ($configProvider, $controllerName, $modelName) {
sprintf('%s@resized', $controllerName)
)->name(sprintf('%s.resize', $modelName));

// Dummy $guidedModel
Route::get(
'.dum//{width}-{height}/{color?}/{fill?}',
sprintf('%s@dummy', $controllerName)
)->name(sprintf('%s.dummy', $modelName));

// admin route group
Route::group(
$configProvider->getRouteGroupBindings([], 'admin'),
function () use ($controllerName, $modelName) {
static function () use ($controllerName, $modelName) {
// Used to empty directory photo cache (skimDir)
Route::get(
'empty-cache',
Expand Down
34 changes: 7 additions & 27 deletions src/Contract/ImageGuide.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ public function emptyCache(ImageDispenser $imageDispenser): JsonResponse;
/**
* Get a resized Guided Image.
*
* @param mixed $width
* @param mixed $height
* @param mixed $aspect Keep aspect ratio?
* @param mixed $upSize Allow up-size?
*
* @param mixed $width
* @param mixed $height
* @param mixed $aspect Keep aspect ratio?
* @param mixed $upSize Allow up-size?
* @return Image|string intervention Image object or actual image url
*/
public function resized(
Expand All @@ -40,10 +39,9 @@ public function resized(
/**
* Get a thumbnail.
*
* @param string $method crop|fit
* @param int $width
* @param int $height
*
* @param string $method crop|fit
* @param int $width
* @param int $height
* @return Image|string intervention Image object or actual image url
*/
public function thumb(
Expand All @@ -54,22 +52,4 @@ public function thumb(
$width,
$height
);

/**
* Get dummy Guided Image.
*
* @param mixed $width
* @param mixed $height
* @param mixed $color
* @param mixed $fill
*
* @return Image|string intervention Image object or actual image url
*/
public function dummy(
ImageDispenser $imageDispenser,
$width,
$height,
$color = '#eefefe',
$fill = false
);
}

0 comments on commit 290afa3

Please sign in to comment.