There is no problem not worth solving, and no technology not worth learning!

After formatting the homestead.yaml file in phpstorm, the indentation of the format is inconsistent with the homestead.yaml.example

在 PhpStorm 中格式化 Homestead.yaml 文件后,格式的缩进不正确,格式如下

1. After formatting the homestead.yaml file in phpstorm, the indentation of the format is incorrect, the format is as follows. as shown in Figure 1

在 PhpStorm 中格式化 Homestead.yaml 文件后,格式的缩进不正确,格式如下
Figure 1

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa
    - ~/.ssh/id_rsa.pub

folders:
    -   map: E:/wwwroot/refactoring
        to: /home/vagrant/Code/refactoring

sites:
    -   map: refactoring.test
        to: /home/vagrant/Code/refactoring

databases:
    - homestead

features:
    -   mysql: true
    -   mariadb: false
    -   postgresql: false
    -   ohmyzsh: false
    -   webdriver: false

services:
    -   enabled:
            - "mysql"
#    - disabled:
#        - "postgresql@11-main"

#ports:
#    - send: 33060 # MySQL/MariaDB
#      to: 3306
#    - send: 4040
#      to: 4040
#    - send: 54320 # PostgreSQL
#      to: 5432
#    - send: 8025 # Mailhog
#      to: 8025
#    - send: 9600
#      to: 9600
#    - send: 27017
#      to: 27017



2. Check the format of homestead.yaml.example, – there is only one space with map. as shown in Figure 2

查看 Homestead.yaml.example 的格式,- 与 map 仅有一个空格
Figure 2

---
ip: "192.168.56.56"
memory: 2048
cpus: 2
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/code
      to: /home/vagrant/code

sites:
    - map: homestead.test
      to: /home/vagrant/code/public

databases:
    - homestead

features:
    - mariadb: false
    - ohmyzsh: false
    - webdriver: false

#services:
#    - enabled:
#        - "postgresql@12-main"
#    - disabled:
#        - "postgresql@11-main"

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp



3. Reference:https://www.jetbrains.com.cn/help/phpstorm/2021.3/yaml.html. Settings – Editor – Code Style – YAML . Settings may be overridden by EditorConfig. Disabled. as shown in Figure 3

参考:https://www.jetbrains.com.cn/help/phpstorm/2021.3/yaml.html 。设置 - 编辑器 - 代码样式 - YAML 。设置可能被 EditorConfig 重写。禁用掉
Figure 3

4. Format the code again. The format is basically the same as homestead.yaml.example . as shown in Figure 4

再次格式化代码。格式与 Homestead.yaml.example 基本上保持一致
Figure 4

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
  - ~/.ssh/id_rsa
  - ~/.ssh/id_rsa.pub

folders:
  - map: E:/wwwroot/refactoring
    to: /home/vagrant/Code/refactoring

sites:
  - map: refactoring.test
    to: /home/vagrant/Code/refactoring

databases:
  - homestead

features:
  - mysql: true
  - mariadb: false
  - postgresql: false
  - ohmyzsh: false
  - webdriver: false

services:
  - enabled:
      - "mysql"
#    - disabled:
#        - "postgresql@11-main"

#ports:
#    - send: 33060 # MySQL/MariaDB
#      to: 3306
#    - send: 4040
#      to: 4040
#    - send: 54320 # PostgreSQL
#      to: 5432
#    - send: 8025 # Mailhog
#      to: 8025
#    - send: 9600
#      to: 9600
#    - send: 27017
#      to: 27017



Need long-term technical maintenance or remote troubleshooting?

I am a PHP / Go backend engineer with 15+ years of experience, focused on existing system maintenance, bug fixing, performance optimization, server troubleshooting, WordPress maintenance, and small feature iterations.

If your project is facing any of the following issues, we can start with a small troubleshooting task first:

  • ✅ PHP / Laravel / Yii2 legacy systems without active maintenance
  • ✅ Go / Gin backend APIs that need troubleshooting or optimization
  • ✅ Slow, broken, or unstable WordPress websites
  • ✅ Nginx / MySQL / Redis / Linux server issues
  • ✅ CDN / Cloudflare / DNS / HTTPS configuration problems
  • ✅ Long-term remote technical support or part-time maintenance

More details: About Me & Collaboration

WeChat: 13980074657
Email: shuijingwanwq@gmail.com
Telegram: @shuijingwan
GitHub: https://github.com/shuijingwan

评论

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.