定制 soul-was-here/faker-planet 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

soul-was-here/faker-planet

最新稳定版本:1.0.0

Composer 安装命令:

composer require soul-was-here/faker-planet

包简介

Faker provider for generating fake Planets

README 文档

README

This package will allow Faker to generate planet description including name, type, size, radius, gravity, temperature and water prevalence. There are also several planet templates. See the Usage section for examples.

This package ignores some realistic scientific details (such as scientific planet names) and used to create an interesting background for your story or game etc.

Install

To install, use composer:

composer require soul-was-here/faker-planet

Usage

$faker = \Faker\Factory::create();
$faker->addProvider(new \Faker\Provider\Planet($faker));

/*
 * Generate planet name.
 */ 
echo $faker->planetName(); //Clenai

/*
 * Generate planet type.
 */ 
echo $faker->planetType(); //Gas Giant

/*
 * Generate planet size based on Earth's radius (R / R Earth).
 * Between 0.4x Earth radius and 15x Earth radius.
 */
echo $faker->planetSize(); //1.5

/*
 * Generate planet radius.
 * Between 0.4x Earth radius (2548 km) and 15x Earth radius (95565 km).
 */
echo $faker->planetRadius(); // 5885

/*
 * Generate planet gravity based on Earth's gravity (G / G Earth).
 * Between 0.5x Earth gravity and 400x Earth gravity.
 */
echo $faker->planetGravity(); // 1.8

/*
 * Generate planet average temperature.
 * Between -250°C and 1100°C
 */
echo $faker->planetTemperature(); // 230

/*
 * Generate prevalence of water in percent.
 * Between 0% and 100%
 */
echo $faker->planetWaterPrevalence(); // 25


/*
 * Generate an array representation of an Ice Giant planet.
 */ 
echo $faker->planetIceGiant();

//[
//    'planetType' => 'Ice Giant',
//    'planetSize' => 3.59,
//    'planetRadius' => 22871,
//    'planetGravity' => 201.04,
//    'planetTemperature' => 340,
//    'planetWaterPrevalence' => 9
//]

// You can choose any of these predefined planet types:

$faker->planetIceGiant();
$faker->planetDesert();
$faker->planetEarthLike();
$faker->planetGasGiant();
$faker->planetHumid();
$faker->planetIceGiant();
$faker->planetIce();
$faker->planetRockyExtremeTemperatures();
$faker->planetRockyNoAtmosphere();
$faker->planetRockyFurnace();
$faker->planetRocky();
$faker->planetToxic();
$faker->planetWaterWorld(); 

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: WTFPL
  • 更新时间: 2023-08-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固