Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53f2fec

Browse files
committed
Add fluent setter
1 parent435c0e0 commit53f2fec

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ class Foo {
268268
}
269269
```
270270

271-
Hit`<Leader>sg` and you'll be prompted if you want to create setters and getters for existing properties.
271+
Hit`<Leader>sg` and you'll be prompted if you want to create setters and getters for existing properties and if you want to make the setter fluent.
272272

273273
```php
274274
<?php

‎doc/refactoring-toolbox.txt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
*refactoring-toolbox*
1+
*refactoring-toolbox*
22

3-
__________ _____ __ .__ ___________ .__ ___.
3+
__________ _____ __ .__ ___________ .__ ___.
44
\______ \ _____/ ____\____ _____/ |_ ___________|__| ____ ____ \__ ___/___ ____ | |\_ |__ _______ ___
55
| _// __ \ __\\__ \ _/ ___\ __\/ _ \_ __ \ |/ \ / ___\ | | / _ \ / _ \| | | __ \ / _ \ \/ /
6-
| | \ ___/| | / __ \\ \___| | ( <_> ) | \/ | | \/ /_/ > | |( <_> | <_> ) |_| \_\ ( <_> > <
6+
| | \ ___/| | / __ \\ \___| | ( <_> ) | \/ | | \/ /_/ > | |( <_> | <_> ) |_| \_\ ( <_> > <
77
|____|_ /\___ >__| (____ /\___ >__| \____/|__| |__|___| /\___ / |____| \____/ \____/|____/___ /\____/__/\_ \
88
\/ \/ \/ \/ \//_____/ \/ \/
99

@@ -229,7 +229,7 @@ class Foo {
229229
private $bar;
230230
}
231231

232-
Hit <Leader>sg and you'll be prompted if you want to create setters and getters for existing properties.
232+
Hit`<Leader>sg` and you'll be prompted if you want to create setters and getters for existing properties and if you want to make the setter fluent.
233233

234234
<?php
235235

‎plugin/php-refactoring-toolbox.vim‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ function! PhpCreateSettersAndGetters() " {{{
128128
endif
129129
ifsearch(s:php_regex_func_line ."set" .l:camelCaseName .'\>','n')==0
130130
calls:PhpInsertMethod("public","set" .l:camelCaseName, ['$' .substitute(l:property,'^_','','') ],"$this->" .l:property ." = $" .substitute(l:property,'^_','','') .";\n")
131+
calls:PhpEchoError('Make fluent?')
132+
ifinputlist(["0. No","1. Yes"])==1
133+
exec"normal! jo\<CR>return $this;"
134+
endif
131135
endif
132136
ifsearch(s:php_regex_func_line ."get" .l:camelCaseName .'\>','n')==0
133137
calls:PhpInsertMethod("public","get" .l:camelCaseName, [],"return $this->" .l:property .";\n")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp