Skip to content

Instantly share code, notes, and snippets.

@bigplants
Last active December 18, 2015 08:24
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bigplants/b215ab4e9320ae72b355 to your computer and use it in GitHub Desktop.
PhpStormでmethodを分割する方法 ref: http://qiita.com/bigplants@github/items/56c2d2af025f501610e0
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;
}
}
foreach ($data as $k => $v) {
$data[$k]['a'] = $test1;
$data[$k]['b'] = $test2;
$data[$k]['c'] = $test3;
}
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