PhpStormでmethodを分割する方法 ref: http://qiita.com/bigplants@github/items/56c2d2af025f501610e0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hoge | |
{ | |
function a($data) | |
{ | |
$test1 = 'test'; | |
$test2 = 'test'; | |
$test3 = 'test'; | |
foreach ($data as $k => $v) { | |
$data[$k]['a'] = $test1; | |
$data[$k]['b'] = $test2; | |
$data[$k]['c'] = $test3; | |
} | |
return $data; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ($data as $k => $v) { | |
$data[$k]['a'] = $test1; | |
$data[$k]['b'] = $test2; | |
$data[$k]['c'] = $test3; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hoge | |
{ | |
function a($data) | |
{ | |
$test1 = 'test'; | |
$test2 = 'test'; | |
$test3 = 'test'; | |
$data = $this->b($data, $test1, $test2, $test3); | |
return $data; | |
} | |
/** | |
* @param $data | |
* @param $test1 | |
* @param $test2 | |
* @param $test3 | |
* | |
* @return mixed | |
*/ | |
public function b($data, $test1, $test2, $test3) | |
{ | |
foreach ($data as $k => $v) { | |
$data[$k]['a'] = $test1; | |
$data[$k]['b'] = $test2; | |
$data[$k]['c'] = $test3; | |
} | |
return $data; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment