PHPの条件を単純化できるかどうか疑問に思いました。
から:
/* Do nothing if there are no taxonomies. */
if(!property_exists(__CLASS__, 'taxonomies') || !$this->taxonomies || empty($this->taxonomies) || is_null($this->taxonomies)){
return;
}
に:
/* Do nothing if there are no taxonomies. */
if(!property_exists(__CLASS__, 'taxonomies') || !$this->taxonomies){
return;
}
!$this->taxonomies
達成!is_null($this->taxonomies)
し!empty($this->taxonomies)
ますか?
- クラスプロパティが存在する必要があります。
- データはNULLであってはなりません。
- データは間違いなく空にすることはできません。
- データに誤った値を設定してはなりません。