Skip to content

Instantly share code, notes, and snippets.

@PJZ9n
Created August 7, 2020 17:16
Show Gist options
  • Save PJZ9n/0bc228073343da06d419601a79f94653 to your computer and use it in GitHub Desktop.
Save PJZ9n/0bc228073343da06d419601a79f94653 to your computer and use it in GitHub Desktop.
捨てるの勿体ない気がするから
<?php
/**
* @param int $type
* @param int $itemId
* @param int $itemDamage
*
* @return ShopItem|null
*/
public function searchShopItem(int $type, int $itemId, int $itemDamage): ?ShopItem
{
foreach ($this->shopItems as $shopItem) {
if (
$shopItem->getType() === $type &&
$shopItem->getItemId() === $itemId &&
$shopItem->getItemDamage() === $itemDamage
) {
return $shopItem;
}
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment