How can I tell PhpStorm (using version 8.0.3) to keep the following array as is when clicking Cmd+Alt+L to reformat my code:
$array = [
'short' => 1, // I want this...
'veryVeryVeryIncrediblyLong' => 123456789,
];
Instead of doing this:
$array = [
'short' => 1, // Not this...
'veryVeryVeryIncrediblyLong' => 123456789,
];
Settings (Preferences on Mac) | Editor | Code Style | PHP | Other | Array declaration style -> Align key-value pairs
Since PhpStorm 2017.x version it is now located at Settings (Preferences on Mac) | Editor | Code Style | PHP | Wrapping and Braces --> Array initializer | Align key-value pairs
In Phpstorm 2017.3 & later , This setting is located at
File | Settings | Editor | Code Style | PHP | Wrapping and Braces | Array initializer | Align key-value pairs
Preferences → Editor → Code Style → PHP → Other → Align key-value pairs
PhpStorm 2019 and up: Settings -> editor -> PHP -> Wrapping and Braces -> Array initializer -> Align key-value pairs [*] (Linux OS)
In phpstorm 2019 it goes somewhere like this:
(settings > editor > php > Wrapping and Braces > Assignment statement > Align consecutive assignments)
PHPStorm 9 align assignments in PHP
Related
public static void main (String [] args) {
int Sun = 60;
}
How to change the color of Sun?
Now in IntelliJ IDEA it is grey, but I want to change it to orange.
Grey is a color of the unused symbol: Settings (Preferences on macOS) | Editor | Color Scheme | General | Errors and Warnings | Unused code.
Once your variable is actually used in the code, its color will change to Settings (Preferences on macOS) | Editor | Color Scheme | Language Defaults | Identifiers | Local variable.
How to wrapp all log.debug or log.info statement in single line in intellij.
Example:
//it it formated like this in Intellij.
log.debug("param1 {}, param 2 {}, param 3 {}, param 4 {}",
param1,
param2,
param3,
param4);
But I want like this.
log.debug("param1 {}, param 2 {}, param 3 {}, param 4 {}",param1,param2,param3,param4);
I tried with "simple statement singleline" doesnt help.
is there any where I can configure like log.debug statements should be in single line.
Make sure you have
Settings (Preferences on macOS) | Editor | Code Style | Java | Wrapping and Braces | Method call arguments set to Do not wrap
Settings (Preferences on macOS) | Editor | Code Style | Java | Wrapping and Braces | Keep when reformatting | Line breaks disabled.
It was disappear, the one in red:
Breadcrumbs:
File | Settings | Editor | General | Breadcrumbs:
Is there a way to move uploaded file and name it with german characters?
I have a form where user inputs his name and surname and adds a file.
File is uploaded correctly and all input fields are saved in mysql database.
public function store(Request $request)
{
$file = $request->file('file');
$file_name = $request->input('name_surname') . '_' . $request->input('month') . '.' . $file->getClientOriginalExtension();
$request->file('file')->move('uploads', $file_name);
$this->report->create(array('name_surname' => $request->input('name_surname'),
'file_name' => $file_name,
'ini_file_name' => $file->getClientOriginalName(),
'month' => $request->input('month'),
'sum' => $request->input('sum')));
return redirect('/');
}
When I open my 'uploads' folder, file name looks like this:
Günter Baumgärtner_Februar 2015.pdf
dd($file_name); shows this:
"Günter Baumgärtner_Februar 2015.pdf"
MySQL record looks like this:
id | name_surname | month | sum | file_name | ini_file_name
39 | Günter Baumgärtner | Februar 2015 | 200 | Günter Baumgärtner_Februar 2015.pdf | report-11-02-2015_01-36.pdf
Looks like a problem with your system encoding. Is your machine running Linux?
If yes, check your server LANG enviromental variable: at command prompt type locale and look at a line starting with LANG=. If it is LANG=en_US.UTF-8 (or any other value ending with .UTF-8) then renaming/creating files with german characters should work. In my environment (LANG=pl_PL.UTF-8) it works, my Laravel app created a file named Günter_Baumgärtner.csv.
If your LANG is set to non-UTF-8 value, then should change it, but the way how to do it depends on your Linux distribution.
I am new in Selenium IDE and need to assertText a value that has line break. Example:
Actual Message to assertText:
Hello
World
store | Hello <br/> World | txtValue
assertText | id=label | ${txtValue}
Please help.
Pass your id=label into a variable, remove the line breaks, then run an assertion against the variable.
Store expected text:
store | Hello World | txtValue
Store page text:
storeText | xpath=(//*[#id=label]) | labelValue
Remove line breaks from page text:
echo | javascript{storedVars.labelValue = storedVars.labelValue.replace(/(\r\n|\n|\r)/gm,"")} |
Assert your expected text = your page text:
assertExpression | javascript{storedVars.txtValue==storedVars.labelValue} | true
Following pattern matching worked for me on Selenium IDE 2.5.0
regexp:Hello\s+World