Skip to content

Instantly share code, notes, and snippets.

@simensen
Created July 28, 2014 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simensen/f9b57934e4be6f01b58a to your computer and use it in GitHub Desktop.
Save simensen/f9b57934e4be6f01b58a to your computer and use it in GitHub Desktop.
<?php
// If I copy and paste this unindented code...
$app->post('/admin/brands/{brandId}/unarchive', function (Application $app, Request $request, $brandId) {
$redirect = function () use ($app, $request) {
// TODO: Use URL Generator?
return $app->redirect($request->getBasePath() . '/admin/brands');
};
});
// It pastes as this... which is more or less exactly how it ends
// up looking if I just type it in and hit enter naturally...
$app->post('/admin/brands/{brandId}/unarchive', function (Application $app, Request $request, $brandId) {
$redirect = function () use ($app, $request) {
// TODO: Use URL Generator?
return $app->redirect($request->getBasePath() . '/admin/brands');
};
});
// What I expected is this...
$app->post('/admin/brands/{brandId}/unarchive', function (Application $app, Request $request, $brandId) {
$redirect = function () use ($app, $request) {
// TODO: Use URL Generator?
return $app->redirect($request->getBasePath() . '/admin/brands');
};
});
@acelaya
Copy link

acelaya commented Jul 29, 2014

I had the same problem and I think I just found the configuration option to fix this.
Go to File -> settings and then select Code style -> PHP -> Tabs and Indents and set the Continuation indent to 0.
That has fixed the problem for me without breaking any other indentation (I'm still testing, but looks good by the moment).

@simensen
Copy link
Author

@acelaya Thanks for the tip! I'll try this configuration for awhile. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment