Skip to content

Commit

Permalink
Enhancement: Add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Nov 18, 2018
1 parent c676a28 commit 05ea665
Showing 1 changed file with 241 additions and 0 deletions.
241 changes: 241 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,247 @@ The `NormalizeCommand` provided by the `NormalizePlugin` within this package wil
* `--indent-style`: Indent style (one of "space", "tab"); should be used with the `--indent-size` option
* `--no-update-lock`: Do not update lock file if it exists

## Examples

### `laravel/laravel`

Running

```
$ composer normalize
```

against https://github.com/laravel/laravel/blob/v5.6.12/composer.json yields the following diff:

```diff
diff --git a/composer.json b/composer.json
index 65bf8b4f..507ab39c 100644
--- a/composer.json
+++ b/composer.json
@@ -1,9 +1,12 @@
{
"name": "laravel/laravel",
+ "type": "project",
"description": "The Laravel Framework.",
- "keywords": ["framework", "laravel"],
+ "keywords": [
+ "framework",
+ "laravel"
+ ],
"license": "MIT",
- "type": "project",
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
@@ -17,43 +20,42 @@
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
+ "config": {
+ "optimize-autoloader": true,
+ "preferred-install": "dist",
+ "sort-packages": true
+ },
+ "extra": {
+ "laravel": {
+ "dont-discover": []
+ }
+ },
"autoload": {
+ "psr-4": {
+ "App\\": "app/"
+ },
"classmap": [
"database/seeds",
"database/factories"
- ],
- "psr-4": {
- "App\\": "app/"
- }
+ ]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
- "extra": {
- "laravel": {
- "dont-discover": [
- ]
- }
- },
+ "minimum-stability": "dev",
+ "prefer-stable": true,
"scripts": {
+ "post-autoload-dump": [
+ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
+ "@php artisan package:discover"
+ ],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
- ],
- "post-autoload-dump": [
- "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
- "@php artisan package:discover"
]
- },
- "config": {
- "preferred-install": "dist",
- "sort-packages": true,
- "optimize-autoloader": true
- },
- "minimum-stability": "dev",
- "prefer-stable": true
+ }
}
```

### `symfony/symfony`

Running

```
$ composer normalize
```

against https://github.com/symfony/symfony/blob/v4.1.7/composer.json yields the following diff:

```diff
diff --git a/composer.json b/composer.json
index f861cbca31..b36000853a 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,9 @@
"name": "symfony/symfony",
"type": "library",
"description": "The Symfony PHP framework",
- "keywords": ["framework"],
+ "keywords": [
+ "framework"
+ ],
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
@@ -20,7 +22,6 @@
"ext-xml": "*",
"doctrine/common": "~2.4",
"fig/link-util": "^1.0",
- "twig/twig": "^1.35|^2.4.4",
"psr/cache": "~1.0",
"psr/container": "^1.0",
"psr/link": "^1.0",
@@ -29,7 +30,8 @@
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-intl-icu": "~1.0",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php72": "~1.5"
+ "symfony/polyfill-php72": "~1.5",
+ "twig/twig": "^1.35 || ^2.4.4"
},
"replace": {
"symfony/asset": "self.version",
@@ -38,9 +40,9 @@
"symfony/config": "self.version",
"symfony/console": "self.version",
"symfony/css-selector": "self.version",
- "symfony/dependency-injection": "self.version",
"symfony/debug": "self.version",
"symfony/debug-bundle": "self.version",
+ "symfony/dependency-injection": "self.version",
"symfony/doctrine-bridge": "self.version",
"symfony/dom-crawler": "self.version",
"symfony/dotenv": "self.version",
@@ -65,11 +67,11 @@
"symfony/proxy-manager-bridge": "self.version",
"symfony/routing": "self.version",
"symfony/security": "self.version",
+ "symfony/security-bundle": "self.version",
"symfony/security-core": "self.version",
"symfony/security-csrf": "self.version",
"symfony/security-guard": "self.version",
"symfony/security-http": "self.version",
- "symfony/security-bundle": "self.version",
"symfony/serializer": "self.version",
"symfony/stopwatch": "self.version",
"symfony/templating": "self.version",
@@ -84,32 +86,37 @@
"symfony/workflow": "self.version",
"symfony/yaml": "self.version"
},
+ "conflict": {
+ "phpdocumentor/reflection-docblock": "<3.0 || >=3.2.0,<3.2.2",
+ "phpdocumentor/type-resolver": "<0.3.0",
+ "phpunit/phpunit": "<5.4.3"
+ },
+ "provide": {
+ "psr/cache-implementation": "1.0",
+ "psr/container-implementation": "1.0",
+ "psr/log-implementation": "1.0",
+ "psr/simple-cache-implementation": "1.0"
+ },
"require-dev": {
"cache/integration-tests": "dev-master",
"doctrine/annotations": "~1.0",
"doctrine/cache": "~1.6",
"doctrine/data-fixtures": "1.0.*",
"doctrine/dbal": "~2.4",
- "doctrine/orm": "~2.4,>=2.4.5",
"doctrine/doctrine-bundle": "~1.4",
+ "doctrine/orm": "~2.4,>=2.4.5",
+ "egulias/email-validator": "~1.2,>=1.2.8 || ~2.0",
"monolog/monolog": "~1.11",
- "ocramius/proxy-manager": "~0.4|~1.0|~2.0",
+ "ocramius/proxy-manager": "~0.4 || ~1.0 || ~2.0",
+ "phpdocumentor/reflection-docblock": "^3.0 || ^4.0",
"predis/predis": "~1.0",
- "egulias/email-validator": "~1.2,>=1.2.8|~2.0",
- "symfony/phpunit-bridge": "~3.4|~4.0",
- "symfony/security-acl": "~2.8|~3.0",
- "phpdocumentor/reflection-docblock": "^3.0|^4.0"
+ "symfony/phpunit-bridge": "~3.4 || ~4.0",
+ "symfony/security-acl": "~2.8 || ~3.0"
},
- "conflict": {
- "phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2",
- "phpdocumentor/type-resolver": "<0.3.0",
- "phpunit/phpunit": "<5.4.3"
- },
- "provide": {
- "psr/cache-implementation": "1.0",
- "psr/container-implementation": "1.0",
- "psr/log-implementation": "1.0",
- "psr/simple-cache-implementation": "1.0"
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.1-dev"
+ }
},
"autoload": {
"psr-4": {
@@ -128,12 +135,9 @@
]
},
"autoload-dev": {
- "files": [ "src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
+ "files": [
+ "src/Symfony/Component/VarDumper/Resources/functions/dump.php"
+ ]
},
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-master": "4.1-dev"
- }
- }
+ "minimum-stability": "dev"
}
```


## Changelog

Please have a look at [`CHANGELOG.md`](CHANGELOG.md).
Expand Down

0 comments on commit 05ea665

Please sign in to comment.